{"_id":"codegen-templates-scripts","_rev":"1453-1fb9b0f36ebd325f2b038e4a010eda6c","name":"codegen-templates-scripts","dist-tags":{"latest":"0.18.2","canary":"0.19.0-alpha.80ec87c7"},"versions":{"0.10.0":{"name":"codegen-templates-scripts","version":"0.10.0","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.16.0","copyfiles":"2.0.0","jest":"23.2.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.0.0","typescript":"2.9.2","webpack":"4.14.0","webpack-cli":"3.0.8","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.10.0","dist":{"shasum":"7940c660c6ea1c267b139d7c4d4a237658f10b01","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.10.0.tgz","fileCount":22,"unpackedSize":17335,"integrity":"sha512-ifOV0tlEuTcuKUoUvtqwmG8MeLaXW8r6KXGxUMyEyI3yzQlF8mREco3QBpYgH5vR6xV1+1XuwEvTKMipytNMBg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFXuyf9M8gazExV4dGwvMP/KTWIpWIG6VBCJ0kKAiBL5AiAVntVjrLRsRqeAT5OoPDrFN/O3sd/RB7xk508EDwI7Uw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.10.0_1530611631973_0.9548651481634121"},"_hasShrinkwrap":false},"0.11.0-alpha.88f075da":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.88f075da","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.16.0","copyfiles":"2.0.0","jest":"23.2.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.0.0","typescript":"2.9.2","webpack":"4.14.0","webpack-cli":"3.0.8","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.88f075da","dist":{"shasum":"75ccb317bc172ed78b66ef59062373c0618bfc12","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.88f075da.tgz","fileCount":22,"unpackedSize":17361,"integrity":"sha512-iJYNQyyTQ5l8i7MRTPA1yawbw5PIjuRvMcfnX4DkZUD0kN6OAd7DToP0t1NH1XhIYZyeCbCiwQtG7K+XKDSkuQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdTxBsN1jZLCxwoU6JFjaoKY1kp8BE8XaaPYGc7ouhoAIhAIW1gO9NtRIK+vccS8Qz+ZWiKY9OofH1BejCEl0kXPAN"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.88f075da_1530627901129_0.6536626889136705"},"_hasShrinkwrap":false},"0.10.1":{"name":"codegen-templates-scripts","version":"0.10.1","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.16.0","copyfiles":"2.0.0","jest":"23.2.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.0.0","typescript":"2.9.2","webpack":"4.14.0","webpack-cli":"3.0.8","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.10.1","dist":{"shasum":"2fc36042b058fdc3e1bc6d7431949516c2ace824","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.10.1.tgz","fileCount":22,"unpackedSize":17346,"integrity":"sha512-HAoiPZ4idFzVKd8k6QVV4LKZppV1/XhnRoGAwF7SN+rMUtaXuCGGVzTK38FOTeBttWY7N3Hf8aJtrw8Fjma0PQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFk9nT0as/hPH/KQzrz5kiArCRP+wxD5UW67xL51g/nmAiBpT0PnwkPkaLGuqM4vOKC+HobMVIuPsyXgEfB9GaYP1g=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.10.1_1530628073396_0.5392814564912962"},"_hasShrinkwrap":false},"0.10.2":{"name":"codegen-templates-scripts","version":"0.10.2","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.16.0","copyfiles":"2.0.0","jest":"23.4.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.0.0","typescript":"2.9.2","webpack":"4.16.0","webpack-cli":"3.0.8","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.10.2","dist":{"shasum":"02e39b5e31a47560ffc9c665fca685fea4e1e40a","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.10.2.tgz","fileCount":22,"unpackedSize":17346,"integrity":"sha512-GgXqOb8YwxknvPJ5woPKy31UVM1eKKFNGV5giHamYKCHEE2jNrulB53B8tr6toWlloO0iBo0MkCEjBc0iYCGRg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGbfznOU2OTWnXvmlgVum+CXAk9h5Lx95N/DO/Jb4ECeAiEAgEH3QQUadtvpP33Ub1BupuOvctuiu/rmoB8ZrAuGWig="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.10.2_1531380765683_0.22471810982598583"},"_hasShrinkwrap":false},"0.10.3":{"name":"codegen-templates-scripts","version":"0.10.3","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.16.0","copyfiles":"2.0.0","jest":"23.4.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.0.0","typescript":"2.9.2","webpack":"4.16.0","webpack-cli":"3.0.8","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.10.3","dist":{"shasum":"795d53b4fdb72487721a83c90acd8f48d8b3c99f","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.10.3.tgz","fileCount":22,"unpackedSize":17346,"integrity":"sha512-ZnQLOQwSULcHTQqponu+pdW0LVlQw7gbJmrsQ2od3JvRYQUyq4uo7uZM265NECj5U1sNwiD4rnu86xuWptxj3g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwTUuPjJldklc0fdm87T4nNToJA28/wkN98kBO70aqSQIgEADIyHWcJlpYId2yoW+U/C14UHj1yKW/4Ds4h99sttI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.10.3_1531386387040_0.40199397564084594"},"_hasShrinkwrap":false},"0.11.0-alpha.05b04f2e":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.05b04f2e","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.16.0","copyfiles":"2.0.0","jest":"23.4.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.0.0","typescript":"2.9.2","webpack":"4.16.0","webpack-cli":"3.0.8","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.05b04f2e","dist":{"shasum":"32f8fcd8d28f8c8a3c9f82462971a0080d12e71a","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.05b04f2e.tgz","fileCount":22,"unpackedSize":17361,"integrity":"sha512-Gn7m+vZOsXIzM8wrPi3p3sheNmEyw2WYyMHdoasdLC0HcCDgtPP9d4bpKV94FVF9mc+GZkYy7HvuhalIFfiS3A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHd9nJNcdgQMxarL8Fl3S9nT3DYxozJQ02r3SON66ahCAiEAxyV3EmwqT3YvmID2vlBEwVBBcHVWHbzMhIpkPXGM+EI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.05b04f2e_1531407752133_0.1832316437950674"},"_hasShrinkwrap":false},"0.11.0-alpha.50095dc4":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.50095dc4","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.16.0","copyfiles":"2.0.0","jest":"23.4.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.0.0","typescript":"2.9.2","webpack":"4.16.0","webpack-cli":"3.0.8","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.50095dc4","dist":{"shasum":"8da0745faa9c87417f6bf3046b2070f555b89962","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.50095dc4.tgz","fileCount":22,"unpackedSize":17361,"integrity":"sha512-ifMjDgKL26TW3V3hcpzD4vKoVgNBry2JImk366swJUBNpINo+NlD2QdZRhebAhg9kz9n37fHFGsQqTqduAPcbg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWx0XiNnaFBrs3mF8UiFDWcLolpcqSdq6NuRFNncqxqwIgSUG6xS/+I8eYsE/ez8N4CHvcVfufc3eYDwJ9fb4/R/U="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.50095dc4_1531564906538_0.033780688088330235"},"_hasShrinkwrap":false},"0.11.0-alpha.3f939e67":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.3f939e67","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.16.0","copyfiles":"2.0.0","jest":"23.4.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.0.0","typescript":"2.9.2","webpack":"4.16.0","webpack-cli":"3.0.8","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.3f939e67","dist":{"shasum":"cba986aa94b4fc30795f5105bb36e38400642b91","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.3f939e67.tgz","fileCount":22,"unpackedSize":17361,"integrity":"sha512-R/+MCucHmCq/PiUjW+HVAffwrvu/Qcw5C6/Pi33Neg89eHdGyIx4Uwu2uGnypZiO2MsvqaQjmEKj2sU0J6eycg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEF+9Ld96EYs3zVT24gfM46R0ipptoZ2A07v3Lhb88bKAiAu/c8sTDxJY4h1KvUwfFMJY19tT9X3Re+rRnPybyP91Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.3f939e67_1531565822154_0.3118721099257771"},"_hasShrinkwrap":false},"0.11.0-alpha.de921266":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.de921266","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.16.0","copyfiles":"2.0.0","jest":"23.4.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.0.0","typescript":"2.9.2","webpack":"4.16.0","webpack-cli":"3.0.8","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.de921266","dist":{"shasum":"9decaed3f95812d036a39d33cbc51cf0e08ce7d8","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.de921266.tgz","fileCount":22,"unpackedSize":17361,"integrity":"sha512-1WRkjQuglrj1IFEuUFqdBXJPmQL25yTGhnb+hT5K6CDc5vNFtmL9w4Phsmyxk8m7xshAS8QZGo28tUNFzTi/1w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG3QcbNKhCJaumvoNms0yYgnARsH/TjKijjKBvjkBcUiAiEApMrGi7Nwtm5kQFsA5pJTCCYapZhHIVwQIFxdGpN/N7k="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.de921266_1531641862500_0.4989484030241018"},"_hasShrinkwrap":false},"0.11.0-alpha.a72102c0":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.a72102c0","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.16.0","copyfiles":"2.0.0","jest":"23.4.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.0.0","typescript":"2.9.2","webpack":"4.16.0","webpack-cli":"3.0.8","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.a72102c0","dist":{"shasum":"ac2a419cf581f06759f4988a7f4d37e1e1d1e95d","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.a72102c0.tgz","fileCount":22,"unpackedSize":17361,"integrity":"sha512-zW2LN4Yc3ZX7bNSYul5ljyvdzhSPONDUj7tTDeAKK6/zxG5YLGr2VhzbWifjWgbrUF9Tsv2DAxv7XWQXTKwjow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/UuqCP9/FBZhAaYHDJfwudBIzofoo/6YTOKbRtFbHowIgafS1Oy7PX7tEvJZCNerUBZbWUkICfXkpu5QvNzuFObY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.a72102c0_1531812185943_0.44383226965514666"},"_hasShrinkwrap":false},"0.11.0-alpha.098b547d":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.098b547d","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.16.0","copyfiles":"2.0.0","jest":"23.4.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.0.0","typescript":"2.9.2","webpack":"4.16.0","webpack-cli":"3.0.8","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.098b547d","dist":{"shasum":"cba4eabbb01273a4206df4502e166cff84bf3010","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.098b547d.tgz","fileCount":22,"unpackedSize":17361,"integrity":"sha512-BsvPoL0mkvjNjoSdIKNqsHQYGUJAl7MoCib+s9d8nkskLA453cozQ1tcBzhaxaBHnOTU8ViiTP0BU2qQ+TwYHA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDH99JfKA6Dgvfz31v1TIdIPgH1PgZd6tfFBJeQSc/BKQIgRjudZbMDRhzPHhQfvYIpxiOPAZUz3VM0LyyRMxpZNtM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.098b547d_1531813176588_0.8102071588382591"},"_hasShrinkwrap":false},"0.11.0-alpha.60849746":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.60849746","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.16.0","copyfiles":"2.0.0","jest":"23.4.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.0.0","typescript":"2.9.2","webpack":"4.16.0","webpack-cli":"3.0.8","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.60849746","dist":{"shasum":"16459eac2f972ac4885734cf4cbfb21e9568f9c1","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.60849746.tgz","fileCount":22,"unpackedSize":17361,"integrity":"sha512-zwUFbtdAGWgc6tWuKNRnIfrctXbkd8tXQiSxFQTDK0LnUjpkE8ABgMFvCRm0BoPUaqA2D//v9VAqV9aAxngZ9A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICSui34+hn44IYm7LJKfWdqNI9UWZQoFoT7x48ZQJOXTAiEA7ilivmUCFvRpfXdpKHWL+2QfOXaQVgHRogoU92c4uXA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.60849746_1531814208515_0.6780217146433056"},"_hasShrinkwrap":false},"0.11.0-alpha.38559577":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.38559577","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.16.0","copyfiles":"2.0.0","jest":"23.4.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.0.0","typescript":"2.9.2","webpack":"4.16.0","webpack-cli":"3.0.8","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.38559577","dist":{"shasum":"77b7161e3936d7d320c47b87aa1bc915b186410f","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.38559577.tgz","fileCount":22,"unpackedSize":17361,"integrity":"sha512-v9TQllHL2zQGcFedtqflddUNE2WxOoHXincdkOqRkUR8pIw0ICjPyyBre8pFn9uM3HcxLPkLuTw90Gd6LfbHEQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVLaaaIME16gckE57VNt/sMOtBLnrYYVZSoucQuazVoQIgQmdEt0TyKOjYIGtqauQ4HRrmHRoxNOS4fSNhLKBZ9hY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.38559577_1531840024949_0.46570944781099777"},"_hasShrinkwrap":false},"0.11.0-alpha.8e7e5865":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.8e7e5865","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.16.0","copyfiles":"2.0.0","jest":"23.4.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.0.0","typescript":"2.9.2","webpack":"4.16.0","webpack-cli":"3.0.8","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.8e7e5865","dist":{"shasum":"4399d29efd42c31f02a7f0c573e78acc86a2e545","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.8e7e5865.tgz","fileCount":22,"unpackedSize":17361,"integrity":"sha512-IOTL3R6LTV/o5yR6W11d+vXE8inW49mfcRTmcR9LhcszzVNp62tMs1UTass3FFEW/XAbgmHvwDFdN3+8qgxQog==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBIABF0eMl8w4y2VmG+eGmtE7K5T+Ls4cY997yec0nFPAiAKwrD5D3+MFMfxDofHv102o33wH0n/3IXb/T7LZBYz7Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.8e7e5865_1531840424937_0.4023785696871487"},"_hasShrinkwrap":false},"0.11.0-alpha.e73d4523":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.e73d4523","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.16.0","copyfiles":"2.0.0","jest":"23.4.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.0.0","typescript":"2.9.2","webpack":"4.16.0","webpack-cli":"3.0.8","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.e73d4523","dist":{"shasum":"3133c4eb615a7a6a4e9452411eaf2c786afe34c8","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.e73d4523.tgz","fileCount":22,"unpackedSize":17361,"integrity":"sha512-4pz9cG5yMtom6WssoCbcR+DwBrv6JqfGqddh1BxQZfvlaS8Y2d7xw4Gs6hWUv72AdpVXx+HfQWpEjXsxUnaIag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCmLxKkEC/HfhHnvYfXoAuz30Xj2GGsVSkgTugKs/hSwIgfdJ0N4xFi6jXPJTvfNRgRHMj+V6r8iibSb/zLhNnnMs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.e73d4523_1531840641749_0.00355817500664668"},"_hasShrinkwrap":false},"0.10.4":{"name":"codegen-templates-scripts","version":"0.10.4","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.16.0","copyfiles":"2.0.0","jest":"23.4.1","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.0.1","typescript":"2.9.2","webpack":"4.16.2","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.10.4","dist":{"shasum":"91eb37a8bff67a5343ab7a59113a6aa34e6f0bd4","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.10.4.tgz","fileCount":22,"unpackedSize":17346,"integrity":"sha512-UXYCon5sR17ERLn4xIoit1/INCe3NKCHxXlIvneLz0ss77XvFofebPq6e/yQrz1Q8J1RKGQqdXtnug9TBSOg1g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE3/wgKwjYPw/GVyhIurbFbkSG8ZpRD+UCP0xNjbEbpjAiEA3zJHf3nB8EBYL0KrEFVrehBPtNEbElwV9Rwyrl63gTM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.10.4_1532713586786_0.39872915040701007"},"_hasShrinkwrap":false},"0.10.5":{"name":"codegen-templates-scripts","version":"0.10.5","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.16.0","copyfiles":"2.0.0","jest":"23.4.2","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.0.1","typescript":"2.9.2","webpack":"4.16.3","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.10.5","dist":{"shasum":"d515b94eef63c406f80acb32b964747d926afb6c","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.10.5.tgz","fileCount":22,"unpackedSize":17346,"integrity":"sha512-kk2xo6QEGu+ui+6w0pC1LTAB07hD1t7gbVue9SFrmlF4IP8BGs5uU8Odp4JQ1WY4x8HsN3BI2ym0YO60cQy56Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjo92Uf+gW0X4USHlcE2CkeFAGXdjIIjbQqmFwyrwg2gIhAKzKlXTZDq7Og7Wgps4XNZng5U2DBohgF/kcKy385EcD"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.10.5_1532939494579_0.4429812278098515"},"_hasShrinkwrap":false},"0.10.6":{"name":"codegen-templates-scripts","version":"0.10.6","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.17.0","copyfiles":"2.0.0","jest":"23.4.2","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.2","typescript":"3.0.1","webpack":"4.16.4","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.10.6","dist":{"shasum":"e1fa37fd4d04aecd382e21dedd14dbbf64911ac3","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.10.6.tgz","integrity":"sha512-aiqTD0HR6ufkO6rJLBvTyVflR+sViFk0mpyxDpfVuc0zXLakJrBNeUaHQtIMIkF4E5A6hEEfCEHjSE275oLzvg==","fileCount":22,"unpackedSize":17346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbZofuCRA9TVsSAnZWagAAnrUP/33VIcOzVO+c3Teekv6j\nT36g6cGWqcosrVi735qpeY079wg+H5BHLTfYR3kTnHhclHe2LUE/hrqqecgR\n3p1znKsQHxLeFO+bmXHKt2JqqUrYpThL5zC9l1VROy56uhT5qDVlHJDBPfhd\nPXsXjM49jKOnQd60aV0D+f6QfUfZDqG/ez8LP+AqkdXc4+8gI9RBhROvY7S7\nhvWVdcplY/ONc8J9SWFeNs2Ms93Ry0Tn6EjaukamMh4+rUvHsILsjdpAEpPe\nWl93wFsjEY845/JvHlLFVMQQItFrLbFVcWFSwfr8vyZg2xPsa1ulVQ09d0w1\nzCp4wiONog1embs1M6/puzAFVZNwWw1IoSHEJZFpT7HJl8J4i5nEQ2WWoKVr\nPixbm35sIhCk86Z6XHm10NEFS6p7TCjrtLEIhBrU9iM3rIZbWSuLEYikYfAO\nVhI9uVtYTQjeb7GSj9edTlhy9IwpuSG75y6Eg/SmvnMjLtyu7IYagfSwfp4F\nUdRhYpP3LZ4avw+lXsGpzwTutV5iVh+7xFh6a6++PGXuVqi5vz9pPkDd/1Nt\nR10gkivF8aqYlDp+N1dG5wACGwglFn8TYkGaEqyRPSXI3kqYBUtxZDhUitcJ\n8afwlUyvpgDZE/Gl4pqvD4qPGt9Gci7GTDwAp0oF5vPlKgX5SaqX+UMBIWhd\n3YBD\r\n=27+p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCO7loOCfIL9SkyG9pFVR01kUM2d4X6P7U5KUYrEhaXHQIhAJod8Xqi095xGvNkuGQ9e+h87rzf6DPUvoKelDFctzuR"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.10.6_1533446126244_0.2859302121152736"},"_hasShrinkwrap":false},"0.11.0-alpha.66aeac3a":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.66aeac3a","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.17.0","copyfiles":"2.0.0","jest":"23.4.2","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.3","typescript":"3.0.1","webpack":"4.16.5","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.66aeac3a","dist":{"shasum":"64cd23c72ce206b684c3b762cb804a8a0584dc1c","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.66aeac3a.tgz","integrity":"sha512-eCkDFDmCTfVl8Cm9P1iSCpnLPKweImx50BTZ5sjx+3zQokS+9DLoUgrTj5c5O3pgppmErJ0REX/SJrIXihhOEg==","fileCount":22,"unpackedSize":17361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbaWuFCRA9TVsSAnZWagAASzwP/3Ctaejwmjd7DDbdL6rM\nZxKWujouvWR7BOt/pycxV4DFbLtMqHRm8Whom016THQ+wWIRZHQKvBckqEvm\nk00hGnsU3FliuJVgSZQDzggXzaeFounkmY16pIkHaffpMsJYC0S5poONMDLe\n0wzZsvXU19tZIwOvMe+7cxWi1RjCrl9+/0JGcqFYnenu1xBJJfaH9DnC+zjd\nXGm8IFCE5r+qHwGGV9YguATZf8e8SJASStxpLFWNcqWF/ht8sfNSyaep5QXc\n9AAnjKj0YKZlhztG7hFWjLpOqUlPG01GnglK1xs0XRsipimI3dA42FRLWOen\njNI6Sk749uLoGoM/G5deffQEXxomCrvmxHbtAtQL/LXyvj0xL618dMOW4vQj\nwOqoK9T08HvmzULd22Yq/1CW9NjngZnKhcnMp9MSV+ACewD0JD7ZOoYDnl0/\nDO8yt1gfkdxxomlMkWDkpIV2f2wFNihwKoPK2vYelKmg461DeQJ3rY4QQybm\nUdUMR93q0pPeiGkKfvFlx4f6HBPSumIjFvjKUvbpJA9uKcupKhDSjfkovZCK\nAbdO0bz1kbsbLKJlIqPAchvg1tF9avkUOF8vHSps7NOirg75B62qXBlC224E\nHajayYS5RoKx6JmjKrvr5k908MYTQFpom+Pmsfx9y/43kHYf+tOi9N0kyysl\nEit6\r\n=M+6E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEDbJWXnwo9BUjIIWUJqmEEbQb2U6dXF+rqxM3l2zjGgIgPYNmKU8X3SZTVuci2fy8W+RWH69oDmF/Mlp9/mp6lJU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"kamilkisiela","email":"kamil.kisiela@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.66aeac3a_1533635460577_0.6625282616180455"},"_hasShrinkwrap":false},"0.11.0-alpha.24e6f8f5":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.24e6f8f5","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.17.0","copyfiles":"2.0.0","jest":"23.4.2","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.3","typescript":"3.0.1","webpack":"4.16.5","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.24e6f8f5","dist":{"shasum":"33b91f59bf462d66d5593a23808d41169113c787","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.24e6f8f5.tgz","integrity":"sha512-MmMAVUsjm1r2n5FiCh5dPQQ22sFdAwErYcH1KbNJnUr8cVfXGPAwmD7Zxj36kyzojTOMMJzNnN1QmxyjNV83AQ==","fileCount":22,"unpackedSize":17361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbaXM/CRA9TVsSAnZWagAATLkP/A+hS6665oLVIifQmVRX\nftCVpNvs7tRNMlwTPNLEtJHN4p6Gew23qer3cqVnG4MBc9idpHjfNnsCdKZF\nN73e5BqJRQm5mNjqpy39oK0+kSxnPY4ZeANJ8jpPLzuInaghECZbZE83gwqT\noBq/HkJnDwFqMvU46uIFp4YS+iCpsoLWHMdY4DyjpomYRz30O0OQIqHoHM3S\nf4OVMEcckG7gMwP9bMWLOw7leueo1nvlTJrZ6OXzP2v/6BbPqUiNhSzO9qrI\ncEN4I5ayAAeVQnB+h9IbYgH5Tq0GCOh5R7EzjUnOr2LH+aHj65e/d5MBobgm\nL5Ylo6PN5AXSNYCt++0KyVYo+i3GcI74LqEijf2VuxGah81cwPVffTHib4MP\nbWcpklZm/wFs7hw/bvsAhoT8ipIIzyLRLYcL/+E472RRkwbK1u6uCUDpzMMB\n9lM9bbNtk2mpewO9QLMW0ytlqKxeL7IYzCbVoCElH6MKnKbVj6gPHFmwQe1O\nA2YhhUy4hyS//9CUHKKuAGGplVDwEW5mgBAxLPAJjD+abZlwnmF42cLlVzpf\nByae9rSkROJLIJxlHTNeriG7I4i1vBppQFpMA/FPcXe7XUpTuSYz4Kat82yF\ny1sXGQEGPy5Bkix1Oq/60t9rFpV9fNS7XsllHDSYmdCJYLV/vidwvesrOPiF\nWyQs\r\n=guiG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6UmMTgTWc/vwfyYe0CLKqnh724aU+n1EMcNeiF/1IwQIhAOqK3litAR03E6YIFWtnG4uvGTH4+0R2FL16ys2AaieS"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"kamilkisiela","email":"kamil.kisiela@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.24e6f8f5_1533637439532_0.9179681496650707"},"_hasShrinkwrap":false},"0.11.0-alpha.0f864c7f":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.0f864c7f","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.17.0","copyfiles":"2.0.0","jest":"23.4.2","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.3","typescript":"3.0.1","webpack":"4.16.5","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.0f864c7f","dist":{"shasum":"28e12fd359d12dbc96e0203cf03386559e4929c7","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.0f864c7f.tgz","integrity":"sha512-EVCiKWncP0VoJXqHQwBCobdVTQe9vDCS89LAFLvMBU8aIIjbZp361noGoz+hP1zXGFPuOY0wh10gj8cTkZQp5A==","fileCount":22,"unpackedSize":17361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbaXbvCRA9TVsSAnZWagAAFwoP/1Q/9/pD9bvFNiu+AJ3f\n59fN1XTv6xY/NtJWA3CNPaC/HTPyuGlIbp32tXl3Z3BUFQBY8mNWflRIpxup\nIlOaSC3VzA2W8H4D2jOEASRejff6SE6hWvQYKkRklAUymJ4vcM05x2evY5gj\nEkExLBEXaNEJmHm746KVDT2y73x8/mmwD4/bsMlwSvEvpPcMNXr2pPpLV9Lc\n15x89eH9l/WH9fZIy0qcKCrQJOmYwQxB21jlajGU943beOJeSPzlrlyh4CXG\nS4Q7/Z8k9ybd4b9q8+8l0yFiuVSLXOtbZ89txS6zwHYr24WNkaYpZxBaUxO6\nVDtCqCcK7jc27fabVWFX02oxWk/0Kpe3IdUy9wGRuIbl4wAt9YsOQWqKmx1D\n1EWZN4ijWvmiVt8o5E//A5eDxIEOcEk305o2TrtIQ50nMsg/KYSyIdUoGHxx\nQGYBK3YCbRjQOpB6LwTi5rmWhXqxPyfJrFyOGjy9p1tanTNr6KkywBPgxPU0\nytqvwhhSA26e5WLdrcpqe7lkOFtrMvDnkfcCGNUFmig40ba7gYUlSSuM+NVw\n6KIMTVjBPDZ7wxMRdJ9Uw1KzpCzN9FhTTb9vJiMD3c78ZK5vrwCzmx/KLkke\nKfMn+15Ahl/QfYonzAvtBKngNz/6/8/0gNmTN2Z9Q/IbEZxcfkLoqb+MlEqm\nNEUh\r\n=eibe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDR5ck014AWyCiGnq/SHmEdPFCPgTxb9gzFA6TsdUX2zgIhAJ7TZFTIWCmt0Y5DHcMnRvehNR7gU0iclxM0hDnYEz15"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"kamilkisiela","email":"kamil.kisiela@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.0f864c7f_1533638382907_0.45329746327227616"},"_hasShrinkwrap":false},"0.11.0-alpha.d942235c":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.d942235c","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.17.0","copyfiles":"2.0.0","jest":"23.4.2","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.3","typescript":"3.0.1","webpack":"4.16.5","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.d942235c","dist":{"shasum":"e5134e6471570f2eb105958070ed0d1c2176886f","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.d942235c.tgz","integrity":"sha512-S75MI1+tlEYlu4d6iiB3KNtkliEDr7X6atHjfn3mMcTpTKaxOJjJQ7IbRg5OCa1fXgtKQVvHeHws9Z+JvdlLGw==","fileCount":22,"unpackedSize":17361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbaXynCRA9TVsSAnZWagAAM3UP/jrqiwbozcrYNGbkS9xn\nqF6lL7O/u4i0RKghI74R9uUob7Wc7F/B+vieKZDTN6sZ8ba6QJjz9ofyDEBz\n8rc52S74At+bOD8y6GSLR9dqAFzV6qIVmhRJb1SyLPsTrKo97mXqg/HqEnZO\nTiq7u8f0HMO6822wu8ky3TuQbaeTBj52mksXXpUyke14oUIRnBZva4+Uvj1/\n1o1gAG8nYXQqe2n5Ks7T3vIcZIpKCTn/bIXVbGuLu6lJjNR5NHlT1BeEHEZC\nLXovxM9kOuGsmU1vm6oIYeTT3EjjAuRvh73XW6YyLcrSUIUzKj8tVI2wU0Ay\nMnw5mOR9vn6uIQquDGdbrHqpMfe5A75SifEi84Gs+DtB+yK05BrQGRd8Yoo1\nt+NBwi/BfTPdcGB7v62noo/W17ylPaHmYA7lBG4G9z2Nkg+7qF/qWjOWikco\nEd1uNMgAjmIGMvFOvpefxMt38jcAiy2diQK7uV2/CorX+kGmJFCM7WGujmeY\nyYNy6+VkFVPWjQAoaG09zjhs9Fq2jsv6rpiTu5ul0oPSzzmgLzgAPkY34mVc\nlnzSqe3FM06ZDiSzXUsTAqT35f2mRl0XGGqInZoTHprvy0cvJFkHYqyzUGAu\nWH6qCi9XlKuBnGxY8V4s6+jPwo2AheSJd8gCGBsk+TRO8rvPyrrEWpVD8RUu\n6yt5\r\n=TXB/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBtc0qxzqgqocG7hLiZl6ABFDsPfRjVAtFCT7qxxvq8zAiEAqRPFtvFo8MSHeGL+aSTtAkgFEKH9ui8wVSP7YWV6YbA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"kamilkisiela","email":"kamil.kisiela@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.d942235c_1533639847532_0.4297105525189999"},"_hasShrinkwrap":false},"0.11.0-alpha.1f1963ae":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.1f1963ae","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.17.0","copyfiles":"2.0.0","jest":"23.4.2","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.3","typescript":"3.0.1","webpack":"4.16.5","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.1f1963ae","dist":{"shasum":"1b3a01d32b64514fccae57fcf3204c34b16f0a65","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.1f1963ae.tgz","integrity":"sha512-1M2wU+hU2rIvF6Xh+LhKadyXjGnNBORpwkv+pzTxY2lUAezvXk8nN0e0A3/HDiP4pat6iw8DZ7753g6q+wMqxg==","fileCount":22,"unpackedSize":17361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbaYkLCRA9TVsSAnZWagAAFOYP/08ZQPQehSGvUGvTJ2l5\nzhRK4I+KTXk2Q8UOU6PEMyZffK88bkCkXnKRJhHFkDFglh5p+eAU5n8tj7/5\nDzkBKipHRsLFW/YXmJVa5erLWVSHn6Jd/rRL93yvwXP5swOdrMgQEFZTdkES\nXHAyfLzL3563bBo8wfrxZqVn8WnxbtwPKN2pTwTWmXSubRlR99Ms79ViLsJu\n8IpUJRk4KZI8cAXN6TPw4ebAIFdOoSMxirzdC9JiGHxo5w35IcEFuJj5ovus\nDGh0EjvxRTducsK+HoP4GNKhvoY7aZTtbrWTPGBCSc4HqW+/4axcO4Ww/7+k\nS6ixvnvjqepmJVrefaSwZCszAHeRwPcgjLZlhfh+WtZhdUQ529LjAV4X7piT\nUi1/BvSMVOINkWycmBiNEfpsy8Bt9ZXp9m7ecnZ6KtKtEuU85YIrKcphwygT\nF6oxuRWzMDL/FGeukEVnmnn664Cn/IKvgSBdyKiQFuUyEwaH+DZlr+5qGGb+\nJD9MNiPd+WmkLtoe5gy7TOsruRxi2ixkSaxJR/DWGk1nJtWE4uxPMBDvp3OV\nIFcWFFuM+rnAR/NufH3hA3erIo9d2LLjyHiODfUb0ZiLCl8CkKHYpYQuWpkh\nnoMEIrLYLF9WBFlIo+ZgyAUnu5AsyCKC6gVoAF7pqOBlYxzyAIjegE8Atko5\np3Kt\r\n=x3lH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9QIlpKWN6SREaqZBRxkvEgtL3u6otNx4zrGHiTMJDIgIhAPN4bio3wRkTpCH8nHWsEabhmy4wPeKchFvjAHcNgcnh"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"kamilkisiela","email":"kamil.kisiela@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.1f1963ae_1533643019297_0.5712938384258872"},"_hasShrinkwrap":false},"0.11.0-alpha.4c054a57":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.4c054a57","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.17.1","copyfiles":"2.0.0","jest":"23.4.2","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.3","typescript":"3.0.1","webpack":"4.16.5","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.4c054a57","dist":{"shasum":"08d6e607a6fee61d5fd6094e6987b688b10873f1","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.4c054a57.tgz","integrity":"sha512-d3N2rXH+d7wuZkJvQVaDP3qUA8evpy2IMURn21L7VNrTq/+iU2LshpmGjFo4QjNT/dJC/5vWuvE0waF2XPz2tg==","fileCount":22,"unpackedSize":17361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbackgCRA9TVsSAnZWagAA87YP/Aj9zr8i+DwQaLodzhAD\nNIF+4VYYOFad9lLpQqENTNBHMCvYyFMK9CXp1R8Qz1UhvqRLPg/CgZM51XUE\nlfBIiE4EiTt9iDT26m/gO+Rr+w18mRHHZ1o0PYTSheDnhDhLUPpjsajXsuYV\n9V1xNee8l1zkl6qMJmYG0c6OADGCAwly9WizkYzrJUTshSpBkFVU5fxIPupx\nG0kRRyIKJi3zJyLyLGS98hl69N6LeWIXpw4ZG+c/mGYVtZgxgJYvr6Qb/ezC\nFNF/ih5+0rCge7Fp/v3kT+DO4dDP63XnX0XOmPO7t9Y8YOAIxYO86a66zYe4\n32jn20qE4kFy3IKhptFm4i3+aIykFK2Se37rlmkKurFJiCaTi53VeKsJfS/8\n+tOIaREZUte62Du51MIDCp6PeX8UfQ0wV04HHmMT+yZvChvI9r4qZsWelXP3\n1dcvevxuz8bnBr7cNltnBOMmy1ORjWVdaIkEbUcz0sDDTwezMVXWlRFeQN3g\nMKphJO62Y927Vj+yYLR/mQFwjalLqlh2cBvb/+45XiiRdbdsuAqK0lnri83C\n70N76iD2VqeDI8YbfO048EJzSztPvVZV1uvtm1SzJ2v5X+UwEyjoqHpZFbMx\nWTr6Uzp2m1+gZSDoz5471GLkwTukDc/SrTP8D4mUYvI9I0/nhbKPxJ86jg5l\n8RXc\r\n=syh/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2FUEFj8+4uMTOZQRe7hDdwG0HECRmURGy/vsBZDwwoAIhAMkoLNDF/zO7PCkEhEAzmanvbl8zdEs+1QhmDgdVl2oX"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"kamilkisiela","email":"kamil.kisiela@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.4c054a57_1533659423577_0.6834815348812973"},"_hasShrinkwrap":false},"0.11.0-alpha.c2ace11c":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.c2ace11c","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.17.1","copyfiles":"2.0.0","jest":"23.4.2","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.3","typescript":"3.0.1","webpack":"4.16.5","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.c2ace11c","dist":{"shasum":"6530ec353b1e9bf6435cfc705cd4e7eecee500e1","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.c2ace11c.tgz","integrity":"sha512-29Nd4sa6INDVeL56IA/3vMGcYlaZOyZmtjEzOHfBnJGVfj+Cp26bCk5cv4ZvpS/nbff0XMPqsywwiyKrRJHAvw==","fileCount":22,"unpackedSize":17361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbasHbCRA9TVsSAnZWagAA4ooP/3dCasuQSlEOhHz4u6yI\n1KQcNmhadDpB03nB9OqVuH8IqcMrhbELTxgCEDIMb8snoWrKJbwKYceGYT3R\n7Nc0m1uZbQY026AJRvIsdcCTZ3DI2jDYOXaqpMTagI5xldboN7boEQkfqEfG\nIpwYGDmcSd438VQoTni+WhVpdV5RJbxiiWWrGRQO8by1DVXxyCjGyXtRiGhY\nsyzVw50baGt5DBEtjbQBXM4/poQ5hR9nShDGHP4caP+bkISecpRdLlFwwh6t\n8OfX08y1NDbBDVVesQpkE6dN/UFwXgm5gham9bp4kWi6hgjhpOmsou2PLWJB\nj3kAHx+cEFtko4TtcS9u8PpKGo6CjohjFtxqoYvxFIJqw517lVyj9ZC7zWU7\n47LxEA4eTCMj+vThBZ+EzMA4qoKVKR6jBi4Gm5ZqA5vKALcKjSmwGFqVo0ka\nnJjQxY60xIxWLL855sECADltKnOnihE4KIVRGb8qMpcY26wVwTUEOORPC4JQ\nA6HHaN+NXFc3yUp03jcsbG4Eq2wvQ8b0P8xz0FD8Ad6lqpR3gEagglYH5zXS\naCkJoM0ZJWX4tEwpAFMIndsKQ00E35IBc09kksR1pMv47WXwZQ86lvdVGp65\ngq4D7NdMZ3/lhs3BaOYraGK7gPStXCPax/xawVS9flA3ZBP6YkbZ/EyDgSCi\nc/lG\r\n=TKgL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICQpswtP15IcK2qYYGlBFK4m4SgpjwsMauITeaZIFUOOAiEAn7+qJDNiOrwlRSS7VY6PluO9Ork8ImSD1j4B7rGist4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"kamilkisiela","email":"kamil.kisiela@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.c2ace11c_1533723099459_0.8076181487261833"},"_hasShrinkwrap":false},"0.11.0-alpha.d23d1b0f":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.d23d1b0f","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.17.1","copyfiles":"2.0.0","jest":"23.4.2","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.3","typescript":"3.0.1","webpack":"4.16.5","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.d23d1b0f","dist":{"shasum":"1820986c91fb7e31e431a186670de7df50b89ba5","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.d23d1b0f.tgz","integrity":"sha512-KP8h5yYPsF+en0cG5cn0sxZZIC0XwZi1O9N5llIRb8l2mKlR9IPdGlaJBuajWOjbyElBJ6UoKz8X06zMx3wKcQ==","fileCount":22,"unpackedSize":17361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbas0vCRA9TVsSAnZWagAA3bEP/iA1i0TTMf6DIPPIM3AZ\njRacx1TD/l3cPTi6BbKaucPGw+gO79u8uYX37JWZfLW8wjviW85qNdWWBZbA\nSthL0axck+VaVcoJbZbHY0PM0ocZoQ733bRFSGQSyflWRj6xkjBdBHyy91Sx\nhYB0FqMiCluTQRRmE+aYhwAZsMZL8k/nq6UfNBn0Hxi4u0eTYyVU7XKrymYZ\nqmT/NbVO7DrRqAK7YNj67MKuJSwHMU7+I84WH44iIDNhBAZP2DCkDD8VLeVB\n+OivPgh533bhqa9ZSWpM454Whi+udol53e7r2Z+g5R7N69gxrJ/1D3BLdNyC\n3zruxaiArVLQ1dX7f34hw4HAHQnrEwn+hzmun2yq5jIEeWKV6ACe7clSDKex\n3CnKO6ESCC4dQ8zB5iduwPIqeE6nhL9MqxV9AMBYY3ZkOMqPpJ0Vo9puWOVS\n4brcOYYywaFLGBDPxnaURw3JEJYo3jk+8eLjTUPeWS4diyz4GLLmMcEQtmHD\nj5Uk0NXfhwl5rkFK76KCybmoGT4/8LE8kChzyMqBEw9TcmGNQKdVIyCLj6c/\npqWqFKAFObU/kCX1xXCw/WklhadCOCMPT4iSu9iabtmya2EMwAAegPjXj//g\nD/7PgQrsZI1l9H7PB97axE8sBXTcvE1WRplnbPpaCyDUB98BOb9zDKHiyl8G\nBFOJ\r\n=0GsZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXeEK7yCeyLh+SrP5RcXGVNQQ+i3tEHlkPbiIS4fbU+gIgNDMzuNioxxTR8baM3H/HaxohBYBJ3xw7+d7SySxtYfI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"kamilkisiela","email":"kamil.kisiela@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.d23d1b0f_1533725999532_0.4191686193706301"},"_hasShrinkwrap":false},"0.11.0-alpha.e41fa5fe":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.e41fa5fe","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.17.1","copyfiles":"2.0.0","jest":"23.4.2","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.3","typescript":"3.0.1","webpack":"4.16.5","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.e41fa5fe","dist":{"shasum":"de833f539a02ec9f3a1ee2c38529a66288d46d3b","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.e41fa5fe.tgz","integrity":"sha512-zkKiRgwn55KROAbyyEqPwwmhTCCaf4qGFzObqYvlaGIy7pbnBWZpgxEgimuyyVfr9TY5fMmg0z/GJbg3C5vTTA==","fileCount":22,"unpackedSize":17361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbatBBCRA9TVsSAnZWagAAmxYP/2bzd8AxhKAvBXv7qN7H\nQnBN8lICZStZUjigrUS1oKtojn12DinSL6zy8+kecf0d1SAWomfC8lYELCvN\nKZyG1fS1v4Ef+M16V7sFw9HK03WHa+WDo/ymAS8GDXX0/YmFmEW6PXKZ4HHz\nKYc7D5l82++HXbpqYT0OklVLqI49PgBU9SGnmbmmCapR2gk3buDqXKzZgL5z\nIOXuMfqw8PCzldTVm6ohkLFLaRtRHVKiv2xLOrd9pVZjjoerAJB6VCci1Eru\nYQj2MQsGNe7b3Dezw5Tz3NAkEXQ5WZt1lhkGrf/dXZo2bCS8jTOgLS6MLfgt\nx7baM87Y1ydmFVES5hypS5KHkxJAOUttTTuKjwodlEypo9lP69OrpY7n5sf3\nTKRd90iMcrKYfebdT+xs4YZTtPPAPNuvlj+ye66WxAachEuqpmqMkIj4Lkjg\npZ+jG41XDF3NtBljUfAGyNCj40IEiLyfWhQJSXac6ZOx4E1zSX/la8I7ON1X\nPROc3WQDUztfJz1kqKLHaf/VZnaTDOJ70Hsi1jcGMn+xdvr+tsptBPtZE74y\nIbgz6XQMLlnOaKjoiYC64IcUQTfEH3MeVuz5kpri7up+f6+II1JsH/TLodJM\nUSVpsWB2Of3P4GUa9OWB7aETwU5lfG6OqGSo3Rj7pUiRBPyLg8xQYlVufjyl\ngYlI\r\n=j0LA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYWBDANrlrvO2b9lYoq8I2hw33CVtkL+KVlDbz6eQqsAIgUwSJwd3JwPoUedp7meigYWSpOFHo8ivDlV+9ovB+fEQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"kamilkisiela","email":"kamil.kisiela@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.e41fa5fe_1533726785339_0.44878124930316887"},"_hasShrinkwrap":false},"0.10.7":{"name":"codegen-templates-scripts","version":"0.10.7","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.17.1","copyfiles":"2.0.0","jest":"23.4.2","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.3","typescript":"3.0.1","webpack":"4.16.5","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.10.7","dist":{"shasum":"cfc908762f3da2d483d0ca88d52914fb93f6a87b","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.10.7.tgz","integrity":"sha512-n4R2c+HT9Nrm3t7A1mKbLHr3fPqMbBWBii24UyFB48nkZsAcctgtKjP1XoSqeLsicu4XB5iXiT7xPy/BJK8iuA==","fileCount":22,"unpackedSize":17346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbatP9CRA9TVsSAnZWagAAeFIP/ie0GuXdvggpnZA1Qbpr\nUERUWTUhEK7JGcE1m61mikhNfLN6ZBgtBljf1eilcC0XzQ67c5/5qaXY9wCG\ncjQ1wH7tb0FwJmhd3v/NbTeOWL2oqLpxcu5oaClqab+BAeqx7ZxTNtj5vMjX\n3nSmkI16VWLiqWmFAKg19+nvbbjNCeqU798Hs1K8bhDNCaxgqwpH7pGpx/83\nrv8JUnYlbcjn80q16G8gMAXH8dAMUunxspaUoFE88sm6VVZJm5KYlN+Z5MQU\ntheKZiLVIzZx03lxNgw7a83IPRYLvQEfJlvKzQUwsIxiXk2Q7OUp6TuREJga\ntcRDGUk0hKellGwDLm2TrDD0xJTEqZu2Pi8tQKLGfFIPbXg6nbzVeHc4YQXA\nVJQMUNem+7ElebgDtMQPJkhQCmakYXxWYIzodhgCSkJDOuvl4ceCmRuTJ2GR\nqw5qcivWkqnQt5RcKJoo1rFuTJDqLHpi4oOvr73/GFowpmv1qHFyJJcMxPBW\nBIIp9HMZUOTtknOYuXIjEbHx3ps5Ez82I7jApfP17KDSQtBJZmqwF2gKvRs4\n9ZQbAoJJyEscXDUP1WcVSB5a9/QFyVsnewp6jw+CvRHN7/rPBkytcaqXNmEu\nWG/YcROWuN2xXhqWncXQtlK60SKk2vVUpWj09zA5xFJtUTRgbkarmj/qFtPJ\n/nNG\r\n=2dfG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCE7xc7YccsC88JWqP1NNm+MO4++VVUOfohtobNZBDGnQIhAMm8JZO5FplP0F4AZ+7mTeN4rANFuLxBfkYpN77fX8d2"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"kamilkisiela","email":"kamil.kisiela@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.10.7_1533727741580_0.8352293781721729"},"_hasShrinkwrap":false},"0.11.0-alpha.0":{"name":"codegen-templates-scripts","version":"0.11.0-alpha.0","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.17.1","copyfiles":"2.0.0","jest":"23.5.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.3","typescript":"3.0.1","webpack":"4.16.5","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"gitHead":"6b7525c348568a3affed709fa25e5bb0f15c26b3","readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0-alpha.0","dist":{"shasum":"ccdaa2ab508cb16524a29df20d10ac9197cc0f0d","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0-alpha.0.tgz","integrity":"sha512-HDfDbRg/dq8ftGRS0MRkPqK7H6LuqdeMJx2VNfmCu8oe97Fhc4hhx/6aMAhkZt4kma+jqLTg16tzi29bwB0Z/A==","fileCount":12,"unpackedSize":15751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbex04CRA9TVsSAnZWagAAEl4P/jJ2nlHYIJoxXpsAaG3B\nOjd7axm2w0N70gJY3/YTIql89n7tDg3cquyfy+JxJ56nic1PWcrZs5m7LLAi\nkF9LLKou8GCO9/KODxfnId/3aV57DOEzc+PUV7PdWNZh+gt8yFdkkp6DyHnx\nayyLvObRgXJQpBF2RjMh92ViStiEbpqfpJp3T9bs5oOOB/kidfi5zYdEbGKQ\njNy3m+qEvpL/JOdpvXwP1mnPsS8S8g/M0dbmi6wZxSkAFjWdajBTQzNGswkH\nRcl3UhugmNmwSJnxzSIW0DLasixRU/LJ9I7Vb326U8y422MvYhFac6igB2Le\n92Umwp9TJbNirmZsFP9l7um7jGN3TJYJNvmp9/fv4+4J2Qovu+As7f3feJ9A\nDr0ld0arVSOxOuD4QVBAZ3NKWha1d4HAYRBqUxsBmMXrNdi3Xh48L6fMhLNu\nNwA5sAJeJ2AsTSX/4Ggr9fxrEQruVsbw8zro0b8hey2C6C8I68VQ8zelTl0r\naH12P+ju0kiJTudW/6NAgdk56BnKzs1Go1YpAPnDMRWRNfN7+TAwE05RhqTk\nne7SLOrSjAUN0hJhPbfbzkfMoCxEwsOC/M5Jze3gFBtCWyR+Kr/LKz4JuOjN\nse57vZbfkmJNOCOReGjYEV42ebGw22fxBcML/rFSkPYDrWd5x1YTiWnGZ24m\nHoj5\r\n=VRTB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHrhpizjAKdlu+RWNIGcCl9GoaehXFX5gxNyN/K7fzGcAiEAwe4rLZXA/CpBmBRkHgNdJ4fyswqSWJITXEMg2WiPGek="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"kamilkisiela","email":"kamil.kisiela@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0-alpha.0_1534795064110_0.5579051567722262"},"_hasShrinkwrap":false},"0.11.0":{"name":"codegen-templates-scripts","version":"0.11.0","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.17.1","copyfiles":"2.0.0","jest":"23.5.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.1","webpack":"4.17.0","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"gitHead":"303c2f2aa30fa57f7b7d420a98ad719c3d2f9df8","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.11.0","dist":{"shasum":"1c39139afa00db60ac7e070ea5e2a44a9f7f37f2","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.11.0.tgz","integrity":"sha512-onmVxWbqOhDnCgWNDvcoXiCHiou9HbKS4k/hY0n6mvjgoMMpK6GGSoBhxntCY9TypodtAhwwlQoP7zwJHhXHqg==","fileCount":12,"unpackedSize":15743,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfCwWCRA9TVsSAnZWagAAtpAP/0HI1yApW+UoHeClhLxt\nQ5ms8qpfM+9HWurpyrq8OEZwxzkKct0b3T+5W086SN4E4XOJq4FKSFcvgoJk\ngYptYznmZ6Sle66QGPDKF5zzsSKGJow5rWXvIU07uJWF1QNEnIAZxWaQJ9ab\ngveIg/OpMLQLKhHWjcMiJgfFyexl8hEUFE596vx4jmdfiYduBIMey5O4fWnp\n9dHGX47LUaeTVSfVgPLolqbBrEuhUFBD+FKYwEipTJxqYILUNB/6YJsEOh/O\nC3s/YE+U7geh1Mv1TNxA7MdP4XIhESWGp/FO95e1Tbe3IFdvC6abhWd4TsqB\nrR4xxQbjjiCHiQHG348K1OgTWX7woVkt5pkwucwoLQcKRQLR26CeWXjP5teG\nfaZ8pZrnu+L/EITJe7q1sEjZXTFPZh2lZM29HOJ8A15K/oHMgsyAw3TjHt8z\ndN3oBK9LKaZUdnGVHlLm5xINx7hRF982QXEUtohZzBzdhLSvY07yuBccUp/N\nxH/0fJUgwRfg2XGxrxwIMhgvU360MpLbas+gLCZo+RyhoDEveifHr1UdXajT\nLb4CnU1/y4I+JtCJ9B+BMaZZNirl69lOJAnwaCZJ5IgRWsDjGJbtV56/xfrh\n7BmHhYib1CJqyvkdykwmUtPdKInCskI2T3S7DdW3ChkPID7oAIsCr75rcX4t\nKhXs\r\n=/01v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4xDlL5Z/HNqxAC29ztX8ujdU0YFqBaFpfR2BqakOeIQIgBpCC/bAlSIjPuH9sZ+3vr5CdqpXnO0p1PjRfh9URNR4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.11.0_1534864406293_0.7855156548037001"},"_hasShrinkwrap":false},"0.12.0-alpha.821f12df":{"name":"codegen-templates-scripts","version":"0.12.0-alpha.821f12df","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.17.1","copyfiles":"2.0.0","jest":"23.5.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.17.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.12.0-alpha.821f12df","dist":{"shasum":"d4400794fefea013f4595f76ba675e4eb3a9a8a6","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.12.0-alpha.821f12df.tgz","integrity":"sha512-L9NEn6XHjtwxF3lObEXsBn7Ge5X6VvXwmdL28L4g4+CWsVJxq6hEwADaoD0I7ofYdj6OpPcHKfu4pxa2KebNXw==","fileCount":22,"unpackedSize":17361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbh9fQCRA9TVsSAnZWagAA1lUP/Rzi01urCWQ1+8FqADqY\n87NiBq5IcalkSpYJXbT4VCZl2ZRQwnqto2YcwAcHu0QqdBfYrMSJvnMhGQTf\n8cdQoAmwaiA+v2/CvLoLOPYPGZ1A3YXEA5OkiVWxG1aHVRCaHTPsRCgg1VuE\ndoEuX4xInDcYPm9nVqc8hkHsr31T4H/RYSNnTuqqzEIyPgoQn2NEhIOoPDJU\nCLJNI54Y4cyTAZ7o12MjZszwX1JN4hc/r1xW8DUdbP9QRaJV8sLWkIGNQRob\nsDLiiCiGtZ4NuDzAPDcmxehk1M50SuDXTDJuGiAL86s/qJqiys4rUdj5EXBK\nXibYJANITwGc50Z2lA3NxqiRT2VIvYpLIAmCZ3T2ZA+b9cinEfj0h7+iy+3o\nSRkopReEqxNwQpv5BpptC7cFj+hiiDueXkmDCfGDbYu/LmlWN3MA/u9klTjQ\nLQEvB9unvQovh8frAbLKJdLCZNcdH+C+GECIn6Hr/MIvH7cNBmtCMtQuh9zT\nmM6hjcubaNp1e1a/vJfhDllh3QRRzIrlyGIfW3pvMrlur2tpNxS1oWIhrSQg\n79j0k3DOLdPKpiZLbBVGisEtdd9EmtIcERp3QkjZpJ0OFG09Q/UKiKSxmvGo\nPgWGiFe4fSTm0SjxCX0YeOrhAlBxhD+r9FNnauO30FlwKDoven2Wzjm/AoGO\n8BIF\r\n=WB4J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvsXSFWOGMFQOYG9PCIw70oo9Am/lg2kCRSTNwgjg4CQIgK57jz/2kPiGJqPqqmHP8o87DKPTBif+j5/vdzY17ejI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.12.0-alpha.821f12df_1535629264085_0.40866756084652645"},"_hasShrinkwrap":false},"0.12.0-alpha.576bcbfb":{"name":"codegen-templates-scripts","version":"0.12.0-alpha.576bcbfb","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.17.1","copyfiles":"2.0.0","jest":"23.5.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.17.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.12.0-alpha.576bcbfb","dist":{"shasum":"3e7efab12fb1a0358d7d22e5a3924b687749c38f","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.12.0-alpha.576bcbfb.tgz","integrity":"sha512-4TB1LKFmmKmFTucfh0llc7ZRj3ZX+SqaZBjYq2307hMZn/uGU9xE8Pb3gBYxOuQ0y0vsxa3hr3IcCgKXty8x+g==","fileCount":22,"unpackedSize":17361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbip8sCRA9TVsSAnZWagAA3uMP/3bIA9Ny6A4nXQHW7dJi\nxZ3kNjUc8ui4BHPjSfelPDbXYl5CA1lc2VbbA1cGACbyz9zNW/Qzt1Tsu4cY\nVLG6L9BgDLtUA3wViRz/cZjQyaJSI94acSGpckwsLr8WjjjNBc753LFjmvRt\nalOlq2r3Krj0euYbLX8H/UL5kVgT4ov1PpA7+UKWIas7BLPQWlzVG21MM7p2\nsuuI1RUPbjwEGbBzo4f7mA8RuouF2Idq8Wp0+NlXofCM8cTmrjRwzp46611J\nw7kOd6HzLZoYNntwe7d94C3MTkpf32sBdmM/OrCqcb4VJNmO9xHCA+1aYECE\n+rh7BtgkyJMVXlj4Au+QtzRz9DlVdqNUdI9FXndTk5nBstARZdOG8ju32pj7\nAi9Swgrr0aWuKx/gBMouQc0JqbczTnovUTbBvBlJEyBeMmPLvjX4xad6Nf9s\nv4ysUWECTBTKHLs16NbTfHzUSr8TKhhVR3z9v0pjwSy5pOQx5xP2nT1sW7BB\n3puLT1Z1/9DymE11M+/6yVt9x5rt5XqNmN4HFfMDcNyFB7uDfgQ9rOcaD7xo\ns2MzU/h4pPHV4Gg/laKQkK+VNYW2paVYbFcvx+fUnoho2g5abDieB8OWT9sb\n+TeImb6lHoMZzOgM7BLLNLP7VheJA1sRFBcLDa75gw6rab7A3FjK16YNNDN0\nxwf+\r\n=/hHT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLKSO3g+vlOglBYGL/5o8XiyPBbY+dGEBZtnf/YHpiLQIgRZPMTLE/UWk/BK1YEhYHGlUn8DNE8DrWcGcRq8szdnI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"kamilkisiela","email":"kamil.kisiela@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.12.0-alpha.576bcbfb_1535811371180_0.6344127423354555"},"_hasShrinkwrap":false},"0.12.0-alpha.e1a653eb":{"name":"codegen-templates-scripts","version":"0.12.0-alpha.e1a653eb","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.0","commander":"2.17.1","copyfiles":"2.0.0","jest":"23.5.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.17.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.12.0-alpha.e1a653eb","dist":{"shasum":"c1f451ec62ce471561bc64207c2e603f5a5b9b1c","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.12.0-alpha.e1a653eb.tgz","integrity":"sha512-t6hzVbzkXcWWzf9jq+gb9PjzhA/yzcvW+eSCkefkw4UE6EZCX2szzq0Z1Pr3B5xYegcajAmASpY2yuqog2hN3A==","fileCount":22,"unpackedSize":17361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjPA0CRA9TVsSAnZWagAAeF8P/2mSiQEqh/i42kyDbhmg\nsYjcUPx+185BxeLOje4sWhBymr8uVp3KGK4MCvkecULAN+cxz/7BUZXTB/Jm\nqEqknv08+XqiF96NH4IOzpVRl/3d2etyjVY5GoQhjAoE69nkLeHj0lgpsDD4\n++hOgf+zV6t6sQgRJryxXLG0d4ylkurEAMbVnUIFKMnTgqbuDb+M/MOqmAB9\nbWFxKy2WOfUgfUm+jeXkMOt25HhkLXwvs+JdGTPL5ZrWzmpif5FgkVL8fXJk\nubCOJuouu4YA7/RqPuk4KNrK9KAo0e/N0ML8OzuPha/8tBi6a8YxJr0HEt2P\nkPVROuzd6SNzelNgrmr5MefE87HaOrgS8r14zDO2OgOsM+RyFvXi77JmdM73\nVyULGKiAbNcDPHEZ6BqLcvwgnxgMspDO4OwOw2tZp3mIDXpS3s1a2IUSBMbK\npI/vpCu5IvdiV8b8SqMjpFPd9GlNYhatZZMemmy91xVHN/mdaEWuncX5fS6J\ndpXFgFGZlbwrojxVOFxOc7JT0hQgXlfVi11KwfKjv62+rOXuk7oQdxWCq+as\niQCgbxw5nbJoMd9VboMoO0HdgPVtsr/z5Sk9h4nHeSQ1VzsAhP4rrueNaV+1\nSwEmIb4SoOwwMky2KXSvytAMPY1wh5x3ZLJ5ctTHzewl5ZfvXrkvch4ZwYR1\nRKFV\r\n=oaKL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChTbZAQOE1mNheFlmVLALgq4C55nyzc0qyNanPZNELewIgKbribAySQJeBytOKusU/brn1116MpKROWICKG7t9MOE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"kamilkisiela","email":"kamil.kisiela@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.12.0-alpha.e1a653eb_1535963188140_0.9998279716703435"},"_hasShrinkwrap":false},"0.12.0":{"name":"codegen-templates-scripts","version":"0.12.0","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.18.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"gitHead":"6fa3ae2a4975297ae4be8809a1691ed1b0545cd5","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.12.0","dist":{"shasum":"a4c2c182425a82e5ae1d1c618c191cd809f5c67b","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.12.0.tgz","integrity":"sha512-1vuF5jS7i+ZkHKjkiFul65LSZX162cARfKoIAWJRbUJ69/PQZbOMqUOKDU3ggvqNzoFZwQxsU1vI7UseHC/UAQ==","fileCount":12,"unpackedSize":15743,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmmylCRA9TVsSAnZWagAACkMP/ja7xj5xJ/7tiBG4Lnas\nUlrLEussimbzRo7XcXAS+aQa6z6aSpmOpcopA2/4UoDUbIDNJbFZCjn4GDwQ\nmx91slCUBHafUUF0Fe/2wAujScX7OlSJaFfNvtrO4jnKZyd1/Awn1lxJ6YTc\nbzDS3nzKm92Ewmv4Hg+/EavuxI5V+8x+l0WOWz7u2/0AAEyzGykrBvAgGHbt\n3McRY1nWV1K56n669fjKBzbTEzaTzRWKwY7++s4y6dfPbfuNbhMqAYY2XnXT\nt8Gn+oiCUVIbK3qjZuENdRYZBkRVTQfC7cntCBjopMZ79XMYW5YZS0lbtMgh\nP7LNIQK1wCOXgR87Fb6KBKjDIUylEFDJhEWn4eZk1jl7m1ZrUUtI0Z6ukTng\nh6nr1sZLZsZLXUoAzbAfy+y/SyV4O62J1GrRQV2zbMlhghqYnD+utuvWks5u\nPs1zFZ8vPqwvQpSw9AcydOI+YvNNGQ108m0OC5fIE6WllFHIhN1i7domG9Nv\ntkdP9BA6n3NcIS6ilaztPxwrD9RIRNLDfYss6Wxm7aP/teURaDk8R+Pe+v6u\nbrYaapXlEwTl8RrKHNSglhYVc+cV5sTB4ObCABTWNmS9rEWp6O5eowValJKa\n4qXsBX5qe4U4eSgHeKI6peGxhrHegzbzdNDCgN5BW2VZc/fQVsI0hyWIXDXb\ntvdX\r\n=0Dm1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDfT8Ms9HQJhidx6dlKrSe8t9zdqESSqfGU7PVuMXvVyAiEA/ZbAiRecC89qHk47W20ELHWZBrw1vhLtWGcMFank1i4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.12.0_1536847013057_0.33693545007897874"},"_hasShrinkwrap":false},"0.12.1":{"name":"codegen-templates-scripts","version":"0.12.1","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.18.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"gitHead":"bcdf292a9884ff2c4f3f546b283a8ad3e5baea1f","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.12.1","dist":{"shasum":"5ac9356f5e900c288a8ed2e12e298da527409258","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.12.1.tgz","integrity":"sha512-eumtrlnS55wNwtC6qFkwk5tRhq90vS0B/GKobfGqzWakAdpAHAYGd8qFWEI0W1HbrqxacGY8EArlDVDTyMjeTg==","fileCount":12,"unpackedSize":15863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmqG7CRA9TVsSAnZWagAABrIP/RObmV6kyiMPcCiKZCfx\nPUjQzmHTpzFtX+Ldgk7g3K2fRCxVzk4TyDawcpjs0Ff6h1J6wy0NCjnzwIYk\nNsCfflHUonovTyyM1itywzjawPInAtaeVPE/L9jtrNwdrN9qBff5zVRN5g4s\nm0jZMDWClsLm8S3AZjf5wPNF4XlMscMLASjDLAzL0kWnLjME8/Izxeq4XbXR\nO7xBlPUR0+cMrLIcxAC7A/q2ZbWpRLWSJC0urk2FCm72hoVjNdUnApt9djmH\nL7i3hgPdq1K+uhlP4nz12k0Uc0df09DKrs8ERivTrX+vmk6sYfKZdVMvG3a9\nfbJeya9EFP6Ctsy/rJbSIYaEVOkDYVu0B/YtWo4xS6izn8l2MzJ8H2IchEJX\nzKT9GYf0c/xRTM6Q22MyKYTHjuwfrxRxl4qPyczlZ4cdWVIzfwn7xOZJ5nwS\nCKvpySJgdEmMVflOTPhbpm2/+c03/rJnoKWNmxtVnp7rzN8lQIAJ+EVBPM2A\nQZ8NWcHbh6ObIuinQib0j0uRGBYgR1Jk3aN525OBEY3euNdaiuEY/o3ivMFA\nzTnh6OV6B9j8rRjnDmgLufCXJoIVlBVXb+/Y6Ew8B5Azg/8yfawptNl7uRZh\n/Na9OVBpf3pAlFgn/BPsF8+nOBYHo6oHSoM49t5R/+Q8jUKvuv42gBnLEPKq\nJKq0\r\n=QdTX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1BM75lBSwy7RY7npa/7p8lRBwC5edEAOYU/gH9BDofAIgMn46lD8MRtkaJ5UR1b9Ci4+9uEY5fLHtagJxLd9NHqE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.12.1_1536860602899_0.2895825314673657"},"_hasShrinkwrap":false},"0.12.2":{"name":"codegen-templates-scripts","version":"0.12.2","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.0","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"gitHead":"c931f6dc43d44b72a165d81877fcc964f38d6251","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.12.2","dist":{"shasum":"97973585f61813f2397c00719b3900a7a01ff52f","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.12.2.tgz","integrity":"sha512-bRhcAoJ6d2Q6AqRqdTSwTYLaIGXrWkNIKZX3FhMXSF2wg07wQ3UEG/z/J/6jZ58k+2vS3h3evK/eYXrZ/tG+6w==","fileCount":12,"unpackedSize":15863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbm/WACRA9TVsSAnZWagAA8vEP/0mtRUO0COCTsr/QVZWS\n5yOA+xRusdzaAQk2SLLPha+4K9nkCsTp9PJOctCwN3skmX/oi00SJUaRg//d\nbH/HU+eL/BTyW6R5EA4MAzas61RGtv2MUzzuEAWynh0zuat003KhwLYbTS26\nSZoyiGVePXaKem/NqNFMpvBfSpeLQgI6V9gtMU6KwdmTg7+A8dyKKczy0eWa\nyJstBcnryvoJJ8xgo0+vxqJc4nkXn7mFumNJkolY5mjwr52sMd2OdRtYDm5R\nowXHYspTz+vyRHjLP+jkySYHdC66NQV2cv2ha4Q5z+1Ms6VTN9L5UztXqMsp\ngS8tyC1NQj2DOuFswPfN+31Bp1QZ+q5NsclyqWJDLayRplm3Q11Xm8xIUNPB\nkB4yAupbhus9i1ZyDt824eeAv1pFJkeq3JuIPpPUiFqe0QgNAuQ+ThzV7scw\nOXmlqo4sh5QnkX8vlQAbLvc1H2rofUMvLfrYRJ54M0U0wb8CqGz26CH7EDb5\n7JjxMp/P75cBWSHD1FQusRooh5GhFQc4Xt7xoxt1AcicBDM1yb60EfoLpUUW\n2OKeklqqigKR9eegpoX36UXkogFN3Kz29bD4CEzfz9AWxEl9GchMS/ft0Cia\nvIj4SmWFRsDj4INiZcxjQbpbtOthnMzzYAtf34BvR0C/oZYlUCFgoO2oBxEL\nwNAx\r\n=r9er\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCurb9c1Vg58xlSlM77lngMOQ6O9lA8ImUeQyJ12kLpFgIgaVi2zJf3NA+1L3GNhHAKTPadERfLxrGd4/+yW/qNmXQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.12.2_1536947584006_0.3397045781091479"},"_hasShrinkwrap":false},"0.12.3":{"name":"codegen-templates-scripts","version":"0.12.3","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.0","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"gitHead":"e2d85cac1608cd10f93c5c7ea95c6cbed2f2498f","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.12.3","dist":{"shasum":"9d3d8f33ae6c4fff067cfb157f95a6ef0003482d","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.12.3.tgz","integrity":"sha512-u6oysNzA8jY4/W2bdJzquYEK/a6j1jFcLofJ6ZmYewPNj4xr3WS2yxGDAC5UHlg8KvhXR3JGui/cJAdUbp9EYg==","fileCount":12,"unpackedSize":15863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbn3fWCRA9TVsSAnZWagAANVcP/iX+w7MscAHAAB3IuhIk\nR8ZBGRil1BZbG6STCv+u3WTlgAbwNCSE2EVRz2odabcVGWxiRRWEEXiAmDB4\nKujgYFDg3SZ9n+Nif2WOIei2P4Lf5mao+Hqo58LSWxOdgqjVwbM51KPqTMtV\n51VJYxMzJc7rSfvy5uYFZAVy5rwm3J29JWBEhNqZP47P9c22xyZ+ehb1wgif\nutf6/H1CWjLPZYIIau9CsvKaEYxAxmlOBt/BtldWivEMj9FwCdpWnM1eloAv\ns8OYBSVBQVcZi1Oi701odaTKmMIIac+JBmp6sdG6RQmKKZ0C5O3GPjqfsxvZ\nlHjJdwNIWhDm3fuRnwHPqdtzngTm2wsqEsr6WHL4MltkmeemT7pRAFfuzox6\nqmn+qvUOiyN0puxjNyDl8qKkCPeTTXBCUvgWj5wR8ywutuJRFopp1hcdduBt\nIdPS43F+HGKUCZ57xboqBU4PkjbsqtdCGl3VE4IaDkiZ6hwBG7Kc5vmFWgNn\nukMZKA2RDmn0TOR6foTBpjfjD9AkFX5H+ITfrYR8ssXsCvJt5S1lJQ+KyfHx\nelJaL4WDIC03M2vtsT/bjSsQuJObEZTYbHcYaE/LK1DcgQfc6r5+yRJdYvXO\n1MUo2kLnwqVJQGv0jfDlHCGbhoeWiJGj5OSfngG8KplBRpBd1J04haCXrF7d\nfDm/\r\n=zA3C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICuULWYdBsyCBRb2DshVr97zRNUVoZhiY4ZIh18cRdIgAiEAuyZhT3B4yObUzdzToH3hBptRXiDxrZBhuUBPbcOb31I="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"kamilkisiela","email":"kamil.kisiela@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.12.3_1537177557465_0.24504118654343499"},"_hasShrinkwrap":false},"0.12.4":{"name":"codegen-templates-scripts","version":"0.12.4","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"gitHead":"c3b57136e84eb7562d5a38ed1ab246fa5abe4676","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.12.4","dist":{"shasum":"6a192f3a0b11b22696def9ceeb86260a4f31b8c8","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.12.4.tgz","integrity":"sha512-w4abpDwXz33XDQBynAFMqe2Fe3WbvLYJid+dCrfYPHCRnhN6p41mjlDFaSxk7MA3kpvd3wPepo3QMhJXSXuv5A==","fileCount":12,"unpackedSize":15863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboM9kCRA9TVsSAnZWagAAESgP/iRB0VXdX7tp/eG2U0w/\niUoiusOXUq6NXfCL9qoZACM9w8s4PZzueq8fNibHAUEQlg04U9QrBTl07HpA\nrnY93vw/NiqsKm123+yBOZVEIbCInNmwfhgtRRxBWl4BShkbGh2yYLBkZ5S/\nn6DjSbrnKGgsXnYxnU6Gekh2x8vmA0zBp408B9i6M6yGE4CJD+XuvcVrhktP\nccn4GOiQP3PtwVtWa2bvRXYd8JhWRLwGjUUX+kTvrQEKpQNSvkx6w77koHpi\nmA7UsH2QLAS6GEkXrn09Cq8lYFQF0gzHE47KQq16GZN+Pw2NjGxqTkhKqhKp\nAgVMY7FQdPA0XCQmKpa0eP0F372GgoDj4uwryrjOTWnbFhaWzmiLiBBQ0Zp7\nh8mYpEGXETwaAnLcxO6pAjPWU681pwf8QaJbdJeNg9rsFBSYD6894JPe58cg\n9weLhqYsLCqCMZejx9IdlcotsIOy8e+Yw5KgCN+cfgkzpxLSxabbCDBLFTER\nC+e7hhXt0NAELaeXJQEVOFCK7Mlgix86r/idtmwk371hP4pm4szYTqvXkgDY\nt4Icn6mSWxvR5hiOkaipjRnzK/5xQe3UzXKKx/T5gz5zloGvWlgku1dQjE7w\nRelqG93LD/fURmi6aYWBrrduIapORZWBraz2naGxr3gr2Qkn9RKgpAIb4gRU\nf9V5\r\n=pivF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5aADypx2/xxY5mQTFq10aMzyPGSYw7vj8bxTKXefNKwIhAND5jr0szb/6r9CZhamDP6tfqS7RsR3tPRM7cpcUtiEK"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.12.4_1537265507935_0.3710916076542303"},"_hasShrinkwrap":false},"0.12.5":{"name":"codegen-templates-scripts","version":"0.12.5","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"gitHead":"cffa769dd20ef801848e135cd245b0db646ace04","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.12.5","dist":{"shasum":"8332ea689352c994af76361e79bb73b9d75a822d","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.12.5.tgz","integrity":"sha512-2ykFP4p/8rJ4X8UCjCmKG4Q+89PU0OL+cl0pqUCETW6wlakGUS+Ts3EvwlmvGSI47hX8mrjED0oQbV9OsM847w==","fileCount":12,"unpackedSize":15863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboOinCRA9TVsSAnZWagAA1vgP/jGKYO2R8C+58tnvesLV\n/aZ8/2zzTB6qBSU/GUwd6RX4qfNn6keuHc3WvYrdNSG47mgBzB430VfZg6te\nL9trOBNrVcUEAahwI1/nN3Js6xWkatNQPvCUKrXqAnESOUrmB0lDBRfErpsk\nlXrOyFtDsRuEmqajlxF9FEKA4CXHsiITDS4LYjrFpew4Vk8cyWPdTiGW0ZOW\ndIHp7FUo0nS4Ysy1Dvqhe5bhrSwmLr3BvaHUm3SA3vKVcQr5gCKyQp8rH611\nP1IDlA3EHzbmsYuicBslwcG4lLOgvHx1kvU3d+Po4H4t4BlDhiclnHeQWXJ9\nytT+41PEeYlhNzt7ElkBrD5pj/zOgq/pF37oB/JkXvjI2I5W7SxYn35uUMGL\nn0KZ51dS9QFLCobpG1rOnbKN5oDEkS/uIMJv2yEW7ZAp46nKmk5enqb9zspM\nC9ZNoKv6aEwUsXlRaZyHIrYfyWYsRJ4A1NYbkErJjAX1Ws5kiL6cKLwfIKPp\nBOhGHXhiTejJ+PTLdDaC845vUr+H/6WFCUlv/vfvcw490XbRIjCJ5Juq6LsY\n8nGYWYvoPBf04EYtzEC221yeo8xPzsqzUxSvAGRYUkX5xUPaG6k7FeCz4t+4\nsce6TvyfWb6JembaJPXkUygyLUkNhhKu0WI87WaUEInyTKYdAYRt8g+q+NKS\nE05o\r\n=gfYh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDRmM5Y4P3BTQnYtNGdkNP7vAtS0/O359WbTqm5um+gAAiEA3tChwXWlyOxjxh8F0jtrXNnFGLv+b2A4r0UqffOEfHE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.12.5_1537271973667_0.99375515296387"},"_hasShrinkwrap":false},"0.13.0-alpha.6d010135":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.6d010135","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.6d010135","dist":{"shasum":"b3f7f808597b69d140c1d406e8705eeb2a18244b","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.6d010135.tgz","integrity":"sha512-kHZOrhMaJQOwY5h0buxAfeFXe7NwfoTCsh+t0y9ha8iTJYejYGNsqJzkjNgRcYES5lBblsR8QqZZ8WgozMpU+A==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboRxnCRA9TVsSAnZWagAAFKwP/AunnVuM4s7qChB+P/+l\nJgXqle4oJvpnkNWqrew3hfG1iNvvUMbmeJC/1sIaUPqgGvOToXUKYnJRd4Kb\nFXlGONRmBJRzo9CgO6RmVZgRniR1PcUiUnrGmxLCU0ozoty9VMLY1qz1umDs\n0kQO9lBbh51G96irN3Sr96yMd9vhzKtPltENRMK6kWhWkwD3x42kWJo6t2cj\neq5ZmEwwvdhEa1PPI0D9VyJ4QStzuS8SgRmJ2GJs8TPMjOEJFyexd2zsp1PQ\nFlPr/oOQmP9fq4lcJREjpeySzZXPXyuvy3Kb3dEQNj0xAfjrETKml+Mvpixs\n8uzKaQWUiHdPDE2xwuQ7cPUT/WnOUm44mL3Q5nxlwljqBo+kz3JwBAIPpeG5\nYqhqpUj2iUnOGO69FuT3j1xmYe2IKVgPxnwG5NwpFN72D4scnGCUito1Wml9\nZnnrd8/J6S7v4IiBpdaTdrC1Q8IBHK5Sj9OZ0/NDUhCWq3+LSORUAUtwB3WU\n0IjQ6fttHoE/3kVvqRIQSPpFPJelmsjI/nN7O6Q+tTLoihnmVSCDKBRoCmwp\nHAeKaa5NiNbiNUE73wH5SIzmJHyH16RQCNw3TQ/3mq7JzjIoFbWcD5HYxPIv\nwiwV8UdcH5o2gHm6D5VqFq9YgWH53TmjcuiRN3s/knzJcW2A02CJVa7qrD7g\nihdI\r\n=qvoT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICU6WwkQnBhPEBthpL4+SH1bb/ED4SYKcWz990gJ/38QAiBL8R/wDOxtt0qiAkcWta5z+iyKoeR/kwGtUy8QJyelTg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.6d010135_1537285222966_0.5741689081472527"},"_hasShrinkwrap":false},"0.13.0-patch.e0b0df1c":{"name":"codegen-templates-scripts","version":"0.13.0-patch.e0b0df1c","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-patch.e0b0df1c","dist":{"shasum":"d463988cf7aa06d091dc60188326c9096192fb1f","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-patch.e0b0df1c.tgz","integrity":"sha512-5R054mpbV2kKvkt1/9KxxXLBJiy42ti+k3w5GrFWwj1vf4316F7l3XxP4xiwQCGBA3hTA6HgNVCgTXNcD6UACw==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboR5OCRA9TVsSAnZWagAAc2sP/37cr/SP4eeClEeEM6Xt\nYpGrN4qJG9/hpm+7rf3BbSlFeHAHG6thn1RVqLvoAd6DQs3M7JPu0pU9a41b\nB/MGes3ufcsbX3+vgjai6PR0ikTYZ0t0JAnd3vmY0W2XFVYbXOxhT8tQnFug\nSrUC4V/g0jSAkR3//nhLc6mIE2b1UlE+v1WPT+CE0sn+0UHQ4cJ3qte9nmgK\nekPqmSGHd6F/T6HGbziXyj3YHqK7Q9D6GCVeKs+RKCRopzrKLvTyl5zyEDqX\nUUzimcagU1ERBPyGe0aUbhbKb3VCkrv37exhM0YIdLus8jJIrhl1ui88KkPD\nzFCpcvs9gXRYY93N2Eqp+1up9BPm3jY5XlguwODeKXEs3Ka1qyYfVITpzpa/\nHFC06GrBGk5QnrOMYanGyFsdDurVoABvFI2adooqp2Y/CTsrNxYXoKMwwp6n\nfjKP3QwukknkZLNyolRsJI/WF+sELOjS64X4HgIyZOwkurgZYsuLT/jUPcUm\nqAG19DRG0lz5zYj+ebUabnG/+I5ffLQks9T1S2MAyhrMdxLsuq+mrnd3bS+J\np3nF/WdtYdVulfC7QLJmYxuXWZHef+4+h7vXQ3sa+5WnwRPGy/16nhr7qV4g\nB2zOfrnUDRYzLLhhu/GVGmkaVOq9U5O+tYLsx79rllg6VzOuC+xejP1gi5IV\nI/sw\r\n=c2EU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAWzPK5WqEHc8wGGKoU8td7pXbvi9qh968rAAORQwE1UAiEAtdV6rsPUbadJZlhAtbrJFf+XnqJTTRxsHH32rrb5Nb4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-patch.e0b0df1c_1537285707633_0.2257725917841209"},"_hasShrinkwrap":false},"0.13.0-alpha.30bb2b9f":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.30bb2b9f","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.30bb2b9f","dist":{"shasum":"c14b276e61fd363e2ea258b1b9f5fa6746cdadc0","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.30bb2b9f.tgz","integrity":"sha512-i59dsmj2GfXumq0JnTk+0IeUKH4/+JOyQR0ijITV5HiU8rTX6rmDX4jp+KBBJgcMO7UGFReeDLBJELCc4VCBmQ==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboSBECRA9TVsSAnZWagAAow0QAKG6SAPOdxTEzfBpY4uw\nRrTs8JzEM3tbsnjpsz6qzsaaGsrV8LaEKlu+uqrr5Zk6kaqJf6ocIYT9BFsc\n3JksIBS80AxZFWEUrw+CRff348ycqGVwRCYvKZHp74h+Er/iT6K2PKAuKKvw\n9Hae6A/Q0BvUYPl3da4LsKtIhkfHYoKSZ7ANsNNITvUlSf7wJkOuUiHS4BOQ\naPXXgG6lPb3niQyWCVkhI7oeNQ2vHrus/wuCCjG64fn84e99fJv2LAB8gq1r\nEZAwD13CPF8vLNoW47xAbDDw852qsl64IIh11BoXUMzNPBmzltWfKagSrc94\nBS1pqvj6QDiaSOLihP0L+wlVTHQ5EfIchmIMK86S54oghWdbQj9hYaYPTyS9\nP/wL1kRUnIUBup636eR/a/bSH2DhDTJnycoGIIWq0aXWEYDC2aziCTKMBiW+\nnf8j3JhzOTIvuXugjnAmIC93fDNJyrgdLAqGZJPT8jMMangs4iqJIiU5gwaN\n+qWHG5Ip04EZmzUMIWf4vCc6c0oap3naK/SYpTT8Cg/r7bwUlHvDFqDOqZnv\nljEWR5dJx/ZXEvTdA/ROEQZOfTOsfZE77buUhywWRvDuqXEiQc4997qXoq/q\np3zB5thpQRSk6wN//QdBdiwEDH6iN4HdtP9u1urmtV0UDsoLg+4cAPQbY5Jb\n+j8t\r\n=GvFz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBma3UvWbFEt4D5+puplDbBkihE3P9NLNBbFXT84cSh+AiAmtK38ebmYBR+WUd/8HeUomwgW33xkS6k30CMgNw/bng=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.30bb2b9f_1537286211668_0.019151881870978604"},"_hasShrinkwrap":false},"0.13.0-alpha.2d710114":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.2d710114","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.2d710114","dist":{"shasum":"18d453447abd53f02f70bb07ca90f53305646a19","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.2d710114.tgz","integrity":"sha512-tyPqX+Dy7sWIAC+akz9BrpmvRAftWDvRrOmQG07bQmYtYTv2bg9JIIgtFiqVEmqnX4qWXAEOoExlKxBI34LlQA==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboSE2CRA9TVsSAnZWagAA7ogQAJ5gZSNA2EGP1gzbZ2fH\nOnUYblmV5wusy4nzCQfno9+JKd2HgSgBnTfNWwKNu3Yf/MK9xW5Wws2DLAK2\nhd9fsCG1UtmQ9dw1dz/tlfyizB5y0d5UU/saQ6N1cVevfkYfRbDK/Mh36K1g\neZtE9B/njlyJlwALrx5YDpJC7VWgY0TpWdXUDXLFj9JQFc8ZNxP9S7jT5fnl\nZilXU15BXvbRuoqQRJ8ZRzpTx4LF0ScekAxc3CJ+RwuzZYCbjkMFTBIsmo6C\n7R5OMl5gafFc1MzONy3RZ+/jF04OV+Rr3mDjoAj/ciuAwT8XPFP3Uv353h5L\nRqfHkaemKvkZ0Qp47hIhn+ZnRp3Y8Q0wxFDzhaDDLjU+E/qp0i5Pea2e2scC\ndRAcAcuXuA5oUxDGW61o5CTU+1U3rduducHtyXbVMC4KDVkGjVXHLynMNcPt\nx2vRaSKshJpWhojX9DFnElPZiv++CQt9ZQ1rFKQWo5j6vqwRt0VlF7McyVuh\nHX2RKiua4Uwav4wOWA1AExIjyKA63i44wBomJKwhAdELJ0LAadSuuDDQMLRm\ndQ+y7QAlEeot5bFFRAwb57UAi9U6PnuTeS5i8ptn6GcxmOG1hRyux24klKKn\nb2izmJ9jKDIDcesLoj8OOvTC4fC2g2g4sDLB1PMueOt7eh/WbTVhc0zWcA3X\nw0D5\r\n=JyD+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEcl2Czg9xEJIwBXHclhV56CuDenYBbi8+B0/DBskYoHAiEA8SrNgVgwYTvjBs/Ivrek4pMPg1JfjrlyirQ3yN9qRRg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.2d710114_1537286453610_0.9740765196639045"},"_hasShrinkwrap":false},"0.13.0-alpha.106f2555":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.106f2555","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.106f2555","dist":{"shasum":"5c6ae164689be9893d4e55da1aaa30e3d9660b4c","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.106f2555.tgz","integrity":"sha512-5cEqpQyFVZDEX4BZJ9/0GfZP82EcsHL4Uc6qbTR8VQgMol8xaOMSze0fk8lIi4Jp0LwyXXcAmFhP+kQ4DdY8+w==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboSFdCRA9TVsSAnZWagAAls8P/RHR8xtEVsN2TiNi6XEJ\nQTTmkQgCTgaVATc0yGSMSZEeX66xGuwyyZRkYJ/Luykd/f8N5G3Samsttx9p\nBpH234N3lsNJvU/zjUYnvWf12SYI/AaMPCXvTk/t/ReWzRVvQKJlKp6USSc/\nVhuqQlUN+8185/PRDs/RieyYjqaOtwwUImTiiQh05znAiH1EQzg5ppJMvyDX\nGwQyHJ0ExqA6xdFXsHasghzyCiJir7v+jci+BrNEc77jtzDMU1x/YEdAdRPl\n2mNOHeWwio6LpYLbaS92CfyxekBacivr7ufuEhn0BN4PtgXozPt6bsHgTy1F\nz/rjqvqRJxvS09Zni4SLfiSs2oWKIBs47qoIEAJP58iLT3biD1HOU+z2NVyU\nUiTlB6MUAILlcAP2tx4tqbS0/Con2d7ak0e6P+gPCytM1r3FrTiT2czbr87H\nyap1ASn3n+4nGWZjXMpxahJYsOCnlxGjpenoiwf2HhNk9X+I1hW3nMTtbYCY\nVlKcYoJZSosngpMxGnGge1Ve2uCDLr+HTTBHGASLctuua+Ni2DsQHNvuWrVV\nDWAOcp9hu6Z3ppx4Da+49l/3Kbi7HWjeSC5NYb2WuqIVVNhxsKXXbYC/6NRp\nUWm/fWa2PNZpRIxsmpFZq0i33EEVl8GOWULscHDlTUg6uu/+GDaQYl+c8qnL\n31CN\r\n=qvfe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRSMhaTrreB5LJpy/pJEYv9nbgbpsaky+okL7DqVxyYQIgUv4nLYU4OGuGKzIZAciIm+uVIO3+OlYBk5ga5bXA2Eo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.106f2555_1537286492578_0.44057870873916216"},"_hasShrinkwrap":false},"0.13.0-alpha.24f2cd83":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.24f2cd83","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.24f2cd83","dist":{"shasum":"445342070aaf0bda65290918451bc64701c5fe15","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.24f2cd83.tgz","integrity":"sha512-bSsuXUwHrcku4qs5B/9bi8ZLTowzoDKCl9gvgSY9O38xI1h8CzZBamBMHEt7JpQAvg0UT/uVzziPsmNU44bLWQ==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbok01CRA9TVsSAnZWagAA648QAKFjP4Cu3+7C0r+AxgW0\ndF+sG1Zrm8qdoKuUe9lcNpSGFS7pBonRZJ0TbqTFBYvD2SRtOzEnvGHIloMH\nKt7P+5BALSYnPQL/0KoTroXt6iF6kJeFkNskmXFgB/l/cDC/Y3xwmKRhg6/D\nPOESuEcsoo+mlYKNuFiY+lY5s6WiTzj2m/xEjHXMbAhLCYGzoWRqgfop2Qln\nnvUCRu8I3BWCBIn+Omjrk+a3ADrqviLI4raRsxIZY161pnjaBBm87Zb7vGYQ\nBxikHETUoD9wci+oaXodTDmOd6oMPoIo1IBc/v0+tG1lwyEakJwYnKI2y1uz\nZBRLbsPf23bWaOoTNv8Qr+QdLjZFKSCiXfjqPDAI4rrL2PKdW7Ty2a0AvmyK\nCrmQmHIp2DDmA0fyc7no5fHvJv0Lu8yisHsxQQIDqbnTrGcUcyEnNt7ZajkE\n6P0aO2DDHYK9iyqrXoK1JX5JK0FT4DYWLcQ23Y8sJVDPpCniGtZyCtz9lhgo\nPkKttaVaYmYMgfNTs52zVf9L+GIlGfey/YOQNyuM8khuhDnbxbI1Z4e/NffK\n9QLzXIBkQ09XBjH92aXJpex0XzPHZ+LPDGa/1qCc7sPHUR9XhGok07UCymyD\nJC7Ej6zjSkhEuho7+1X8JY4FWtcjK3bsoD6HEShkkS6ZpZJaPfO+OQ0s41Z7\nigft\r\n=W4Lw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDK06XLYRyjc1WE2XcYaMuo5+ImO6beLYLfqfvkn5n8CwIhAOCNkwrlDm+lkyfE8247ljPA2ejmcqyJraU3VY9OA3wf"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.24f2cd83_1537363252867_0.6316084029207487"},"_hasShrinkwrap":false},"0.13.0-alpha.68ff229c":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.68ff229c","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.68ff229c","dist":{"shasum":"f4bd78e686b2e157e77b81c6dbe2f8849a1070f5","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.68ff229c.tgz","integrity":"sha512-L2yygyjJ/x4nUtBoH737/e9xqPUCzQtMUSruEe0pp/xs8OBYVp3Q36aUb/UFdQZUQW0tfZkTMaynQuJ9ej8I/A==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbomzlCRA9TVsSAnZWagAACY0P/AxjDhHXrTBwF1wLWwmu\ncpRPAPQRAij6URAK8ch0mR9XbdZ6Y8bZwItPzRr1mizrjtb1mV/MscA6I2s4\ncHA6eyBEb3aSVhTR4RsfTvJmbIKK2uSyhswptRl+fxikHB9YrbX9R6mWyzF7\nrtuwdQRDcfxtLMIZqadk6islqNX9sW77OJt2eGKAB5aha5EphAfveYsynRgN\n+lintVYEDzT+Jeu+jHBmZnfQBpMdgVqCWFkK1YB3rQz9JcVXWwCqGqfJO6B+\n90g/Uw0shz/rHMvoGnA91J+MvUJyiFsv8/PDYBMLIcStQwsZjyXOsM9khYON\nXX08M1GH4FuFBtKwIG2jh+dNHPkxfzBT9PzQiOMSSYstskLUwoqLdG/fLxEp\n+9ns1i4bJ61A1cyWni1fqf292AkJ01vEN2STGVb9+kg6hZFQ8xMiQliqiIQ7\n+CsY/7iX3EhyASaZcZ56E4HWGdrsPZsZFpsVBk/YElwjJelnKKxPCVJC1djz\nPedJHUSv1zv4img9UpG5qc62VraCpOnJKhunw+nuJ3o5ltIgsZMfzOoBXJSc\n4/Hgh+Wp/2w1/0l5ypr2csZjjU8j2NYLJoQxkZY+bbxaQaOkReyburjcAwFo\n2Rw1rLpXjmOIv0SGV5S/UfKf7iv4s8VJx1TSC8E+8l5vb/PYcNmcC7XPq2TP\n8FSR\r\n=BihY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVDz6oXsdHPe1wTjqBKhRiEZKFSNnAUWrFlucnAsMVLgIgLrxfyjQVESBZggJYO8y6bUj5mDS/qxhiSrTaYyU5VLs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.68ff229c_1537371364653_0.32644288610133954"},"_hasShrinkwrap":false},"0.13.0-alpha.b9bc1f8f":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.b9bc1f8f","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.b9bc1f8f","dist":{"shasum":"d8f93c8e0398fe8414f5fe8c5d5846a81754b2d5","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.b9bc1f8f.tgz","integrity":"sha512-D3NwbO/zNWDHApJTev5YN8nyF3DajM1HDNb4+6s44fdDTdqytG+saw8AWcAFING2l+q1p468T8uLqMdNLfmF7g==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbom0ECRA9TVsSAnZWagAAQwkQAJvKLIDo4BSyDy1GIm4P\n8vwl7+ugU8Xzm1eAEaNhHUzTWJSRYRYsi6ygcKiOVpopNmWI1tz1hbqQYtBe\nZV2MbM1dg8kz+WgsrP+Yf/xQOCTpx7OgeypEB2AxQZ4jTCoJMEX5st8OXY8H\nz5N6BawAg+FwEpDpk9MWqvwRXesyy/ntt3vK42MVFRNBBRNxDfwmfSHebkXF\nb+/HwfMSc5TdkSqNWq9WxENQF7WD90XU8oc9gXgpMg//TjOLNLnSkaD2u53w\njB7VopwOBO9sh7Hshb1QUGdaPJbr+zywOqFWlGDqRXOLiN4kvrFXpbpllEwc\ngzKg5HE28fryRe62+3ElWoqGUG3h7lD/kEyYTzUoN0gNPlxnYYhPD5N62dZt\nWCM7CypAgh5G/zQyffpklHXgl1uDRgK2BiwxCL27kTYtbceRZP/T8XkJJVp2\nRIpJTBuhEHiZ3/4VbEAeWZjefWuI23f7YZwA7967lF7d8iuqL9szRE5jTBMU\nmvrMwWTV7+0YyHgYL85NEDzABgkod82vcx0WPyCFyQO7LrWkI7fXf3Db3uy6\nSNuLrkn38pxxXmCJgVhLiEUCNG8CgHjXI0LgzKHTs7t556hi7JNLpioQuLB3\nzDvxBx8iUW24tz3PUbqa7xNGM5s7FYFnX87NZlSfgepsexAXsE+kc1HfawKz\nRehx\r\n=QbhM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrzoeLMY9jC7rz5kHNAL1H+1twSs9RTrG2opBcnlaNGgIgInSKf0j/iCySKuUsWk8FLqXHox1MxuyTDiPfulGYcVI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.b9bc1f8f_1537371395843_0.41537840914882174"},"_hasShrinkwrap":false},"0.13.0-alpha.b2037482":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.b2037482","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.b2037482","dist":{"shasum":"1fe10632ab4a531c8b755db357b2d8a127a7a4dc","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.b2037482.tgz","integrity":"sha512-Ytq2ol+RLYF1lNAF+m9vjO5194qZk8NNNCmZaaUZGnPDeTrHAxuwxSygBwr0bpYQH34JVYC6ObA7llZEV9spIw==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbopylCRA9TVsSAnZWagAAtR0QAIej5G+nhHLFqJr3Oe8T\ntyXFDhlsGXsEB6Guoj4WJXev0ui9GeamLGQGLUZWw5rU+mrbBaml6r79On0r\nHBesHbBNhBIjj0Wo3Qf1GHbSVJ049R63lpl/fOao6cA5UuT9wEgUoHfe1Zbf\nSJ/JZIDkDjFkZEqGhffoMfJxJ09kpEbruKSYANHsXtzN6eryAO/ilLWqpuQH\nk0lkXIluDEziruuErDdwAvwYC3vUEE8ZrZ0IlHOvmkTDIWW+Iue4j0dhMvRf\nVmemlcWbjWPuVKs9kDJt6NtbWhIkqd7tMOMoKOno92I33+TE7SZN47W5bTTD\nYRusrApW5AuaozjpXNUnaAnudZoGmmumLCMTUqVhivARScsNgX4w/7XCMPWw\ndkqiy91ditCsTM+WPPbZFo+FR5lUaxKVsb6wk1x1ei83S5lwe/RalXIYwLwD\n7rzUrxo8zWwlTlOnjEnv2IjO1u27Of9NYH5ebtQdpN7g8BfjpeG04OnDbVAS\nHnCFKV2rhaFT2FJ3OUlSrgTxTdraoh3hJzPzC9ydYG5CdAnVeOVpkhIs2eui\nd0ftVf2HuFwwQ6qseY+pIkhcLI5rh7tALhh5471TnaafgnolvvpUOXx3ueDl\nsToq/uF93gOhAE2DCsZB0AJOvByw8SihklwliGqMBPikODUU/6A0kB3/7Tko\n3hy6\r\n=HsOo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH2NITo5s6R0P8NGvTBRYysJFeR2s+wrQSn1kv2Qg1cqAiEA1BRcNgRHNEmcroON7/RuOy/SacEiFyoOC2fzf7+lju0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.b2037482_1537383588345_0.4186020319437955"},"_hasShrinkwrap":false},"0.13.0-alpha.367d1263":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.367d1263","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.367d1263","dist":{"shasum":"bc86d119976fff8fd32a79fb3f6ae029720ba697","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.367d1263.tgz","integrity":"sha512-mR17xdIhb1ebbjiLMCtmbc0pbfprexPjWaRchtes4Ze+aImdd9LAKvKJB6BRu2XohgThoHS+ozAV6YPgVOAHYA==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbo0amCRA9TVsSAnZWagAAfzYP+gNtNIfo7IA1LyFgShjZ\nGs19E1ZX0uNtIMW9P10eWZlT0b4G9876DOjRYdLspWYhiVSaqf0MzPkAIlJN\nTfCDTclrsltxSosqNGfRirDaXSah+oGFjESIMGSJ4vWf7SMTAv1CS5QMMgzR\nnQ2Gsbrq9xtKPzncSyeOVp4u/2YpECrLW4nCeXrrsj1Gg/rGrE7wowSYDa8T\nwmjQL6Y6K79u+IEv86TRN2wGXdmQk+lA99Fnb4WP53gNtjWhputX+dMUN8GZ\nn6OpSdwu/2JXYKO1FY4+W0yuhjZJARiYJjvxB7M7zqyKKmIXKnPPkK56QZRB\nF9ueGHWQFfbmptJJzIENJrtx7MqI6TW8DheBM2lwu1oq/2Fk56+umSlT8lG8\njh9cJ7CVs81VTJJwWevXaDOJKZOa7unq1FhbYLqnou6QiRE6pWzJhBkxA7So\nuzT2kQ83p8x49gX8t/SiA00dyHzoa7+bXNZnVmtS+70VbivtqUC61bmb/I8y\nEdHc1fbsC7dCL0ra+UaRPKCpuKdlHJYn+JfMlT25bt4AkItOgxgtfgY7yrKp\nRH0su+vIymDSV3WFhajVU54LWPJa88HSSpmC6UEooGFMtDHgloFJDLbNQDgj\n73pleCTObT1B+cyC7sxQTrAxIPlpZv1FBb5whS8qnXEUlEYrP/JUPc4+H62W\ngyt+\r\n=pHcU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICSiInxbu3c2XXd1DXAqidRDy+CNCJvp2kdvLbMxDrEcAiAbe8au0HKV8SLs13o+5gGkazcBpZcFqBaSDcRxN++NaA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.367d1263_1537427109726_0.3974899546092847"},"_hasShrinkwrap":false},"0.13.0-alpha.410e9357":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.410e9357","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.410e9357","dist":{"shasum":"0a60c54dc79c8bf7acf17512d52f98d94afb4513","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.410e9357.tgz","integrity":"sha512-t3YTAk4PeesQDKys3+gO4kmmGb8MwKmJvNmILoivhaCQxB0pr49DpCGPkrWE6iqiKjBSg1zjpi0W/ZZPYFk0fA==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbo0atCRA9TVsSAnZWagAAr/EP/R5bBoYsNXzffBpiwd5K\n4sZQ8Ni9EKsaVveE0CWgKRoKC4htd4214pgfGsV70y4ATCDD7IrSHRtsRAz4\nUJsLc0jqDK4v6JDJQrf1P8BIrG+Q+U83m0m8GyITiaBuaCo1gtqRZR6EjUhs\nRQXrwnb1elaek3PzlRSbexXqbsTbXnVFBFwiR4C8ruoU8htMm6oHBake7MDx\nRW8TSe1SGAbMqiLIOhy6bYZfAoJDB0eb17H3uu6F3YI3gRuBFhCn03KZeCYk\nMF/yTWeeX3bU2c39QhRfHp2JdAOUcfvmm2XBmNPjO1F/jc4Xaasl/rg9i5Ba\nKQcSa5XH8AkxQPGchwtgc+QbQib8uOUHWHvcK8KUl8hCkHJlhwn7eclCwc28\n5KBtQe5KN7Eq6r8mbGINAZLfV4QZ0iQdzrkxDF0cituyphNMrnP7axVe1EY9\nN14cuiXoJ4PjlDdHVi2A6Tus1LvMpFtXMEJ9T2IY/htsIMyznjqoAZQUE/sT\nEtfvr9ANIiiNgmY4JbvpthFUeTCQEJF5+tF+ygLZt1MFqusI12KvTaQ/a0YP\nJcfD6ZufLzQhZDP4l+F5sPqG/cKnMshozC0zmypRhNB5ZTfDjzGSNLdsRW9m\nV3kMCojLASvns6Vl4cr1cAAsS2kOWNly+3qZuf1nzhHGQlB5yclhe7K2FoRF\nMOE0\r\n=8uhd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICoPYa+gGA08N9pN4c+0jtnYQxTufRkTt0wbAE4DB9K7AiEApC/kCniVto2kZ64/NKd4yNxMci97p8iOmimRhobGtDI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.410e9357_1537427116866_0.3967474669841804"},"_hasShrinkwrap":false},"0.13.0-alpha.ff740cbf":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.ff740cbf","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.ff740cbf","dist":{"shasum":"c3a5a1128d1cc9449bb05bddfeb0309efae6ffcc","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.ff740cbf.tgz","integrity":"sha512-69TW3fGhb7mqb73tKUHuSwsjWxnYXwNwKTUF9fcfDXcvWQFlQvm6T5oCk3se6h2kkrJ8gLD52jdW9w7jsp0RSw==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbo0a5CRA9TVsSAnZWagAAyWsP/AyHSU/vmh3ax1GWdHTo\nj6PsdvWzsD+EYJ8mLo1nzpTG33hb1IT/gjS1p3bAwFzaoewhy8EG7mugWY5T\nYrg5udCK7dXhLYy3gY8EVrxq8Vf8chcnLkBiMfuUJNuzSEudWcQMbPe64rHx\nqvqm7c8dz4/KjGYY8bP0Lswp4QTD5nEjLczd77reT+po6XBXeRk2bPY4tVl+\n2kut7dBcBkicJG5DuhhNb5oh4LKMo/51WLvs2URZD80yROQ4f9ysNmF8RmJJ\nYkR0X9PCFBpk/OGqSC1BpEEA8W+k0vOFOjCj86BsGOYAECq1D83AIxFWEjZS\nHTHL5WC5wm/69cxv0Xq5PB6nP4EDiZ6Uj+bNTbFsD+D3dXVQXDw/F/8YqSP3\nQa1xy2v2ZO+Eq2C6HSYkOc142JIRwNK03d25eswOUkJ1G2s659H0AyNtWrR4\nJ1DK2ie5hn3VkkknoeHdCrw9uRTPnh7fgHRPIt+ANJN4OuZJuJHQ94/WrRB5\nXNlWEUZn6UYkPC5vJANy1G2BAN3VEoBx8RGAp4gSJAStdIs5wH2CYM1mHYbS\nHMaoaCKW8UxEt21ncImm0TTaRt+4VOkcke0iMUr7iZ1SJZEOgkYoFujSzrcG\nWir1HyL+78brHHHigkcttvs0e5TCaOvrIfXty/Ke1lWEVOZcRZN3XmgPiBb1\n1iD0\r\n=b7Qh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAb1q3MFSAy9zeuMFk+W2GQVvlnudspRnnDof1+AFpjaAiEAhe9b/0TPkAyjtMLr/gYHe/Z5eo9EQxI5h+bNo5RijUM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.ff740cbf_1537427128483_0.7964417326432547"},"_hasShrinkwrap":false},"0.13.0-alpha.532a84c1":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.532a84c1","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.532a84c1","dist":{"shasum":"bfc8f3ff1db754f2fded83c3febeae2a3cacb107","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.532a84c1.tgz","integrity":"sha512-OqZ4tMqe9EpTEHkp6xnsEm/aDq1KDt/sRuqqcSiOiJk9Ht/+KPEFCd8BdKqfxizU2Zt5899tzPJPqQbCXm8/tQ==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbo0a/CRA9TVsSAnZWagAAWVgQAI0K36GLjlnArRhpc5xa\nK6PrxyKDQqSjfeGahVVlDi4sI8TFlnYZZGurwWEjuqB0QBxFQntmvpMiTynO\nXKNOA8zHA5b/q07j4RVseHqfG9Z3Qphx0Flos+kGreDukkrN03AgcnkDeduj\nTXN+wHEb8S3NUVAk2jde9PiUH5W+j+D0x8Xg1B8mCxP6hVCC0UnWPOCpUtg6\n9Y5yG1Zq7Jt9GD5Nqb/VemnKHKe7Qkg9w/YmadsAxORXikAzx5GBHdXNd9hI\n9VGm/svs4xTY6Dp/W3LfrEXz5Y1IhwRcdvfr8wBHkLG6Kx7wlqf8dbndsxsY\nm+yDQqDGwId/b7p6/Qs17BCenJYMFjCIpl6atR9a7oD/us8wHLe+rB+eal93\n0VvbLDFW+TS9d9SGD2+H8eMo+f02DqnHsGFIxqNFxqZGjuwgG9mVTDivEAPX\n8mHbPIHwC4Pm8mbaIxFKfCC7ATm0EFV0uA1t4YsCdbfwqetZOrw7IoKX0C00\nyAKwph6B9GEQNQbwmz3HW4DLTKbnbvsyyuYA+NXHtql20WaWFDjCvJpfGjNq\ntoGEkt1103QpmTDMdPualdWKjMbi1FEu03ldwhUe2H/Yib4vTyMjpwjjILTk\nXsRG6LD9xVbHi1WBni2WZ7vr4nWRU7f5tYwBQxk1p8qfHQUFzPsx8YMOtYx9\ny3s7\r\n=X7Q+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBs0sYc1LLrS0ygnyoksjkGF8DSTnhI19B89IqDPWB6FAiAAgutkCFJN/goFKcNxQ7PUcQUeOp97dkzwuppdeO0zyg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.532a84c1_1537427134733_0.07238662677051355"},"_hasShrinkwrap":false},"0.13.0-alpha.7595f4f0":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.7595f4f0","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.7595f4f0","dist":{"shasum":"2b6d0bc9e457d80fb091b1262f38f93dc14a0463","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.7595f4f0.tgz","integrity":"sha512-CrVTqDdyiYTZZuFKvFfx5KaTE/6iY1wuOdElXyy+vLlq0rAjebtdWEz11kKcKIVZzfSr3Pse2bPx5I41C+Nl0w==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbo0ebCRA9TVsSAnZWagAAc6UP/AtKiJu80RV7JQPHTTkh\nCPsRwGmQO77In6rvBLlPpcJ2l8SCZHkOOtycwccet4XCu43yKplT1xLqukwQ\nKhyJsaR+PyR/oyv9SuBoh+Ltfl+5WTF7ivk5OZxbbQnpT2+T6Yd56ra4LTvx\no5aac46Ik3L3coVZuChD43hZSMn1qfo0C6Do7kSYFDkH8/VUzD3ja4Sngi53\nM0O49bnpkKCEiSNzEwOy2wM44njsZBOADwdeJcCkcj7itZPUBV605QBDJnvr\nORcLlnqfsLqqe50WjRWpVGWXK3jcmnlnsG0Pmd/pe1KXPMlokH99S+y6GZtu\nz4AzkgQ8S9skGK2mv6NueTtc5LGECsIzdZXVjreJPuUY+TXGWqHCvIf7PyH4\nbOD7Xcv406uSmOKXniZp57wxNBLuiUQM5IxheQr2jXb3fFWEmsbTfoNIWYj6\nmqpOHcMf9llWOXASFQFiFZcigik7uqGAvhGrA9YD1SyzncYSSbLISPcqXel7\n5A/nnoNduO2sh2x7AyWGBcEzVy+H9MDmBFSMJyW0y6OlITvtww2MYon540+H\nJ9dhXGeKT77Bj5RCkNyA/NB/Mkn0ehoCC8pvXnmp/tDXvl5zFNmOF8bUuC0A\nQgGA9EAyBpHOm2dSoPOy9J5d8YNafyYm5+R3Q3aqFfWdskw1Yv9EIOq+birS\no86U\r\n=JOhx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC89ESKoKOB3nH2Qpytbl+T5uIwalKg4hT6sxoukWsPZwIhAJa4Q7SgmQHDYoJ+GV/nz/y+9AC0r1wb9aX7ZLGKih9O"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.7595f4f0_1537427355212_0.08540553463516343"},"_hasShrinkwrap":false},"0.13.0-alpha.06bc6df8":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.06bc6df8","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.06bc6df8","dist":{"shasum":"6e1e91ae1b22b7a4f1eab89eed6c8fbbe8ca721d","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.06bc6df8.tgz","integrity":"sha512-EFcttsz1WuDT2KW6rW5s27iucNFPlG4uze0OF4oGXZBVvW2Vzcvb02EQE/4rB7n+mtIOzaYrjv3NNF7lv0mgpg==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbo1HwCRA9TVsSAnZWagAAZJUQAKGIfk4EKhKQAQREiX+A\nn8j7IGCYPT/fqn8L5h4bEZ+Kx8HXo7PvBXOePIMskVhxX6CKWusTLVytK8nE\nh+42p4h1oZ7EfIHjl86y7pZ3uRl5y1TNBi3uhGhOh+YTt9p4DP1PCNoMzTMZ\nZhh3Iut4xp4Q9UVw/2s+rZNwp3Ztp1lnRUsLycdPakZz7Opb8RGBpPgFqRQq\nwSOE4R6URAoc8SxoEbtU5wiUSBi417HQuhD6RVE0rkG8QqSrSPJMqM4/FS8M\n5OiOwAzgg50ia1s7pjl4DzUVF8iPyKxvuyehk9ZtITsneU44Vb2yRMfUaRWp\nEGExF0VnJUseVDrGPm3CyqvE+Lok1jJ9vnRlsBI6YFORacgvIQLh/Cm85Beq\nff2UAkIRHrY2XO/aftUUojMYsTQ5MmIEWwUIe2Mm9P0HkcsoewCN/ALZOIeb\n++bFpC5bpe9NdDBWvboXh3iaAI+hljgrPn3y1G77BVxmAzYRcROuXskyW5su\nYZP0/yxdTTjPMXyDTvEgVBkDAzJ974EMtpq3Zm1vrHl6H0EDyHqzx8qf7Eab\nSD9dNN/E0IHd/nKLpr4t8CrDVwBA4gWXL2aBJtmBuTPltBkaTV3t8vCjoU0b\ntEeODF2nngzfo9rVZjPvzhvC9Vz2DS8fTaiI0snDMQVny/Bt/ZYL3zDzIT5A\n4HNh\r\n=LyOi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBriQHTigq+4KfaUet/WbLtsB5qDgvGkGWDkUqVy5PlQAiBEzA0gU7B2vEIvtPIphwyYSC3xwLGzPIq2HW/mS16P9w=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.06bc6df8_1537430000333_0.7232207826630599"},"_hasShrinkwrap":false},"0.13.0-alpha.c32427e7":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.c32427e7","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.c32427e7","dist":{"shasum":"dad02380656aa55217c9783ae10876be487845ba","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.c32427e7.tgz","integrity":"sha512-Gq85YcLybNFyHveVhwn7/QWKHfnxEw/lfbucjnxJZOcRVGgizV5u4UHIu7P2MqC+bYGjfojA1saekLirapWsEQ==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbpFyjCRA9TVsSAnZWagAA8bsP/3Nx/CUb/yXArA02cWuQ\n5KBekFv0YtWz1yKESSYiDmI++rgYP0ExFypoBo1VRodwkAwq4HyY+oaAuOsl\n5a5F3Lt7UTSK0jYj5NA5x7PRneEwcGNdOGyDn6KwF44lZdKrj01IIBe5BFYw\nbPvEdsf0p8QEO/7z5MlJhKpwCUaQjSJZse6c4wFzg2LtUvavxmo/EoOaY86m\nL+BLfIB4UKAN0QlEuzTB9aTxYy5rk9E+VeLMm3Emu1hXPz2UdYK6eGd4mwMC\nz18QOAr6DtEBZiwS8t08wf5Ju59axeu7gPtUYXekJHkPW2lg6qIdC9Tnennn\nOGu+ZkZ7CwLGPKb+zPg4rY0trc16ffN6Y1aLuTqmBwfDKkj8+mRNRfBXs5Mq\nfh/VOKqwqB+hZrqqywNTeBYc+QsXUG6blyJZw4+H66Kw86jS5CMiWYVbcL45\nB9pSWOu/jgTdbxg1DW4SB1QBa+hVFbgeF3f220CEZSp/cIWWqKb24KHj8Etf\nIzXeaDcKWNP8iabEpPt5vOItwgw6bZ/ZbgJX/aBdtWp1wm2WDBXe2tAv7MNd\nT32sSJsQeINAHVu61Pf5j+T5yFNU8BEjr+AxZe9BqQuUdsngIHVigDqUGSXh\naNm9ghgFyBK4DsCAUEBLePCk/6eZsP4K1JBE5dRSRPnUN4KjBGcu90nRlW38\nTArT\r\n=6Et3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDogzCQBrWVaIV1fXIN/QtarQ18Vz8dkEWDgBMe4hrrOAIhAO8OnNMc9lpkLU0fbZ5PEcmc923KJlK9TDb/vlv0Kr//"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.c32427e7_1537498273557_0.09874415837338257"},"_hasShrinkwrap":false},"0.13.0-alpha.dadb76a7":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.dadb76a7","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.dadb76a7","dist":{"shasum":"743454c38780d7ed7fb5ccd81ecbe9012be02458","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.dadb76a7.tgz","integrity":"sha512-kd0kXFEGKsvGTSRvTx8eUcEwvU/cmkRoNPBNzv4OIzDgEm9SiZv4q9BWhcnUgQacaGjOKFZyx7r5XVAuWgOg6g==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbpPMaCRA9TVsSAnZWagAAOBsQAI8Ki5K5dkssRkmuQqbc\nlAs0ZBk3/7j2G2gcfQ2bm1ZKPAVmT40+ULcnz17PdEx3w7oNeAg7XvBupu8i\nI1j4H2U+dyWEve8vNyNRMtQ8A2VAmUiRZxIAh4hjOJgOdXfS2aak6RFdOlcE\nuEiop3TYPlJu59tjENvcNPk8UaX86GFukVNlEmo5liEoCZ0UGty0d8d876e6\n4vE+gZpEHgIa/lCRNFd6gsnQkK7p6mDs+CJWwwdLZMGUp3m8vGx6ZEEWAZyK\nl/A1vks5Qi66gniwMIQOjJ1i87GI6elIKgVDHcDgArCksK5oxLva9ddwFM8H\nX2PIUGrtw6x9837t/QWERVKcYM1NvwrISNudNAaH6+wQVK78eRsrW8GiTOss\n5rS26aZ5pTNi7t10zyH6nEyqaRoIoIKxJPrnydqnWhOzfmf4y1jFvB4tlT1C\nibH8ZigMbRqIWqxowwnsZOAG0PGAwev9pZUrj5iwwO1iGxpmu1fOxuO4Fen9\nnkYNXxjWsOx5mhopF8zdYquC2nhaB6KaeaM6tO7B69vTI9SlbHVuSVVDkkGm\nH43tvzmA9yPBAH9KWBQEkxNmLdbHSFaLZLJcYnMP97nU+73q/9U8ibssHA/E\nPLIKexz4ycmkcrX9xKkmLvkbk81oUeWDlP2xho5lDfA5CKrGelHUwWDGvNzs\nkZzK\r\n=AZYS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEAy3TJ6IPCyeqqYs+hWAqc5lfUTh4+zMzIkjIaHr5FxAiAQgjkPa4MQUD5IMBLgcprrZ4epq6m92sOeAz8+8dQoag=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.dadb76a7_1537536793446_0.5451276487951586"},"_hasShrinkwrap":false},"0.13.0-alpha.bd6593f9":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.bd6593f9","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.bd6593f9","dist":{"shasum":"38846593270c386ec63cb095e1233674d99da512","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.bd6593f9.tgz","integrity":"sha512-VeuhJBZnRAqL1f+GhnRiQGAq3kMO32X+eyVMP0FPkShjlw9DJzhTnle1ZhcVwTBlak3SDINpWIE79OwJAMtLIw==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbpP1jCRA9TVsSAnZWagAA0doP/3V72gb7dQga+Bmaw4ww\nNAJXZ19Pw7HSXYrh8nW+Nu+lo6AB+zeS5MX/sUYQIMtcYFRIqDKiU0Ia5V4F\n72molViA/rEI+BArMX40AvElpb0qHoCQgt7b2ou7m/JLjbY/t7ABNdBzES3b\n5u2SSTr2YAHN1mcSgEpmn1rwYQAOxru3j5ZQ4vryS30PRYaRRIPeH7TbmDLF\nzFpzZ3D8ia7yigHNrgQSzoJWjn7m/nhlucsPP3YU4UG1ABIlUtc5ckxjHoOJ\n8Bg+c0hZR3GU9rKbS8lLVJxxwLplITxtvAXzUQ98SDSrP+s+RycXFrT9XD0V\nY7GmOHsXOVnl7BnDU+quyvP7fCYuJsifdEjti5/AgtSdvXcZ+tyKM2e7labJ\nuLv8g9cP6XSB2s/3yXlVxaoQ9tEmjspIyGhcLhil2W1X3AINU1M9C6dogQ9U\nM7ikMrG7CUqDDP1IYJRixO9Djig5oiZE1ywqcgGkaR8PCQfEd6dlE67A2pk2\nry6VGNpzJfzuDpTwzuWtXm/qUEGocVPuMj678f0stIfgr50zg2Q2efo3WPAa\nGxYpIY6w3KqIxwswSFPjRSOtN9SpQKhipUfldICOeUknxKWzkbX3Lz9IyaUM\nLDZXsVw5cq4nbBSpLNo8hokrih14VrgIonX/L9f9VmZMQUcH8s3hvb5zYyjv\nxZgS\r\n=oQfc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7DDrL7H4p2j9btj2iusGNeFijMgoDC1txdTwQyCctVgIgQtynLhgCFcOlipbyDiuw5EboRTAio8notsB/rjU9zeU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.bd6593f9_1537539426597_0.6372779949739844"},"_hasShrinkwrap":false},"0.13.0-alpha.e2bcfb88":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.e2bcfb88","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.e2bcfb88","dist":{"shasum":"b2ccd81fdf1e5fe5ea19c26813196bc8af2dbfe8","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.e2bcfb88.tgz","integrity":"sha512-5bh/T7NHJcg//ESnJOmfIrndnV29MSpVrrCjjffQ5WIqv4hQzx4aQj9mdrg7vxiqb4wEkY6VS4Gq3c1L4K05Gw==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbpQshCRA9TVsSAnZWagAAlrQP/21aXetBkXLA6oRvPBOT\n5CEQmzEpcqKqykMmbFDj+0nyRleQbr1zorn7Z/xYNdh5902/ZmMZ6lCJA8+L\nLzho5oiWDV6lD983bjhi8V78+iLS/cvz2O0P3YlQhV5aPYlsYTggzcXOUY8N\nf6jZlQcMZWrb7lGea1nss8nRqp1rXWmyx9/k+Vkdkl6JyRbxp/sm2pbLB+pc\nyZl3PM2J/cT5ZezTJ/OQhGp4ViAGLLSDNnKmSbtJIfhkg1B5FJnEcyTkM5su\n9U9QKJEf2bXtbRRh5js2aCCwFzzasfgQbuyhfRvH25va5wxDCfLSJG/7DUvg\n29Niu2Jq8UwaS8MEtbJybF8G5OmrLqvSVQXRZhSbpMJPj9N8WC/jkGL+En3a\nrRkoHh9dcnWmKeywFsLTMDmYOord2PbF5QTaTVYt3tqCTjm6FWk+kP9n311u\n6UuAmDKCSrESJVZobvrVd5PyiBrOHe32DU5rSyW0SQGYKDn48JLdMUk4US0X\nVXRiI+y9S1cbYmIm8rrJoLzAmQWt4QVYAWXOMe3Yw3nsG6n401ikGWghg3i3\n6cm15t0hfYeD1z0QhNXO6AiU9yoH7qqWoWumuHwBFpYdjYkqEdWOGGsZCwlU\ndWdOUiJ8OoygRD0Ft4q7CpNuM0/rosEmeOdYqhHnxCsi0tijZBrMkSzwMsb1\n+O1u\r\n=Jr3O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGqctuXh+/0i+lE85cOFrAmxqcOMGo28j47oHGAsIfTGAiEA3j9Ang+l7rT31kR8L7jrtFOlIfjwnLRKPyqTKVlnWfA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"kamilkisiela","email":"kamil.kisiela@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.e2bcfb88_1537542944480_0.5634666698079334"},"_hasShrinkwrap":false},"0.13.0-alpha.a443c507":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.a443c507","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.a443c507","dist":{"shasum":"634c470bf6aefdc91ecf66dfd006bd3316e22614","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.a443c507.tgz","integrity":"sha512-cQ8p5hOM/Xof0sWmfVFOwqxFoQgsSNPodRsqHr/rv+hDcfwQ+4DSBd9Pcy8qNOhjQm9JhscTyxVVk412a+ohhg==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbpTO3CRA9TVsSAnZWagAAcp0QAIy94Zh+FjoCGf9MrhcF\n23D00fMp1i4soOh6vZoOWhQzkCX+63PfHz31Ckiz4IRgECe1nNSJWtr/W4Xw\n24fh2xW1HyjL8sDdogfAgXdEklezs9Zoh3mG3H+y0VI4qr0kcMj6EOq0j7cE\nsxYoZxEaVxczpZRQGyPzlbIHriYtKsW1+L9BUL0JvUu2GNm3IiDS+1awPR/O\nwMDFvS36nVyddOGK/Wdx6tgLJMFyVNkB8+OQenXGhI9rlTt08Q5CIqM1FuoR\nkYmY63Yus1McbJ3JVAKFxMuUiLbD74Oo9WVtsA6kKngSIHRPRwNz9cdU0Bo3\ncBvmhs1tMyCPe+cgXTnDCkO3A+ZBpf08a5FAkqqyxtaacFx+ApjJyt2zoLVp\niOr7yHHjPd01lI8Aa5SNGXlNh5m1c8ZYgOKECDc1oY99IZj6Bku9TUySFmo3\nh6mZmCig2hFquFJpB7T6zGK0zYtVP5bMURbitd3MrdwNntsCZCLOgCQmNGBl\nlWJCag/UYAY8HEUwZjudzYBe4hI3+xTi5n74rn/+D4ZjVlNN3L6X/fyK0MnF\nre7AVHYjk6P+Rw/Fz2ZOOm2FVcQkUcl2LhMTR39YHcVJB+Y9urQwN4V/4N42\nxWHU2XRdPWnBGPWKqVE65+2VYFtQPHfRkCr+GM97qlA1j7Kp8fKYu1sIAx7a\nlKUW\r\n=vsAP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGLHiigeb+T7dKKzuLCHp8qSTSFfcoud4bdSsRORhBbFAiEAyG4U/IoBjGuKHI/mwMp4YpOKCRpPTdF36VC0eDA0Pcs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.a443c507_1537553334869_0.42283373639941413"},"_hasShrinkwrap":false},"0.13.0-alpha.858a6118":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.858a6118","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.858a6118","dist":{"shasum":"60c14092d59ae91ab2597749fdca374b5b44e2cb","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.858a6118.tgz","integrity":"sha512-CI6MoDi8adzNobSXV9utqQdSsEgMiZBhgJx9Dx0PfhHAoS7e5UFCyljSIlkBd472ShC9VeXpiJdHREXt2e/DCA==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbpdseCRA9TVsSAnZWagAASJoP/iVVg+vw0jbYr0ObD5tg\nuU3tKrkUWFIS4hIKmexsrKb1y05/xAU5V4w0gvlDpBviJTXTDHzEiseRfAc5\n6frZgQlyFxMtBtEvFqW5pM7gX0X/imJBEkNjU73pdxVbXoz9vffHdvqb8rE4\nhcmxZ9bhM597PK9TCqBRwFOPSgkyTq/Kcpek/bDmoX1xZag/grO760dGCg3A\nPtnGcPDLofDDncm0ZFiwdVyrEExe7Gs25nPODf3ZbTZ6AH+f4h2JtBC48HdW\n5GMQWiw83/WxCG2xCTtW5OQ9WEGSz4/1+RLhmhJgl8giBfDaJhbk/TxzieLh\n8j42HJCrHld+jL4zXDEEREDy+IinXqY/1WuAFI/nYMC+OGALeDg/5gGtopD6\n4mNhXFOFBJ9mAoV69xDBJXwV+STSRcJtYvddG+Hz1ph/pRpBYXw/1ERNzZCg\n/7GgAlJSpi3Be1Hq/dtRmbimZ7QjN30REEwbQg/fnt01+K3Yz9P5sj0Tk7vV\no0LYb+zvCEtB6eeMa5nvHTvXSMGzYjkwLmrTra/qPVOJvVExwgN5MubkZQe+\nMvBg/5NZ2NG4xnH+xtzhQTw4Xq6rBW+JGvCnkoefVDzGEykTEWhdR55Zd5hH\nb5NwimSD9iWu0CncgECL6za7EueVL/Hes18RzQWgVePFyFloMsvqxIXNvot+\nbN1F\r\n=SSZP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuiTYdqGcSWD3EEKOFwkv+SWyr+vdJucfPVL5qeY6mJQIgUdyCOiox90FSiDMNhrPIqh5/uKjmKQnpg1vXIXVeNKo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.858a6118_1537596190033_0.5612145527793386"},"_hasShrinkwrap":false},"0.13.0-alpha.af122dac":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.af122dac","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.af122dac","dist":{"shasum":"b657a45c0fdcff6feba2c4801f745472591f1ff4","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.af122dac.tgz","integrity":"sha512-IYBHVFF2sQ/soccFtjA9XbIVsLQXY11kK9rWK9wZYAY5wZrqmaOhxfrckMSZCmuUPKK/EPw+lRm5ezrSb4T/vQ==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbp1jzCRA9TVsSAnZWagAAVm8P/12mvcDm8wotgOk8M03X\nU+HdEyF3PzZuw265h+agY/tADAYbLtl/ChzUS4HBdC6M6i/R8UGZ38gcLC+0\nNF826wCWiOXBrBRVGjJ02IMEJUxrtIwNfuEOEGUf7738D10//wxrQAeRcHSS\n3Sh3lcgUILTZEvdo0Ig4+PsBl/jZmlVpBs1qvVFz8ttFKF73317JQGMqHmQ2\n8Ox7D3StRVNAAve+sF581ewPZnoC4jffmQYAtWLr5UPQ+PWo67aR/58pXQag\nJQhs04m0dlQKPY3647DiaLPQNebb7MEPfAx4v+vlSg2svzSqN9GONg2xAWBk\ndaSso2OWesfY05/332+3dwYeF1K23hFbqO5IlMHO0OpQJ8wRBnXXbrTR6qtu\nbzOAbAmlllRqTthGNShB9/ZSdYUFxTKkXntFgVa0lNR9URXC5HDxfbUOGcFX\n+KmYMLY7yhLiK/Rh/XIH0GIYXFzRmfDyyveiams6rS7TEH0dVr1tbnEvpAPi\n9/XNW0F47ujSbbFwgY47J1IIH80pJocIOPljBRhLjsBS2jwnFKVcxqsiB166\ndR4YF/1KXX6qJqt+xk5txvm+aaG7IN4iPLBP+E185XA9zC+1cu/t5xO1fZAd\nh6WwkorkNx3ozar83U3Dc2TMJ71GcwvSvr560O9Dc0lIelE9jWqmuZdeM5FG\nx2a4\r\n=kchH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICOCwcSVLqB7C8ZlSWg3QWGTSZvv4Dojg7rJklpu0o7WAiEAspdIDzgjxV6gClr7UF8KGhyr6+tjKLCbISZJP/WRt/E="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.af122dac_1537693938348_0.14793241131317303"},"_hasShrinkwrap":false},"0.13.0-alpha.58a29468":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.58a29468","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.58a29468","dist":{"shasum":"10cded749c6a2195bbd22b7f2c1d60f277d113e9","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.58a29468.tgz","integrity":"sha512-/VJBE/1YCTLW3wxD4jwiN7c42rd0wDTg7jdZ2UeP3lxpV98B1ql0ZgeKIceXMzweGBFQDMtNZADG5NwtIQj5IQ==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqS64CRA9TVsSAnZWagAAna4P/jLnz9OLsLp9q58pBdrt\nHXD/dmArV2gY4oh0LyZeYI1GNHEJJUJCima3WBVFr4Quxl2Y9gWmy9nV61ff\nEsXT9fABM2mR/GEOU0KeC87F4YCPGa+aIN4NAqYfzSE+N9eJgsGWxWk9u7h4\ne+CmGia7awjlIn6AfcW9kPxvRsDzPMX4Jcy3YqWSK5f+yJLV5LuaytZuPaQl\n48uGcbE1eg5lDI6rzzmASKjQE42lMPiYAKb6N9joXRNP5MzNZfn9xDLw6iSl\noZ52NFtmbyu5hc1mZypXtkOBW4QuZBgG0jJ76Pn3gsDwnmXk/+4We1m7VBPw\nu+Us12qZy3QFKPRL1/DapIcFZH2Clkqo9phQ38bjoI43xX8gqcMru76oGigO\nWG2D/EN5OvKXOkrr/N9bmoiENTS94Yi5BFWQpuHge/4AJ/e64kz4d90trlsq\nunNgfZEIOYJKFyopf/7+pzYdoRmPNc+WGTGqFxXl/bcZDSVQPLr71rIzLL/B\n6+mTMRFIV+afeZCuXm6dsRlYUJtdGCWjPAxjoYFIopQe2Ib2pobFb1/5c1AQ\n+sb5dlOKTSNVyKP5cK3CbwcJNeN4EeXw/ScKYrGlhlCQ40Xz1H9X+bYIZ5zK\nOZM6sADWR6q1xVRCCub1yTjjQGaYJyF4cm1HdXUi4D9U+KBLiFLwdwGyRty8\n2STx\r\n=HO9e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+QQi0G/6NxmpPSv4lL/+6nlyyAAARZFYQiOyxlSMWpQIhAKynsKeArMMhBlFYCe7l1kyxjTCXWAdaUDKxPM9TKfTc"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.58a29468_1537814199321_0.6875870400744981"},"_hasShrinkwrap":false},"0.13.0-alpha.e638478f":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.e638478f","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.e638478f","dist":{"shasum":"c75cc46950829dc2fe2816fc09e89701875708eb","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.e638478f.tgz","integrity":"sha512-FSDvuP2ZmZl2JmDcG9T+u+AHkYaftET+GfJ31uX1WfGW8fM6ztAh4Us6k3cbyN1InD9F1nuHw12VIXz9VEvZeg==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqUlQCRA9TVsSAnZWagAAk6IP/A+dDJ0PkxZTnQLpfeKV\n2DUpBWP0yllLZ1H3nfJhj5GZ/OPLRw13EQcBPYyzKfpqW5DIWOP5Fy7ZludB\nNODGCiQEVcQNgYypHN97nQpEVPEoFI3yEPc8Aa97iUiHevpvtRsuXUc2sjzP\nx6nG1UXSfMe3xSQpm1zEYk+uRlSwJZTunAIERrHsS2WpJj1EYFJX0ta0AhW+\nklx298hHjZt+fUeyjHDxQ1cYqrdHAy7GqTgNeTQEboc8XzZsttIb0GKxeJex\ntPAgJ/aNPSQeLODjQsjcCd/J7sYNBYMbLuu+vdjPrzIccqaiCwVp/m9Si/bA\n2DLy+f/+O9mxeZMJLFKxeTVUnmjF0nrbJjLJ/UX+Kbwl5CGqCoeaFX4VuPZW\nj3dW2Ouzjy+wCw8x3RR02CHgOvYD7NX09FnyWIjzNNgsAH4pTzD7jMj2wS12\n5bww1KsSdgGJqRCbv3AbvM5TQYVk08mVZTwCrA17YOr1AKTjDqG1t1ECKJb9\nWqtopnzA+nYBMSKyL690kW0T93WHhjAtbkMh1zQnFU8X/vx2F6XNuBue29Nt\nntohc906ZjFjJYMtlfr+UbIRbZYiuof34C7BZwqYp5Re/i5QVfF5WD6nuSIW\nHRqhiU/GoOVRqpU8u5T3YbggBf1bckMtHRMv4FVlDzzbO0dr0jaDn4UE83Sc\nKmyn\r\n=OOo7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE3h05saILa80scw3MuUuTBX0OtU0QfEbMqZ/rnY6MeUAiEA6RyxLh1+2f6UEa3iM6TeyXheS/ta8X9kaNmLRnpZVdI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.e638478f_1537821007993_0.9170764874220565"},"_hasShrinkwrap":false},"0.13.0-alpha.45453f11":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.45453f11","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.20.0","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.45453f11","dist":{"shasum":"64beda298098bff04b7e717865ea902020ecfc48","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.45453f11.tgz","integrity":"sha512-jVePOGgqQUR8R3EQHHbmhAc97FGcmwkGMmw9GuWOBb0v0KFViRrvy6pumzQJab7trfBWbIGvNCB9ODYJjyF3vw==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqeNXCRA9TVsSAnZWagAAJisP/3aGOZiYp5KBWJZL+mhL\n+vMFjVcX41sHrtvE3ze3duUl2mwcFC55qiC86ePq6zvbNwrD/iDd9zktZ+bC\noNthd7TI0YwE2gHLcog8gqizsvOZDfi+Q23LtD9ZfOu5oRxF2ZBWvKX2nFKu\ni93tHn7fdL7wCceRNgCU0b9xPAWDhfm1jjX3i3NSJTyKgA+faswosERl9+SE\nzgAq/4T4uBHzpGcQp1XND7VxlnnuFuaG1O1NdfTEpp8mrJkAIMWXrXZjdVBx\nzrCf/b31Y2Qj9IW0eaq7lyDaEcExGnfn1pZSGqlGr09D7TA3uvRvHMd4PqVi\nlTaAbbzQd/zTN/UuAEdZfpxg9e6pQsq8Y868qEpQhWenvfeXlkXFWg61dpO3\ng4Fn3MzbMpBJ2eVzeKMLs0Z/RYxfCh6eH4PgIPtRK3PCC5Calt0BklfBkhte\nn7Cyo+iFxl0Yabs3wgvsJs+OD5cIv45pB9ayKFkfiCUIp1tCMivm2yy0SQfh\n+aM28j8JeSIByQa5+ngzJvBmhJh3CVmkzNB8jLn4roksdrfIMJxDHjiJ0D+5\nNiCya2J6pG17ORZsh+zoEkzlLPkto/BfN7pKwuQM6idL3tPgVjB6ec/Drr9A\naTLShs/mFJP1x90h2l9z27g2CxE+pxDWGPexQv3bgbun/zvDkKRMyzSuufq6\nuE8w\r\n=gW/V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCN6/QC0fXMzAvHETopnNMDnEXl/bVf+jrCBM5V/giZZwIhAMHkVCySqDu4CBOkI+DRy4ABALG9F8+IT4I8SEHSKK/4"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.45453f11_1537860438827_0.6221890542782997"},"_hasShrinkwrap":false},"0.13.0-alpha.7cc1881f":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.7cc1881f","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.7cc1881f","dist":{"shasum":"46a25df8cb4741202a1595712ec4ccfa63d33935","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.7cc1881f.tgz","integrity":"sha512-eZFfJ01fYPdc1QZtWNbMypyTKbi6V3x+RqIUhCsUAhlQnCO5UifXi1JFqtUCeH2Z+mFXscAwK71iL+5xalQ78Q==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqffLCRA9TVsSAnZWagAATIwP/3rnIwBBIqno9tLg30Bp\nKw1HpOHQF9dX7UiYVRKm8l4lySAfBvEXAQCUOSGoRDD/wu13JTwIBfMu/2+K\nRTLT25Nyy1hk64uV3gHzFqegcBtPfyvVIkgKViyELdgEx6lYly+hdJ6Wygui\nrBWM5bKkt9Mr5RjH9nJKi5pdxpsP16qw+VZKKn1gJCqxpvZbS0Qn4QN1F0W2\nVFUfOR4VUhdL+3BFv449uTPC9gK7N2FxfQJKL/4fRRnseV6ULui6BWXv1Hfr\nP9y1QqnAe6GGgSUwseYIbEPyhLC4FjmJgiV41hdS+rB5SgoRuba6VSOBpofu\nX2HkVv3NhuLVixATKB9IRskaXZ3fN0WmyU0L1tueac3d8WZEs6+kZSeXd3Xr\nBjcRF/LdKF/1S0T1mfYR13z7KIvoZ18A8txbQCrfVAaT3O5sRmnAPHa4vm7G\nJPPyVERAmU3wWNAx5C+9RhK8IJkTKkto621kKHqcTjBZqoLk/3qEFnqNIGXI\nujapQ+fE+hQXwLqI+lpJYnNhJSvjAqWxxxVniNyBPl5EbXcJGlUOtAFtt65e\n4/U7X2FNp2mpOzUhbWNtjAZ33OGHmsYD0zEPw4ZCMyp8MdxKwVx+p8d3+lVi\n3WXi1brBvyEfUQ9yhHKdgvcHi6AbPlYk36LePjl22etqo/zH5iQpXssmZKjF\njcdf\r\n=bHiY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB3erTcMTDooTRqFEbnqE8Cpcuw36ISdr2sKwH6gOlJGAiEAmU3stZpf+PyJHtIIfpHGbvyXoJ8Bu8bC522uDLgsYe8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.7cc1881f_1537865674897_0.865234207583639"},"_hasShrinkwrap":false},"0.13.0-alpha.c71ee1d3":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.c71ee1d3","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.c71ee1d3","dist":{"shasum":"03ebcac0e136befa8240e18c975f2f9e9a3529d1","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.c71ee1d3.tgz","integrity":"sha512-H2nA3xTV8oGqI4B4Nus42wvxAI1QFME08CmNqktMNutgyLDkjL3y8J3Siin8XYAyh/8rDuuicatErsYX+ML1Xw==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqffpCRA9TVsSAnZWagAAy8UP/3OCJSRLvPpeauqInT99\nostjw9zHOPMJ4Ih6EAzqVUwiNBpqcgniUqEo2N/ETXcVklG8AEvCFK4Q/nPQ\nbCfOwB0INWN/QpwBPwiDCmhtDL/GJFUVT74E8LmJiBl5Pf9zwZ5unzr2qamg\nglb4DcLXWWl1jOchQA3CcxSbNBzMx5ITiWViqaNqXVJUOAM2qBIwXiLKm2Lt\nzUGi6ESMzqJZZfcJzYvPQvV2JFPCISS8fw3WCQ1G80lCnUsSURjfaY28g1R/\nUhRrcJUfHW/AcOVoeofj91Q41wxMz4xDG7dmWE0ifW9SV/RwijQ4LVlQK2f5\n3ZzNMEpEp0YkoOC8nl7nXzgRX6TDLMdpRv9JVKGnxz0WhdCJWdj4hbb/cm13\nWSpzSzfbRxnksiSa7i01hpNSN4ojDEHdYJTpNV5avRxcadMnXPX3UZ8uzch4\nMa3eoSBgx6c3YyL+0+aGuQ/MNP4OA27JeJnU7NPSe9G3IEuTYLK8tXJEV4ZR\nfDbBmWhRwwwDXp7b8TEl2NloVvRQIigzNS+RBLAm1e6PnHn2jwEGFSCAF9Ka\nIhSZ3/opZqqQmqlE9RdswRhf20t/iqZxvYBG8Ib1sNpbDPKT5OcCOkFFDAWu\nnM2VYwE8sBMSTjE/qptJxDxZJz9sAi0E7dDNwLFza72ALtbW/RRwG1TLlSjz\n4NzK\r\n=xKba\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRnNuu9cn20w/4egUXy14D4MFFmFLzAxBxtmpbUOiMowIhAIiiDALzfWvymVS/IffcuCOSTVffiC0gZU0X5H7ylBez"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.c71ee1d3_1537865704550_0.34915391156539766"},"_hasShrinkwrap":false},"0.12.6":{"name":"codegen-templates-scripts","version":"0.12.6","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.12.6","dist":{"shasum":"88cc85a6bcb224245e1b72d554b6b0dff3383457","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.12.6.tgz","integrity":"sha512-UB4F93V0NbBdvKKL9WYBMFn6Q/8EjmBulMfbb1QP4u6wb4NoZL4Cio0KB8tJbpHFmSUSHHg0R1adu42Bn8pXvQ==","fileCount":22,"unpackedSize":17466,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqfiTCRA9TVsSAnZWagAAUmQP/A1LowwlSxe4ypCBMBz6\n4Tqa/0V4EzH/fDG0FuTNmkBwUyjtRzsK/fX2KjoiVwoJNJVxU+2CJ5e6JwPL\nAKhoyq5DMO+JnZj9dKP00yLi6Zw04l+X7HvIwerfpuf9PZihWDTOl9j9WAGj\nAdkyQYsd8TX0lAXb+2J7ufeomaULsKAtbJSvB8lGthjKvgHlUWZQ/RBvLlpT\nxc87C68yloKACfBynMA+l4BTIF0lt771CZ4OZDXZYfbD1cvR7pUyrJEV2KeC\nhTdMuh+pxX6heVi8J9g3T0hviRdN3UOVmSaJRFI0yajx23A0rPC0r+RxQqaX\nVWRCMKoDtqMhtH+k1Xi7KGRXzzxvpkQICyPA0AayBFVRsBvBJMKu/aV5mBL8\naQGH8XpH065BQvoB1McUqroSGxrTEQSWPgQlqoPEd04IBObrPC4rMb+ZPdz0\nQWBjxoyAABZ1OPSEsW9ZUXPSbxBeSO0UA9Imq4sYNZSnn72ZVB4R51BjXwz3\nMUrHAn/zB9PftUL1FrdT1FNHggyt49P3tI84yaAdqp52IQ0EVcWJXkpzUTPn\nIyGD9LL2g9wvxdPV0MiPctd/KtsGXOyXUEURc3x4y8Ifrj7Nn+y/YHJTm0uj\nzF2shWNA15sEGpdhSMaxhDwS4a/Hu0pjTN5A2CCjdu2igvQlqJPNqMwgzP24\nAb4B\r\n=UVJg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqD1QA+9BIJkeJZL1o3pDIf7xKDssIca3oIydHqiha5gIhAIDofOyRYobDQQ5OqH4Wr8kjd05qMhM9C+9EwDXcZ36l"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"kamilkisiela","email":"kamil.kisiela@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.12.6_1537865874490_0.8565266082189706"},"_hasShrinkwrap":false},"0.13.0-alpha.19dcc773":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.19dcc773","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.19dcc773","dist":{"shasum":"3e5cf693a2eef3ac7ddfc7e16a66586d25975a06","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.19dcc773.tgz","integrity":"sha512-Hb36Fy4ZxXTzbrTJvz51HoA5FjuoBpUhxlGIHwnjWeD4yf3/zaJp2bqJtI6GPGzW7YYElgwNcs6o6rZTP1T4IQ==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqfk8CRA9TVsSAnZWagAAgIgP/3kngWINo7R4Pwb8rIhz\n8yf9PeSpchnQyaFjKAWqjIZm7lvFpgYyBFC2rK9CIb/TvOMnoYWvRDRMPqjK\n5vPW/BjyqWQOvJa4LvDRJrG2we6JQZ8a45h3DR+lCZBwbRs9HqqP/nF4lhvz\nFKMR91mw3b6d5cT4+HNS1lPkrFhPZQHfCA2c/acG8iEnAYphYY+vdXNQ3XwP\ni+FdBWbWD4gWV7PFS8n7CJfbdKj+/FclQMXoUt9XoJk9SgYi6yA3T23Gh7TO\n7C7ngkvxUEEbE/Wp4/UOp0KnvVwIjC/9eGga6R6OvwOuwtVsFgGwXnl1F49f\n5sQtYVFtAwuNLjgOKMMvSb3AX94jtdVTOQkOM6m5F9jfuskl3aNXpU4clHY9\n1q3UxMfpRX1RfRO4MvFNa1AnXVhg3Fzc26V9Plal4c/gF8StGxyhIToe5jMh\n6rp8LwwRbIYXBE/V7JFWtxKiAq+yp8iJ4wWAGjE750m2xfLmKA6DNoUSPYBE\nh5y6Pa7plNCtu3zynk6jxTN5ONWnf9k4nf/bGvl5qd02y60A7D7NauaKji4s\nU8RKZds9x1dhAYxb4tF/NscM+qeyWwSfxGi2eCxFRcrltUbIfAf0Lknefnfn\nUCmYEwdP0KhX1LH6D6RFpxCt0ItYHYa+xZYzNEgtdPxstSme+ZPTR4QSW+HX\nmXQh\r\n=3wYe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDO4bAld7ZzSo6VRYB37dOuChutZNtqD1+Lk+WAG7l6OAiB38xArAbjwqL7grWKm8jYhRmZfQwlnCSoXnYnM2/C2Cg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.19dcc773_1537866043975_0.17219451502748817"},"_hasShrinkwrap":false},"0.13.0-alpha.b1595fb4":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.b1595fb4","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.b1595fb4","dist":{"shasum":"e43939bfa84c5a3a93f6e88cfa9580a6c2fc3dd1","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.b1595fb4.tgz","integrity":"sha512-kBxZwFDbOFIexhK7/iWKVSDV+hmw4koF0iMSWdo5Ybp2QRJehHV1++/azejry0tESFkHk0zo/6aBpJbxysUJKQ==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqhY/CRA9TVsSAnZWagAADnsP/iD8FqddWTZC3lWkU6s1\nw8y/V+mJ5uUYxWUO1HZ1bwYzz7Zk8cgNegsybMVqTQmHsQTmjHauXIKNBaS0\nsZKqV8PuV3eH2K6Au4zQRgavboUJ5rxYz4TXf625qQvnZC6oCM4AHssg3hZM\nxF7r9idYAXc1j7qx6fDDEdsauzrUCoMjVj0Cp3+sIsuqI4L08fucPESgiuXR\nt2XP2qFmU8NzbIaSG8l5AseECdrbO+Hrgr2vojSrkovgErBkUPIE585tK5A7\n9falVZUGnz8eXuwfRXnOh/V0LPNzHsigwmiNBOOrqkC2ju6TCsK07N11osda\ndVnDTlDzQMDlciIAO8rub1WefNZaqag0ZWKLtO2C6vTZjJUFT0IEYWowvpPX\ntfgbTTyaol4Cg/TH8mvDUkxPeg9cc9TzxcVzUqH4MtYApnOsZ+V+zEyz6DBy\nLzU2yKs4FnZRwgcgfPRVs/KIfKm/rrixWHB76/IQQ59PeMPP+l0BHr0RN67W\nh48GVvx6TadvtlSc9f1NLlq3DkKaRWjD+KALUFusZyqo8WcaskSUUDRYuXHE\nEWtVbJfdOvge2qPfqq4vH63pMDp35LfqufQlGpnfttbjLsZ0VXK8Hl5Lqf9w\nEH3aNQFEeLseSylKITOoo0TOnSH2Q8d8WGariQ8+3gBczNC5Hu70qf8YOaBI\nPnVB\r\n=FVYG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZ2yDRTrc/B3dwPKmB8/BYTDIcbQI7faNYSDF/I7v0SAIhAMy1fucRpHjHqIShXcmvQztyDbrR2U7Va2IE9yVm5QUb"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.b1595fb4_1537873471013_0.6951574066735504"},"_hasShrinkwrap":false},"0.13.0-alpha.ecaa5be9":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.ecaa5be9","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.20.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.ecaa5be9","dist":{"shasum":"cbcb94fc7440ba82bfc96cf985d2d3cb77100c55","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.ecaa5be9.tgz","integrity":"sha512-dgHflQvHmfH5QFCUGYWrZf5ibYlftUO/np2jzUC1bAAPAsPqr1E2u9JPpGr9GMqyrsaXNWOePAXIUPn9mmxRFA==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqjqbCRA9TVsSAnZWagAA5P8QAIzywDE82vCOSWvRfojV\nMP9j0278kT5qNBjr9mf4MxMLZ4n6jhfwQi2u6a7S1wZNJqAmBrCDxK4iS6Gf\nvCTcWxYQ7iLNdycyr+m0agKbrPyWx7WRqhxwNShtG3uYJyMQ2FQRbZ+XY3m+\nPwEai9IWvUQZLPkEf+276tMItyYxYlB+0D9Rg1U9ATUakeSpeBFWSJZJtdcv\ng65TnH+K0RcamYFGfriixlhjhFl2BzJFjudRUiTtg6Jnj9kbwDGlZYQrkyEh\nDRqV6Tw7ab371/i7/uFyWNUAOYtSKjYf56kvSNGwvcQO9klqsFFMALEKnMwj\nz9ouurspIMEh/nRLxKgfPFIBF93nnwuPMZ44JZJjTIzd0jclxmhSGB0nEOpQ\njTg0qr+AVs1dW97z7F9vn6rpEml4sXIt4mArQ5tBC6walo9NZXG6/V3RKkbi\nW/YCurZVBpIqgcwZNnF8s8NmOT7lHDNNnCZoYpwAOkgcXjf/yQOC40IpZEtd\nMJsu2AoKd9ewolyfz5Ayl+jvU9crfC6oqmBMDkAQzpFHywbFFB07OKXbP1xb\n1fcdoPRsuzVEgMUKnMf593LCsgT6HeUjRSPX+wTOzLcV9QuV4FTHN6hvsMJO\n67Eohczxc+mL/jrM0GyOJVtHYweJsj0njz5tZdvOCTv0sYW6PotIOc5dqS7P\nEaty\r\n=QT/x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1l+xt6aNtPMlQwTf88GS1ijhRl0688MEeziBw5gtX4AIgbPRqLNZ0CprRTqNlReMdMzRbX6c9IzpQLwgZxFzlqtI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.ecaa5be9_1537882778542_0.7795026838461172"},"_hasShrinkwrap":false},"0.13.0-alpha.04fc18f1":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.04fc18f1","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.20.2","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.04fc18f1","dist":{"shasum":"ed1579965950172d246b51451ad2306df9dbae9d","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.04fc18f1.tgz","integrity":"sha512-TkgV59Dw22Wkcfk3Q4dXmsOTAgpr2R4O4YeRrmSH9+a7Bq/qk1Z1CXXRS8ABhz6CHDrukQS2Q52IL97pLSHOqQ==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqp7bCRA9TVsSAnZWagAAfO4P/Rytk7DfLxrGv65WwXYq\nd9wUSKWaEZFdi4r9jwRm7O48+D3giabXm1TxF2bqbdbAAgRqE2SmuhuPJdmV\nlMNTd7UOlPW/cIFIQeAuMF71GeR7A4AKyPU+CcqCTef3A8/NRadjl/1B+3e1\nhz48CIxe/VVYFRZH2U0SlKOKpMy1HX3tvIJCcWLAhb1hpnGYiKxRam6HGctw\nv+6UzVJrEPEz9OsII8sk4wEvH8fqvlX0H2Y/Z272IY9sNH7IdBZZDTNtpt+7\nrJwy7WdW9BbewVSO5eo6N0WvGlDLfnGi8StXEx0Mujrh/5yEw4qWrK8UweOa\n6Twxgxv1tCz+mNGG07YhbrckJhw/+fAB2ZRLV6+EuyQP6cEf6qEgXE7X6zQm\nKm1ra8umW8DKd1lISt6us1NTSwWw+AOql4eZO96Ow57lj9eEHRo/vIQRbaZh\npBl0MW+5LxOSWl1hDEVsB8zTmJiZfYaIJ0uGXP57iuyDf0IG59XWmXlme4w4\nMhwbAUTzEqHBXfb5Y/VHF1VSYLaSXUr27Ino5e1cpIGQyhCGwm6AnSXn8Ook\n0pPEc50UbN/TxgfYvdj1BMB+oWdniCHLrFoprccPwrXn3P8zLoEIRB8ewkAF\nYnSFBbJxpr7VX8ZsGw1aQmooJAUC7NoxUhFUv0Tv/Vgnm2DIKPhZ9ia2Tzs7\nD/kj\r\n=yrEb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFuqwgaU3WiYKvQz4BYy48rJEB1mKJwVHbVtyWsCp4/pAiBEmdbS/jdYv2eHsKD74t+VBrnSiZ5CsiN0y3q3i2GnyA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.04fc18f1_1537908442653_0.6662360728378682"},"_hasShrinkwrap":false},"0.13.0-alpha.f20d2d35":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.f20d2d35","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.f20d2d35","dist":{"shasum":"f3255a3da95e30d0f4854a74149522e3154743fe","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.f20d2d35.tgz","integrity":"sha512-/5fAjEY46uG9lfI4+tEBF7t4H9w58VsX9zzNSbgo5NQ2ZBHbJV+FqxYJj4HABe+vLMfuGlaXTuFP+fmYuuLVZA==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqsnCCRA9TVsSAnZWagAA+WoQAIZJWepkHWLBXfgX++Og\n7e8iW372RhRKsF/YD0u/NXIVUcML4A6U+ZZBNhMhk1XbJD6yT5KiAPsd3vXq\n7wPD/uqfyrvvbzmNrs/e9lZHrY+sEo2RAXtx/Z12bqyy0Wgr/Pa4vuB52xk7\nhiHpchYDkTqR1ufiD7MXlLXv0+Yyq7pOlDaR3FWr9UyRfDHvK5VGycvY6yQE\nAa4+0UEoO6Sv5VYnDsZinWTX79DIYKFYX/jon7Ym7ZzExvz0B0EpfSSRkBfZ\nFXF3kY9+4hQVk5TrvlABLdvhUMgQVTYSqUsL+350E0ElVNXybRX/3+PRmsmX\n/qxJxlYg23EGUXSUIAcNZYCdB1jAr1nGqF+pkrfY48aspo0Q6YFod7P96neX\nn5OlWcqVipLMkxqkpm5Wu0clrrq8mFR76rS6rfsRHWeC3cN/LC4pRfhROwLQ\negMnLyTDs+ViDwnkiXF5/DeV5pdgHR5MpHe66VqHCHWHKKk6FvrDKXdpzEhg\nGAKvtQu3drYJAOKlkYq7QdLmC2GNG46r0Edx4VYrnT8fJE4T+1mOPR3mE0/v\nVIDi0iXHiMh99jdZ1OUGYZczDctM8Isf02JiRQaIYPmew5fMGTYanm8xRc/W\nnRwfX7fzOE37okY86psyAoUWHTjAhU6upl1FJDMifjrvAfA11MaBPWfQXwRQ\ndMw/\r\n=OJzz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD98e0c6zMBH6snI3iANlw9eWoY1D2mxZ4qPgVEjH6zYwIhAMlfdtwg+ARQJHwc+uC4kJEuP2sNbVe9jWg9GSaSOKs4"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.f20d2d35_1537919426124_0.951135427925216"},"_hasShrinkwrap":false},"0.13.0-alpha.5ede60b2":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.5ede60b2","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.5ede60b2","dist":{"shasum":"3634d77f0eeb5b78b68ddf6d9bc8aed1a66bab46","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.5ede60b2.tgz","integrity":"sha512-XeiiPMov0Ixw5mjKgcQNVwpmbP6pgKGg1+HPui0Hla41sYS4XycgrMhZi8qz0KJTyt+6i20c91uGHxWGdx1xZA==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqzACCRA9TVsSAnZWagAAfu8QAJ+oV8scoLXE2zS4Wf9N\nWAFPkm6p/3P2q69ysms49MEK/47txTSgxtStyXlHaqGNpH8KCch946IqadBk\n8Nq2eA9GmSeA+CGQBpcU6+wZ+WRGZnv1GHrVex0Fl6d+PlT6YDhlnytnCSuV\nh9H9RGi5GqdaoMIM/6BrPk8SKbAon5g3ihZCA4luq17nDlFl+tapvTy59V73\nEYnvH8YDgBeCVKCR2rdQhDyMzt/DbDOmCOi+Q94U6oRET9SLsSMIfm4R1ZQs\nbwN9bzIcWgKZX+Z79WrojI8KrRZ7Oce/KLFzwSZmebsb01tcMG3zVqn74Sn2\nRJWzeapT8t7k3D1DvwYsDBoebX9osJa80nolzVeb8UE/ngWj9WH0pq+9d+w+\nWLwvVA67RKZWGX0y0PrRoInzqkpL7x/kGg/L62FxMPuoFavoRdJ1vDURTXQn\nlQQKWJMP3N1EC1mg1iXOBN5z5WKb7tjwbK/d02tY0ZH3Y4qyqYP5bYiE9Lz/\n/3VwdHxXsgRhtp5yT2buPaaDD9QwhDJgmeOTmT+1fSU8Q/+qg//oZXwCCSZJ\ngredtMe8h63U/suAL6eOchpXHHKu8JZ+UZBuQ5eZee1b7CDGynkIc9Tfodkz\naRzT2kO+92cR+dwcyqaYWQX0usbqogtUwVjZhVPIEp65o6VgK1Qvmv5/yZrk\nzZJA\r\n=E+q7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWJlZmObR31ANb3EoBBMXyxPF7feAqsm1Agp7+h+kBaAIgAzLSzsXQ/MkE3O9L+VgvvHwAVkcDqGGDZ2xgmySct4M="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.5ede60b2_1537945602390_0.9484053883717791"},"_hasShrinkwrap":false},"0.13.0-alpha.7bc67d49":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.7bc67d49","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.7bc67d49","dist":{"shasum":"2abc65092552132c8af52ab01e35107b0364e3e3","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.7bc67d49.tgz","integrity":"sha512-9/YipE9tufuSlC/w2rpXlUo3dAORIs63vZmQ5csAvzJcV8EYxciblSA1jCcM+dt9+T1oLd7lN0vVy60ZA0HAHg==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbq0oWCRA9TVsSAnZWagAAAmkQAKJ0vxGr72LgPDAtCcNF\n1v+nyIS+XsRTbwVdm3VPEpPX4QUIr+L9pnZjeTWvdvjNBz3A8Lld2JIrf7Ti\neM2rKaWJ2OWmpKH2lIQovVJkgk77iSWVeYAp0Iphi0uwe4G/2VDtfg8LWFk5\n3j9pbl0BvqKp9OYlbwGKcojwAoFf22WyaowC8VCgvLCSF2h9VruMs0Ht14UN\nFW6WQkG6bvOXGyQOu960TSb2we5/nPYKSfszJK4AiXLyZIaidovtbj9SC5Uz\n8M0+esU8yyUscAJwxv4LDJ1bx9MVHDyj4/f2BCONG/nqwHULBmkzLLGlcLLb\nfA3aR8A8zy2iMJPrCesvlcVtQt/7HawTz5G3dWhjuFsk6ag3zLcEj0coaB/I\nmszmGo+1drbT/4FqKmeyQfuPbN0vR3hu9v69M35SOcSaRzi9AQ5I805+gVJ5\nIdw7LzGoLAdRFcrV3TnP9VYutPasW7tGI+PYqL3sKMoBgGCrLYxadr0S0Ks5\n5dbL1RJa/sBetd29DpOIB3ulIueFmrTMkTw7jkVeI3lGfZNWeAfOLHyjnAUq\niTuVgUQ2VprbdZFVnrQ+L7FCnUClaDZj9H6lfHf3+QbBQ2QfL8W9iRmFIXl0\nhlRp5wTg6f7l7uQiibP+g0mxezdmBcVXGd3MkMbofaWKlwGGG6DxJ9KyAYsH\nb7GA\r\n=c6+U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGh4kVICMovUKV5Sz898trn4MBCAm3Q7mPdMko/UTdBvAiAx4ItYDMXXjHZpE14J/E+yXoFvzhLGcgrkjUJfE+8mhg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.7bc67d49_1537952277846_0.6750668545075873"},"_hasShrinkwrap":false},"0.13.0-alpha.61708da9":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.61708da9","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.61708da9","dist":{"shasum":"ae68674fb0b4f6512a07889b49288b7d129d89a7","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.61708da9.tgz","integrity":"sha512-PWusWX2KkAYC8EzBoEsB/ZNwYxlmzYa58cMw4tHUCvn65LDOi0yqE7EqV9fJ/mkNT5nF54PeB/7krzZFV4vohw==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbrIWGCRA9TVsSAnZWagAAIUoP/3ww3TQaftrTHf3QvCgH\n/BvZ6SrTUwiTHN1/6NASNMFCz7yvwp+JSQYzBfWOf0px8d5tYXx7QLOb4e3i\nbZ5pEuuBHwj3nxG/xtDYdHa/dlNBg4mVv/rI/HqP7O88HnXJ/x47sC2zGcaD\nltJ+ml8s8BWvzDSCX+yGeMr77GpPNBbk/vUMZfOITS0QvcMqk9tvstiDMjiI\namjTkTyoRxfPCQGAopW5dw5zSl14Log2XcKQOqE7IffUBFkcGMDOHReRRyFV\nT6GfnJNG0Dc/wdgmBtTXPvAs2S2ypPwpuiyiu6DjeMaA/M5uOhTqroLvpvAh\nkxE8Xoo/ry/d64gFLJPTKZ7Oqh7PmrMIWBd8L+nQMz91oFjKMZStC/mWSqzx\nCIpIgmdLlfClsktK6k+Kfi4X0h3QBFUHbUxaKMWZN3L8qeTxW8jA1CNuqgUb\nXA/K4lSPw74k082PJTvFVSyv+wMvBDXYPE8jT8B2n0Y508pn0K6ilIVohvSO\nJudycdxzZV9q4sDjmZaj1dTp8J0wIITAzA4fd5BErZd7FjOzkVCW/OIErV3/\nYU9hwGw90GMqRKCEkX3FXlI7Uwubd/yY0lGopwe5hQ97mAK8igceshQv+2fG\nI4cGXaFPes+DAlT/nvqYoZ6MgYRPVSrXe0jJtuk/1kGmtXQtl4MGa5f+Sww1\ng4Eh\r\n=x7L8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGkSSGyAQVfFX5bOuYH7fhsw3wPgfGYS4uey74QXBgMAIgfNrdOL6cGDjPRcc4RkHDU8qZcotWmqY98SCMhjOr3No="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.61708da9_1538033030042_0.5341012698366079"},"_hasShrinkwrap":false},"0.13.0-alpha.77bc6e6b":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.77bc6e6b","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.77bc6e6b","dist":{"shasum":"737d9c67fe1f081f7898e9ac79997b06ab350607","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.77bc6e6b.tgz","integrity":"sha512-DC6QdJRYLjmHG5cvibhw8bxbyrLYih0hxXE6xgg8i1Kgdq7eiPbRr2p3ooDs5CHmqKilUPw4BmGSx0ux6dTAhA==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbrNHJCRA9TVsSAnZWagAAJiMQAILgbhRQHv0Jk0eulrho\nf6R0OzHdc+iWmAO0KXxoui2arpg2KVs9MgW1Nh4FGhsX0fV4mbv81xiR4q7i\n7mElOuuHljMwVF/jpGgQH3Ypwlko0F5SkIOl6NkF7V0XKQZSkx5XUQT/Ig4X\nFwzxKRQHMwlQmyyTsKy8St5/pemCykBUjtNPPpBsyr+cZJ7OXJf+d8ysYWER\nwSPtUJorcTQxMl4CLPhWrPiDaLEG76FUJL0nFWu8rMciRIhZVO9VVtYhw/Cu\nKI4gKxGVhGHdOxQggWQ8rM4Yjun/Z9fcP6rJzRBYg/M+0/7sWCqKgt1Xffs1\nBMtnyLZnqfdBRy50SI8gpFt60+G4h9hD48s2zmU0pGbKbcBctoBeXV6Tqh67\nXjpW1xzgb3kW4YmN+4DETXltfkVQ5NKJCZS/uCZX14U2r4NkPBJtz/oZRdBu\ntRWCqVO6wSsM6eKjmSnFz90ZAUGbXLigYzfsqdD7s8MVMgea2XyL3HJkQmGF\nDpBiDVIEecBD6IqF35MGTu8KGkikZK0vCRZVkfxfdVA1KeXynQOsq6zULnLU\nFoNMS0JOfiRFA/9OdDW/P3p1rDwQNEVN1vB4eThUJFc1afeJXFBb6B+g8jg8\nEnYkGFmbx7Nf81JIGHFHSZlRb4ZL1L8WFsxDY/bbujH+h1o6+OA+X0SqovR1\nzt7/\r\n=ReRO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICIDibiSEfsEJCs5tX8tBJ1L2y+GDHl1rx+ZLOjkvuaqAiAafCbdJuwGimctyEY7IrXkLRjc5Mh+SBVuK0fC76S4tg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.77bc6e6b_1538052552489_0.6640993585771251"},"_hasShrinkwrap":false},"0.13.0-alpha.3c236c15":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.3c236c15","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.3c236c15","dist":{"shasum":"e00a20d2cfb633f54a53eb4b40c33bcda22a33e1","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.3c236c15.tgz","integrity":"sha512-G1Ro3NaM2z3FMmQJ9mNcXB5CELR7s9YDk9WlLuDBHOdPdukBz0x+7Y57s7Rmm6/4UsVBmyiFWnuUBUgF0FIxbQ==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbrNTjCRA9TVsSAnZWagAAQiMP/R0x7xGMFI6m2I86+PEt\nf7mFwDl9NTTnkwg1UnEXhiWEhp7hfZPGNqxtcA7RvwC07GPvPXqdt6SeAGsi\n+FtpxxoF6ur8XWukhGliv3DGgWiADGAnqftyUfFfTHOEu0zZkvvqAT09oX/V\nC8diG+XEDgsxTJq390SvuGPKrLymYaqebjUn+mzfKgT/NomqO/VCjaoanrH6\npMIwOuJ2DMwsbkWfIQctRmEcqyAQY5Df5h2sIEGjUgyaI7LKcWc7QMSghLzk\nPM2pWT8cShRDEgsXasL5PPB+A+HJ1j4WKqtpaKqlClaDWa3jTbpKddasVswt\nj1HxXnQdDP53F2Xg3xp2y9zcSyeew9MlyKDrDuGHtaLSuGFKow1d3rQSM77r\nf4onaArnV40ubxA2mZCjsntaKlqHDWwbqT4XBCavH3pPV367Y1KKq6y2FOCc\nm1m2PHpm3qtCHQo7htIS1lf2xDURP1VK98oS78jmhisf5YM6EDGPhOcDBpw6\n9of9k0Mz51agoswJBTSaqT+FsU1+muiLq1K3l2ralzfIGfvhSlJariyHaORy\nm55307iZJkiI8V3rbn7C8wtuUpDnDP+fnz+LM/N39K9KoM5PH9r0ncMwztDj\ns+QF3AVfMEaTcWxQatYKOlrsoUgrtbHBnnMs+3PEZSZfsRFV3HCA3sOu92Kw\nFzAm\r\n=KNyL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBLughaDvAhax7CIP2KIpGwzFiPAhyIbao7Dcfv26g+PAiA3zigUClkpXfBrxvSKeJp3LS+FKmiY0WV7qlFmMWUikQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.3c236c15_1538053346655_0.17688014391295304"},"_hasShrinkwrap":false},"0.13.0-alpha.4e397e7b":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.4e397e7b","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.4e397e7b","dist":{"shasum":"851f2d28537bf629f99cb591c13d4d3a3242ed81","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.4e397e7b.tgz","integrity":"sha512-Jivyg4M6U4d7xYgDi8i/biGYWSN0zGC6w6PJppkhHqs7l1ue3Z1P28qMo5Wp+Hsmncyk7Ef4SuiqMCsvaWQkBg==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbrRiICRA9TVsSAnZWagAAElwQAI74Xths8L6AQpddOH/n\n85hUvpMXhy+hVS6nxbsR9C7SJ7y/qczOaAmhq3XNDKUVK1y/9L2PmnUCBEP+\nIJznuTeYM74Jr/mEc/3vCJCUHS1zRkQKTKTVV3iMRIeKpkH+NRcKIhVOIjnE\nDtIlYOXG9eFLk8Wmy8hKVi6ci5vIfix8IO8JQwXOLFaVQcBMBqYqafGYplJB\nPba8UduNSTjFIj4iu70sIX/tzCUWtJt29a+atEZCx3TNzZqp+Mtsp2xeyYkY\n3t5JGCQLS9ydwoaAlXQYBO219nJqeBu1rbGo8IgjxeB+7TLW6PTqfFjE0MSf\nECiUW1iHpOGCXGC55GfGtrl7kHbUIoS4D9N+83koX44XuLdg973xRbBjuNtf\n9j9qe794rnn+r30fDGuI2vaZcV3jwsRURUY8CPicEvD6Eg4s+VKt+9K1dtvz\nN/Jg6EuqQPdHXOOvrUw1yFb/l72UEt0Hf6MpVA09R6+pSWwEpeyNT/7n43uK\ngti5+DJe/YG5VxQDgFjV4TUYM8MW8eBEx/u4LiY1rNnj5J3CCcinla6LnQW+\nTC9mQKxNYt+yF6PV4BUV0VrFRmx0w6wxDGsaR2CnTEzRQ9Xk5tvK4X7gOEPf\nDDOVU3RuFTjFQgQB4/++f2qgYagW1TFeA9w6g4RYcUP1CiryHqHr5wiInk2S\nMA9z\r\n=3YXW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBvQ0+IeGDqUbjpxxKdqaLPJ2N4YNEpdfSIzG1tKPFJpAiBS1yhE0TFw/Vga1rB8pLcM7H9uRBq7WqpgosSFD+06dw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.4e397e7b_1538070663281_0.420224306865838"},"_hasShrinkwrap":false},"0.13.0-alpha.d0ab4cdb":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.d0ab4cdb","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.d0ab4cdb","dist":{"shasum":"8811237d627ebf2993883c4578ff55f88501ab2d","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.d0ab4cdb.tgz","integrity":"sha512-zMjP4MUVvzYu8w0FX17/k2X7K5QorbFRscPlHV31ZBw6OC2yYWYirhgqDYNecvYFfYCbeYSaZhLtpCTZRnZahA==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbrRioCRA9TVsSAnZWagAAGqsQAIpXRJdw0zWMZglTFFSY\notXS90BhDH8icjwa10HCp0NPJhuXp7BpRm8dETN3bMVkuhLwX/EadXiZG6MJ\n9U38rG3pVDKwN2wHUkfgTWX50ejppBGXFcYOcr+u6jw3PQnCCOk4w/nlYuFT\nGmLbH/jBC4+rX2BAfekBH88EJ2t6fACCP+739qLk9LGt9BhUekK6JWygSutK\nLgc7enuI9RI/AUJ67jOCrMPQ22W9WLjueABCXp1pWxF1W3cxRBjSk1S0syD0\nsN/eSBlfqhD8aju1uzWJGCq8DQyxG14mk4TJk/9j/g3sfEFrr3obcaiTXCTq\nTAqONyjg9qy/aEU5sgKtDYPCkHhRWr6D6+jdP4OlgR9hLNYf9koCp5p3n2k5\ndIvw2uBi/kX5uJqLGQedmflP0Co64pIYPS1Oml4Qefw5ay+FQnV4xJUIO9RC\nT3oeO4mTAAKTb8qD+YZxwAzgTqJRThEgGkjNUvonzLEBFazlxskGX/qiuLuP\nf7eYbFflgd5ki6/aiBoxR2fOU9qsj3kSDZEF/bjHBQqulffQX35vKf8cD5ZX\nWB8cYChK/Lj146kELlTLZzpsnmWZrS6Y0QKO7XeEofAuFUdHc82XSAf1JoCv\nv5hMMpAwPYtSDRAXxlt+6DXN/HQf5iBuTrIH3vxDZc/YrhWrOO125vnAn5Yb\nEm3u\r\n=YN2y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhrUasMh3rwS3RzWseoqxXApmAWoh29R3iMHKgrMmxAAIgcUQnrbK5CK69cq0STSwvaAOfYsGG4eUFWMyvdy0thJA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.d0ab4cdb_1538070695815_0.24825918968787586"},"_hasShrinkwrap":false},"0.13.0-alpha.3b142394":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.3b142394","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.3b142394","dist":{"shasum":"4fc80f95c7b51d929856c914fedec87fce5baf60","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.3b142394.tgz","integrity":"sha512-oFYGJSD8P1OhwylTDg/Jz7vmocAzyqQdHO5ZZOQ8328ywfJIptvBm8vyYnSrfUjayrGCazzcv8sA8yYE/LMadw==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbrqMzCRA9TVsSAnZWagAAwvUP/13uL/8rYtWB8AXeRjbD\n4t5f05XIP2UBRispcxTe+1E5wg/9NkjLLMhMPgF6VELS5MxrjheqG4M6ZOYY\ncwWu6uyQusbay8G4WbntNfgQ2JJXbdFtJyvVUY6lmCgN5SaYWszg18xxC57Z\nyzZY8HBMPa04+HHw2/CkGqPayRSMmSoSFMHvm3YrVNGapQnxffg2DFP+HIzI\ncNbrXSYWqF7AR3nuUrtf+gFilox3JYFYxw7YMowTLur4aS4WBeB0iFp+4PTE\nTNTXEUGM/NQfvTteHn9mJwnTyFPLHxy1eMFmUvihQ7tttVz6iupZQcmoLox0\nZRM3NDdUVBJh4Zc/Aak+GBvfA1VnY/UUk0dooO91xqO14BImE6lsWGO+M2wf\nEg6Bxd3wQFrQrZYKqvm3N1pR/Nz8gSRHjn8UKNkxuQHR4DiSlN0e8UX0etNP\ntrvGCfXYqcZakHBgCzgvf9E/Big2/8qpMypH2TvMqW2oI7i5PcBkt4ZYiesF\nuJFPBR+ydbBHfi9hNwvw+bacSldo3ShY1bLmJr4e4HmnlfyaPGZWnKUvYKi+\nWtFUlnQbpSsDDtfsiC4xMmawmmPKvBIveSN5SF/TWu3WKwSVTcC4x1xtVO00\nKxJEL1CJgeb/Bz5Rj+8J0k2DyZHqcVh/9rsmhiUQZB3Eixv+QFGrBvhSKXJx\n5wDC\r\n=/jBR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAhKO02sLO0zqI03si7lqV4Igpno/+YTB51tv+7xivJgIgPfhhx/6oYojkKCDu6Egc18EQIGHyI7fDnf7TjXxN3pE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.3b142394_1538171698426_0.8113765173355605"},"_hasShrinkwrap":false},"0.13.0-alpha.63e2a625":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.63e2a625","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.63e2a625","dist":{"shasum":"fde841d714917d83a45912b6a3fe7f9d135fe122","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.63e2a625.tgz","integrity":"sha512-gIiQ3n9l8J9Pjxj1NkgzsasglJ0R4k8ORfCas2lfVzAb0NaNYRKa+pAtBU+sOXZxwuKe3kXETfCFGpXHtqYnCA==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbr7T2CRA9TVsSAnZWagAAcVAP/0QyIZ+vrpznmCJzR1zv\nMvc2GRqpnYrs3y8qd63o0teY/orleZBmzErz4zOxUZFX4/EjSU3ZDhjH0moA\n9ncC83j2YAnin34WL2fTuS8PxBPVOy1XmnanTkhbpjh23wJHJGLygQu5k+Of\ndO+2r7fjdwP6ZjlBqYbQZ1LuDP23igqc3NhtRWg4+NR6LJWX3GDIp9OiDM1v\ntvMOFO40ikSEh2DrBWhZHEFY/tCwuDJgI4icRKqz1DIYn6ZfVFflCwWbyMx+\nrgkHyYvlSzd1Y7Sl+IcCndY+QxHC/WWP5ibRgDhfqLlMr6588ib61mKAiU5o\nF3juUmnN1LqIvBjdYJOYyb2KE2xr6iGw2i/eD86VQ+6vkkvSdIF0Q5vl88QS\nAoQN831dC6qaqfPxoehsJupU3Ugxljq/m5ywzhn7R2EG3Wzl2okpRQulh+jI\nGiojTNwFRltVNorKjD2xwgVSDWG7wFkUkrkzYnK2JTdFuDlbGe1pmZQWhghq\nkrWmN1I3YmO5SL55qs9q/NvpuV233N7jF5WZisfA295Yo7DU+NJbV/A0UK+M\n4D8RnLOb+gw7SdWQNfBWG4vdemQw/EqqntBr6LpWwhO+A4cGNJz41vO2tVA5\nxYLLGZFf6rRo9l11j4IkvdZJidvZ6mX8xl8KY3FvtowUacNy8J11gGqUBXkL\n8sjM\r\n=HUAm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEVUx33X7po4aHZf0gMjU6GSqryecNP+x/DdlHWL9cExAiEAsNrw0wBbnwLa/vExsw9Xq/Ff6iuTnabMtYieIJZ2wZ0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.63e2a625_1538241781716_0.8643965540409113"},"_hasShrinkwrap":false},"0.13.0-alpha.42633a9d":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.42633a9d","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.42633a9d","dist":{"shasum":"f5a3fe1e012883b29bbd6d9f4e2cf121908322d7","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.42633a9d.tgz","integrity":"sha512-ywoRNvYU6Urag1aw/q4lYk5MeX4qT+KwJq0g8pJP0oZNMJXU6i7R+g5nXO3VCiBhMuIT/SX2EE+zj6aIKerbhQ==","fileCount":22,"unpackedSize":17769,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbscLyCRA9TVsSAnZWagAAXaMP/Amf9VKHG1DClzej0KNc\nSK3I2GT+o/A4dZ614bsSHXfR2qMSbll30JMHC+WQ6AR89vK6hu8TK+Ly2gBy\nyNbOBNEEj0nCMWEjb+wDWYlcdWw1C1hYcVpT+KoP8Kn+eLG13jW2ydf+T+Fy\nWG5Bx20b67ZwODOi5jn/p+UiMWlBd2lbYQJqVnQkaZ+fQd1OzcxiawtqUCrg\nbwpunVOO8ueSdWOjUNozd009RGOzipF8VxhQlV7spQndZvPPChOPXL5Tnlqn\nD1gQKFedVvr1jxxyK+0yq9H2VN2MazfgLr0Ze+sSAj+ncjX32vN2ropHDAIF\nmSc8fEUHxgu2g3GkNgMmJ7HpNcQ4wopxQIUpOtfCEnTYn74BgSJGsjucQYHB\n63g/RUobbDb07rb7SzV9hiyxpTXr0LW5NzMRUvRZEFxWk3U7YJJ3eY1GACqY\ntLJg4dvHkzYdzXEOWt48Bb8Vt3DJ+XmCz5hVsLNVAAM5i3OzpP1p0XW14noM\nUgON2zegP8iIfv5INbOpgKpRzGLLf8i3T/iDN7wSh4bBrHPCDl0Ey80T0wON\nbHZrZjxIgAlNtulplfuvw9mMzvSrp5IlUIne/HKIlh5/Cwtp6gQihsqzJ2Ot\n3+d2l4xuefPYl7IrrgPDYxfLlBpzgx2ggyh4mOwZs8aaTQK14ko4EwpwY/hw\n9V5X\r\n=4wNz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQhBpGV6cn0F7rC7G7DGs7rjg4oi1IV/DcG2ajovv7MQIhAPBmvcjW3wbWMYu8B+2PZeiAUkmHdZ9UW9X0Ef8IP+zR"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.42633a9d_1538376433578_0.050014448219418695"},"_hasShrinkwrap":false},"0.13.0-alpha.c39ae4aa":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.c39ae4aa","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.c39ae4aa","dist":{"shasum":"d5fa153d3a060b3c54d7c150da55aa071597a090","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.c39ae4aa.tgz","integrity":"sha512-hWWfOt4RhCM0eCQB8ZUXEjnZgoBYKo+pvNql8CnQFJ29L1WOak/cMsXQnuqSY/FvmDz8e6ohQ3ZlYtJ0ztl11w==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbskq5CRA9TVsSAnZWagAAKpYP/iO12T+/GmEql7UQ6DbC\n9Tguw7oHmLNfH78dUeNKQt5uTt1zqipkaOWkwY+1OvALkAFCYLgLfObQBM0+\nThdBcO+rZepoOhSDPc7aoewLt2yTSfWSvUO+o7sEmJJc45NS7ZiFCSQFUqxu\n4ZSs/Yopez4dGvmqrew08HTqIHiFHFqLl8/vButg2nO5Qi6QUOGOEW/GI8hc\nGxbYStNFznKJcSbYZVwS4pqH6Mrw544g+p8QzIVDMg/2ZyjRD7x0McW/oI3Y\nUc3l1ats++5/f3eX1mFuVtjibJ9Q9MzPEsjB0gA9HE8gCZsnrgJu8iOF7DPt\n7KF8DwuvmzGPys6IMWcJXQbIglGMY6RtSf1emUbHGGEeFf49FWDmOL49W00f\nBCxgYYDATA4wDxfOyxaGXJePWMaaPDtw/kngwnGBFUhQxdoply1g+3zpt+BB\np29U8uAJQ2HyLVlzK3NEYvxlag0g3jNCGC0ye7BVjOS130Y2SCEdBDH/UMS4\ntxXBVw2U5ZPN3pQSSZf2wErcUJiohVOA8uHDDt0vAsHdnBJGI8QeJnbKtTmc\n/sS3q5HdnHkE+ngi5zJNr2r8pXQtoQgSLKPz2/w9YO3u3yDSyBI9ztUJWZ4b\nTaLuP+mMFe7RrNdhlb7JvZcFPw6LP5qOguiT4TbDAyTuvANIF37cXNGUaJzE\nx2Js\r\n=XFaD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCghi/jNc07m9dzsYK7Lb7lmqqHYxpS4iKJ5CqjAj8kXwIhAJBOjaw42kJkaYRA3nCLMLEyRwsoXShDX1a5stzUO3Fy"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.c39ae4aa_1538411192343_0.7099348856678724"},"_hasShrinkwrap":false},"0.13.0-alpha.f8bd9be4":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.f8bd9be4","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.f8bd9be4","dist":{"shasum":"b9a7f4abf3d8cdb37be6874fdd003b572bf2107a","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.f8bd9be4.tgz","integrity":"sha512-rg4VQI+ywCdAiHRPZMdgaH/ZijzpfpzXexvufM0bt7VsnmDucdGQL61SPV9Tj79LrksyuG/Jd6nxyKF7/2hlBQ==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbswuTCRA9TVsSAnZWagAAdz0QAJkrS6MYP1GsqNuESwa7\ntX6wjINYZlTCakBz8MnA19QZjmluJtaJtf0CvTJRO1pzE3YHY8ST6KOj4fpP\nzYUL244ynqIEN6RqvL4pNacsV5zue5NO8o/6fyxpD/YFhBiaIJQLhkxsJPOq\nohN0bf4RkF/4Fv+4x7iT4otBB5krdQtOGYWfwsP8/T1OsiwuIv4jafoXeEg5\nfdKXI2den8N/VOelovmCiymk86tSpp6l8aLorFCP35g4gU9nR4wuf7UfKNRZ\nrWF13xwzWxTyQQ14NDK5es1hpElIuiDdZ3jkD5u1AXiPs+wazjYrc47Ak/u6\n8K4cIYKoQZufL48HpyRlUX2ki3IGwVgsuxWlWiA0ah+nZGtCe1GCq85HYY3J\nW2zhlEpjTaPTYwWBmV/z2RGNanhz4li7Ok0xFmEJuxGhBd9akNwlOt9V9Rjn\nHmdsCuiGdIVO0S2ORKhe8Yi4LaVc+UX+tpPU/fHVD0nlyZEbkVxw+gI0KlwY\nFL2TeLmQFQmOA42c3X+z9+MHMluaxPHz9SnaahxkMFCBkJObG87ij707g+p0\niXBKE9ion8wYqE9AoagOOfAzurI7G/vlZfeVv5q53Y097W93/FfL8xR5GBhv\nHfRU3efT6AVeVGt9G8evGxJ3XKbeq3Ti9CoNodl9mO4qBpxhATC8mGCkV202\nLhvR\r\n=8V03\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGBsT6P5qxT4+ZxNImlO98HVhOeZ5JZxtgloWi08hubyAiA4CcJncJsa2BVrn9VX1CPKTACMT2pqglkdjtftqldNog=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.f8bd9be4_1538460562043_0.35835999234653304"},"_hasShrinkwrap":false},"0.13.0-alpha.7c74c32e":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.7c74c32e","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.7c74c32e","dist":{"shasum":"7dae3cf0967525c73d543349661cc0d7f71a8d4d","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.7c74c32e.tgz","integrity":"sha512-WLoknQO4M4znjHEJgG6QgpSjwBtJsD+8hn0WxmKraRBYj1QzBKtOEsynny91R9nQXLYr/0U05/F8dTsv6Q/PdQ==","fileCount":22,"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbsyLYCRA9TVsSAnZWagAAoQcQAICVWV3+x9Id5s55ocET\nHeQIqJhepdWa3mgG655PrPldAxJnfeZVo8rbzzQn/zZOEt2SlX3khN1YpgcQ\nAK2ZBtHQLCM9wjQy6QJngI/yyqT3G3oS5+k+wATZjRgY9tPcqLsUa4bIm7gm\nkzcmP0SQflRGHXKzK/UMks3DTrKYMBEtBrvDI9rXbYUrRt11WJE1qJ+HEOXI\n1YA6ogINT1+0DHTo/XnT2Y6GLUxIgyyI/Ccq8BYm/Dlp84JiTync2r7OHCz1\naz1nmO5O+IYmwfKJMuPclUGUIusCGZWJnM6mhlLBTFUB9CnNHLcM6tIYho9X\ngF4TZfvY/EHhQUIVbSbo2FT9nibKGPV5TLkxbaAKGQIDWQFek/vR9PfDlvab\nS1R0Tx2gb6Ix23PmBfqAifBhCExgtAb8v+jBvjv92nazXKquiq+maoWI/Ua5\nGLRR/XHgMHM66F0r3/LFAI82TyNZ238HwOSU35B3jLsU727Kl9aHIxAu2NbR\n4sd3WzALI/Rsbn5wvHlgK32KDifx0HCstKxb47ndVkQZFybSdHjjMqVI6MPN\n34g6M52ckiq2bNPMsezLxrK9/RKF05FrdnGV3t1XyXNIVlLwICvJfJ1jHzWD\n+jVPZ0XnhKiYPbjNvVPP83qbwHu+nIXJByGrO2TklnIOPpDHIzPhDnMhZepL\nAsny\r\n=SeHf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxLSh/9nCs6+tuaq8JD9jhrF50HZ/k1DCmj+MjgBRV4wIhANHgPotnTY+Acw99sJGaCF1iX/0BWKIP3ROz5755gbbZ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.7c74c32e_1538466520256_0.48531758262284574"},"_hasShrinkwrap":false},"0.13.0-alpha.ac5eb2a3":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.ac5eb2a3","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.ac5eb2a3","dist":{"shasum":"864dc7614961aa449a74045a284d71ca8d2ddb83","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.ac5eb2a3.tgz","integrity":"sha512-TLpe4X/vsvreYpwhZfqvP2IOj9kHwQ0Hj5MZxmH9ZDi/EVt7bgjGW9U6k+Rz7l+OpwEpBdVY06xn61kKUA+K9A==","fileCount":22,"unpackedSize":17769,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbsyLfCRA9TVsSAnZWagAA08sQAIqAAx0IfIdju4ZnfZgl\nIEckjufs5gm7Mbpm4fFqS0i/ttA2MkWbvEqLAK8P2LqTMtm0WGO+CvXfXFNk\ncFb8TRPCsUk+llm0R2OjWhM2/m0GiIhUAf642alIJIKh0ouL2hz4qP9BbjbH\nBlIa/CVK/aiwLsUo2BytTe9qaxvlbyHOe9IljouUVnUW+J0XbdHdrCqmx0fJ\nzGpQtOT0FRv3xldHQBcKMYa4D5NEgFA6+o3NTT/ZKVSaGcAdVJ5yd+ZL2ByC\n0znzJHC5yNr++QzbVK6gbREO5/df5VrjlXPfa1tJ5ziFSvyTWv/gMrMzE+y8\nZRQ3zxPaLKHtHk04kCXerM8BUDYk8sC75Z8iunPDMA95BRHh04LWt0eAO9Ck\nExGZhIFCz5nbyPkL+jCcbohGb6Jt1wESnXMiFA6dwIIxzVzYA1Sl9Qh9Oi7X\nSSip3xit4KIwyQyvioSIJQtTIyHoEQqxeu8Cg4hUrfpG6SsdrgcXajTugMBX\nxkizfWx3hzLQL4TD4W8gXLcZOOIut59AjfLbxCwJzyW6RKx5Ccp7DgcNNLu+\nGArWhv4GjBJnJgKMztftD4thtsXl+t3R8b9bKnXljCHAkZ40GC4L3YvxZ751\nnSZTjdM/+FSc7Rqz0SxC66INcMFYP6rSgFzlPu9l1BYrfypkAVjDUuuKxrQv\nsQ28\r\n=30wZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTSWC8x9l1Kt6qxwoe8bpyHs60d8/4w6j/oLmz3f1lpAIgQiRhGAc7czKlLXtXIpV9T4oAR3vdw71TS+n746xVQeM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.ac5eb2a3_1538466527143_0.8131198774839494"},"_hasShrinkwrap":false},"0.13.0-alpha.80fcd106":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.80fcd106","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.0.3","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.80fcd106","dist":{"shasum":"393c5cde57689823f1bcc9f02617c93cde735bd9","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.80fcd106.tgz","integrity":"sha512-RksFTSOC8Apxy++FMHvJj9gmqJPj4ZNj3wJLIg6p4b6M9fQM6ip+rd56kmnowAOm1VdQb5s1NnCMpxwf4H9/wg==","fileCount":22,"unpackedSize":17769,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbsyLsCRA9TVsSAnZWagAAKZ4P/jd5HdMzr7xlFtpd6y3q\nxOxX9OG3VaCs6S0GoW07a5wrUYPK+QcCoIUfgwf9anvHxPle/5pdC2mEkL9q\nyrFNcQmuCCIUk9wLaFEr37gZu5PYVAp+1y4clYNSAG4mU/3rPufHnbS0Xjgs\nwQRSjtW9o4o0hdiHe3KKuYaBW6c8dZZPDXmL0RSj8e7PU1ZYC58odGQnsbvq\n1LizcsJ9S2FCy7WVtTdEq5F8721JxwMw8kbQGTYXA9dee+Vtwt8MFICRTIjG\nslvgNL7B1Cz5W9D7KhIzCNJk+N4KfFXCnpH1rtDx/cEocUFXkugXMdERbbYB\nC5zIatcFpC/d5gcJI+VMJH+Xgl0BWO6cbFSSCY6E4j1/XlKXMGKe6itSj1tQ\nt/KOvfSC7Xd+qaK9kyjxQqwVaONCpG50gf4UgWr2zWZJwG7C3a5PQUyTcIv8\nrG3kK3j3Cxdvfj4s/eG5ZBSKJim98S5cjQd5SVLhIlxRc7HRbPNWtnN0CBRS\nFb2qN9AseQamNqX/RmLpU8KABbjgspeT6RujS7TYiMhwu9dsACqkQPViChd3\nQ9OYJzgUq6RKDekqzlfN5H5bLbnQb3s7O6oqOojUmiD+48nVa/FQCRZpMlhI\nydC2y7M4NqGSjgHev8nSmaQ9+zLX5Rxna+IkkIrThEAX9t4AO3oBAXk4UOsQ\nQZ7e\r\n=/vTF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFEuBKLrm0qvuamjcdXQ66kOi+Tci/FgXlcQ2O+jc+YmAiB26a37c7XRZcvAllIJCArGLP7JtnbrulXvpkWFBDOa3w=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.80fcd106_1538466539646_0.28499852675107373"},"_hasShrinkwrap":false},"0.13.0-alpha.4330c431":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.4330c431","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.4330c431","dist":{"shasum":"6ecad3ee40571be0b620d32153a990f72a4a1297","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.4330c431.tgz","integrity":"sha512-YXBpuShWeGlOWzRaxJ+BSt1GQzPKcF066x23QC+CYQ++eGXSi0voPDLsoCGcpTMll5gV+rwc7fvEcoldAhKPAA==","fileCount":22,"unpackedSize":17769,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbsyMsCRA9TVsSAnZWagAABnYP/RVrr7YIKJqil3afIB/I\ntCuaLodIDcsmyqV+7vk+FEJP7zf9yglV60av3gcrxzzVfMAmSWlFzkzNvTK4\nTbHPNKAlD42APU2FW+ePP+UOGc5D/rHx4FmfUpOs9HOL/+K9G8ScWh48tj/j\nl71kxuxbxIX6Jj2bnZA2Xcofy/2GCJTDA52mVmuqgxmpDEzohzlRUQN/mFYl\nm4y3crdZvbybtvKLxlKlkb+XruEsCyPQ3RHWApqn9i/cHuuOt8eeAqlp+uST\ndMiU5ezeKjCFfpRJSHTGNAKCAIA8AYH+9WK1gSH7PKXOahi7bhCNNs3jLu0p\nRc82sxFLs8lOmfMCh1sQyT5WBAzISV5dAUUaqJEC1Hv/dAfhScMVZu+EZKEh\n+5g3oa4Wx05AKO/QiB1zu0qb6Z0I/6ejIgWezGIVgYDO8SN38FQf4qF6DhBz\nGNHGeoigInXAa1k5ri80iLsgT8f1yMEHSJwkuaiaBVGa2RUhz/m1wm5yrLpF\nNoIMac/1n0TL38wgiJ/n/iKnb2alnuiXm0Vxz0WWqmTSEKWKnJRHgGULno6q\nvjD0gbhQqeCOfmPRefzJ0c1NAZ6pBGJ8SnxR1RN59gLszEJURgzcftf+e1+5\nUSDub3Bq8pMvHkz3OfZlJEOviTfTqq9RvuphEyrdBd9a2HFE3V1vz4QcSQ5v\nD2wd\r\n=5L8z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGr7g2lblemsQTveZbhVHm7xjVhEVWUUtUUJ+WjOsZuJAiEAxdmwKC4NOW4v2Yv2DNDg7XCmVcb3Znsf3rts91CbGbk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.4330c431_1538466604346_0.1468242859944362"},"_hasShrinkwrap":false},"0.13.0-alpha.9e0c7819":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.9e0c7819","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.9e0c7819","dist":{"shasum":"263b30d380416757a45f0e1ed456b45de299c741","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.9e0c7819.tgz","integrity":"sha512-hFFMTWBd1NyTziX4YyK187/YbcSx/HihmVBMp7DCXEr4+ROHvjIs+l8lhAU1fltGDuczDZuLjAgxy0mLQvfz1A==","fileCount":22,"unpackedSize":17769,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbsyOeCRA9TVsSAnZWagAAiTEQAJKb4E9+jdf9N2hCAmYO\np9Nuz7Ocl0my2n8sOuLzowuD34/Np6SuJJOU/Kb4S3MUU+SIEtWOEDN3PlRF\nJe+0d5JlWnP/RJRIiSzjesWrSqDO7mCNrskdTSizWxE9oDhq3MOd4x1bDRRz\nZlPzPcoboVzfHxM/CwAii4RKK9mr4uQb4ycSnsfxUDILEisv15WcrsIWPWfY\n+zQ4Bf9eeX2cD7VnQA57m+PzXuvFJN4OqV+X/H+53WLD7Ihfrp8W19Xrzjie\nnDMUQ93odN9L3Yn8Zz/8WuqKr4SUCw1AZgUjmlgDAMyrUWl/mAzXet6O8/E2\n9bqDgDpZIfSDTjrHrM8UJ+6Nhat+uoduFAqOGmD2Gt62Q3x8seec/+mxVfwa\n6iNEpgNOCV6UreeOnFB9VRg0LbuEiH7F1sTYtwPGXZ/9aaxAEeB1+DLHK/EZ\nXYEiS5VUMUARwGNwYRtlivWNhR/YvOxCgppL2OQbUEiSVmBAxViz1TEVUeE8\nv/J2+sTO1lEaVkMQ5OXM6ne2YLyG3XBaCUTz7vsRC3H/ftIGmedqfPYq3Kkq\n//roSOtD77Uq0ZFjTQbkmYQh72mF11obNSCc1so9k5fXskGjY9CM7bdLgIC2\n7AG3N5GnFymdgYwrlvaVS5RhKteC+tVffVD9uyBoEKO5paqttU7KhDH0FG0s\n/puO\r\n=WiBh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAHjzkt6iRFzumtFHFX6Ov134ksnHoT+NXSknoZpqV62AiAv4ej7xzzWDNox2woAJ+s7iPLVbiZGNV7n8gCoe4h86A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.9e0c7819_1538466717481_0.8042650906390894"},"_hasShrinkwrap":false},"0.13.0-alpha.eb30b26a":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.eb30b26a","main":"cli.js","license":"MIT","dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.eb30b26a","dist":{"shasum":"c8b5b6502b193837cba8dc5b70d5552e2d85ab23","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.eb30b26a.tgz","integrity":"sha512-fKmAWC8gilnNdgYuqAZASNks/QGyhnGXv1vefKLFIXdg+kXW+3TyLhEUDc4Av79y4zAcJxAOyFT3WZLoli+T8w==","fileCount":22,"unpackedSize":17769,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbsyPdCRA9TVsSAnZWagAAuHoQAJPi007txeCQT6jNxjbb\nFJAzjIBYHL5QyDC10kGzWcIQYOul0uN2hOo0yFS//aZX8jCjwk1FdGkXU8GY\nJlJNqadRQ8buAWNhWVOj3Yy5V7HK7euDALFz+nqTF2J+5Z52OsZVSSdMong3\nFB1B+kNd2Rr2046Lv1KsJeBgEtbk2JVm3KtHBbtL0fM+/+pp4T6Cpxq9Iq+p\nvIqk4K+W9aq+KU/f/NqIJrGWr34+XjHq34tRXppYaO2L+oVMtJVuIsa/xArf\nCN6cCc168aA0xLbGRvlRdYguxQ0gA1hyhfU73c85zVT73nOAHGL1HqBKRX4I\n9hMRk7kt2oZwvgQVIF6JslK5MDWryBB74dE9D14S7UtqawkLK8+0nPgSsGdh\nNrHci/ljcV9yNGZ+Sasb63aJDenur7AFwPczLnJYQ12eC0c3n1LcdOvQtGUV\nessSvMLn9+xE9N6t528Zy2E6T9ga8aBR6qYNglBoYvhsoaUuLHnSHJllD1so\nK+7uCFoUKy+h5LKIu5km40Dc0oP7jgpgiT7PWZNMW10AQd+FTATy+bmOD+rr\n2vtFMiNE1pigmDlQ7SHPGH2Dqaa3PKFOqefNaGx+tIhUhZWPJ/agq1QEuk2l\njVPGnHq+JR/Is7Ytbfaw7yanFXQLRQyVk4XyFYLBjjc1QoV13AM0fLkhMnXI\njyhE\r\n=Iopz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDgZVR0UQhh5K3Ax+CcFUiGhdveEFF4awAxRQUkGQHcewIhAObbyaHqLAJWwQNhPvj/Jnf+l2u/EUSa2yNY2iyN8TqR"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.eb30b26a_1538466780592_0.8660528559391998"},"_hasShrinkwrap":false},"0.13.0-alpha.fb5b2096":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.fb5b2096","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.fb5b2096","dist":{"shasum":"fb0c89ca093a24fa56cf588e98cd0c3413719cf8","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.fb5b2096.tgz","integrity":"sha512-7yqO96s7b3B7Pzv0k+6yjoJp693twlTqc5O1zRRa01y02IFLK28q6aXR4ueARDWWyBgG8ZK9Y8G3juwVxDYkZg==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbsyQyCRA9TVsSAnZWagAALYgP/2x1WtiWVoAyjr5jR8lx\nZJ3xP110yIDgAFZNuzQalaGS0t1dcLnmvv1kUFKszoFYR418PyLRtd+FYRL9\nxK+RTWEoCtmZ7/MqXEeOQWTaNNpAe7S1FosvQHPtG289YCXalcwDcVfY6aox\nii1fr5SAwypZdzkR0YcZnp7f6FZmqkJFEB05focgOa8ZaOUkD4ZbCGuf5d/0\n2aNz8YUeH/RkL0ZI6gcxv8mUNf84hOUdq2qSQSYwCeuAzMN221dRM6VX8Axm\njE+oL1j9uk0GpkOY6xfJKvolSn/U3X1SuYjE0f3SZlix8SKFFqLBxAE2VrNR\nkuBDMWtSvf5dJeqH2zXxIX++08qFR8Ttjhp6Wuz5Lq/hT+uYUsBm18IS38uO\n+DlrdrOs8Uzzp4WhgqozEKqCowkmuFbXUr2FW2ZAnXtm7ITNxf+6KYuVVwcj\nIDme9o3mf/dJB3MbPioxNpopdEW7RPbMTKiZ7hCJyF/j2PrKea47on1yMhjA\nxZzJtmzzn6BzdAlQZkI8o6PhLvyekC6A/5j/xTabywhc7jOJcY7XKEH8Axl6\njFTzqEJQswisF4rA53cCR2HXnQZRjxtwrw/1z4VhPXd45MdiP4wGe1QHI+Dc\nWloHZUzbIhLBMJi1SYhrBkUIsbo76ko71WADsdG/u3J0n6oO2oBJU3xWP66O\nLxzI\r\n=Ir8w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwJYAGMVnOlvIGkBydHJ6yfP6ZBKC8BVRD610AnHUXvQIhAMB7+fPMaMjPn4oil4yKlTazniD+bkmpxieQMWyY5htH"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.fb5b2096_1538466865875_0.9028863537817906"},"_hasShrinkwrap":false},"0.13.0-alpha.68bf59ca":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.68bf59ca","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.68bf59ca","dist":{"shasum":"8d91fcfbb0b086001ac499174be4324ed7a87a65","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.68bf59ca.tgz","integrity":"sha512-Z/jVHiUugwiOEZ1EWe5qEXa6YQf+vuhIr0Klx1G8fkpoVDg7ZgIEj9CPvnkCO6Nk7kkUN9UbYQYvie+vzsGWvA==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbsyRqCRA9TVsSAnZWagAAJbQP/2UkSDOHRh3nTTjnlAH1\n9hrCupyfPKcPCoGDXEPpRzObGPkXGJgRPYu5eGVydCMPHOUBs/ovWPv9rv/A\nARfZiVh4DxwmaknfAVakWU5aufi/qv+tATpQF13AZp+0FbKIzHrJlZfdfzVR\nTmeTZd1wKHZ64++HHSWdD72PzS9PHs0HBxQIuNyl1occrrDzeb4Id7PSF2tK\njWF4mFAmxYFdt4iJP4cMJb+ivzjtK2fn14qsIbk7STv7p3uwyIyBDFoMGHEK\nrf6SaJSKJvi3KCqVGEyEr1F4RQgoKgDFdzWs07guhl0QaqNaB6FvjojY+ZCq\nZZsLuApai/FZm++Q+VZm7LanE434dtrB0vD0V5KxYFItId9p2yEHp/Z7Ln+8\nT/a4kVgG43mXP3IPwp9UvXDYJmoHXfyHEXTEV80ElFx8TogFhDqcxyHGChno\n2dDZ5+sUT1YhKzPXrE/tbuDhO1mmXfsGd1eFhVUpQFFLi+uAG4VgoMPPzbum\ntidBkz8XZe6Es4E/7eecZU3koQOh8JfFedrtkpDPaEd2aW8yWiQcXwrRVM7g\njDQ+9PJJk79VbFdPXafFbIPhr/AXqbLsXInG+x2/7WcehJsrLOeZ/jJnzqRz\nZ4Fikzh8na6hfnVAEKcZyAguS64QkDENxK1F2j8SDNr2MGqgxxIJw06gQ29o\nH+Il\r\n=zSFz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2yUcgf2KUyZRTb59LhMwnwqT+6s+3DZfakwiy+BxYWwIgeFJDDeUEJGKVeqj0MPVb4WLTKLHmQjYx7NKU7e6vGn0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.68bf59ca_1538466921367_0.4694376434473799"},"_hasShrinkwrap":false},"0.13.0-alpha.c5edeadd":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.c5edeadd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.c5edeadd","dist":{"shasum":"2a9a7ee78c635812c3071d8a66057ef1ce12aeec","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.c5edeadd.tgz","integrity":"sha512-OxdAiqStqY10JEggt8rh9gZMGkaRABkCVADptjbvGC07iLMkX0EE8RPIpcOkGQoY/8P3TRvAQ82kSjplVlEGFA==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs0GTCRA9TVsSAnZWagAAOQ0P/1Nd0wAqsHiWiYOiK/b8\nC5BtZmonBdHd0ZRkzwyaHLOTKzePmm1U+oh6fMhOJB3EWfpyIh93BiGlKk/v\nkbo9GJHR4z9A6EnFlGSba+sdQHs6hPnm2ncBqVVTR2oK0IBWu4uzhuzGcBAw\nEWL71g86bfgMkJAthJfSQJa4a/bMKh4VX1IpKIQfEwLm/pLOvc644ALl+Vms\n6KPuXL0KhLF2AqqpOHpSpIVaislLa1tov5hzpj1VswtzfoyqNFjBN93jDI6o\n7Gytg0DLBcl9gquztyn361D15DL3W8r8ILI7WD2agwBYY4DXQ+FfYYyzEBZq\ngsT6CNZ4sRqDmEdOXkrG2rRtQoe/EnIh2bbcRNIWmFtNzwddB9SK1f+fMvsP\nTkxiqMzjzMslvVIqed3+YEpSn1PSX+IC60fpjuig9XYKy0iVZ+N3awvKnkWc\nc35bkvvFyp/P/k5VoD2WMnhWtbryKnKOA8lKsQWCYwnfTmaq6OwWguTprp1F\nuQD15+x0RIBZgtZUBCITuMbdlIJ5snzdZEpL/W7RqDdwRXQS1VdpiPyd1XM0\nlCWhcp7ZkBpBzUImmng/YO8xmQFveM+7uP7oVanOiyR0GQOsFsyN3lVqd16+\n5KybIMzA/mCNCePTY3d4fxKbID38+Yz+ieRB6Dns9Zk5UEvv7pjxpuLpbGvF\nD77u\r\n=tmVQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDFyULZzQO8/n1CEOu4pj0q1lbV+eSKCLmQO87PV0r4RAiEAkWqPz/S8zVPkEnj+qxvbqqqgFGZjXD+1RUUGMXTet+k="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.c5edeadd_1538474386638_0.3455694687717996"},"_hasShrinkwrap":false},"0.13.0-alpha.ef6e22ef":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.ef6e22ef","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.ef6e22ef","dist":{"shasum":"f4b35b604a8f4a67b5890655866e984fa0f1f602","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.ef6e22ef.tgz","integrity":"sha512-p/q6y3PrcCX+58MCy92HHJbuc35ONYrpVHbXV2Xh4SusZT33g/rJ6+KtrQNMNRtnAQ5iU9MOnZd7n/idh2PknA==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs0GdCRA9TVsSAnZWagAAM0IP/1skPcCfpXRkzkdwAD9c\nlM/+Whtif/GhCETrb/savPvOjAayYxz7TvJfuXIbwj6EI+9TCVXNgOAePqDP\nFrEbqb0O8lMD1OVQBTLc+qMnUTBv5ILjyRYGhAecE6TpkWcYpnu9SDcWNian\nLefozxz5P+0aA2wYEM40QBrnypACpPJFn4EGbu2sj8VAz3vpxYMQatrsg7Ce\njQ50JMGvkl4WACm9xHO8sunqdmpW4rXlTJMYhUtu+dmTpSIK05Z1SIJ6gg5D\nVRCx1u/0IGP8WIxFfOm+65pJP3yXteEN/wMSos9aWljUHytJPCv0lUT0CBtL\nllBG+Lf4FKmtXiWhsYo8plss4taISToBOdVU6rE7+Twc1cc01ozF46HyGd9Y\nS02MyNXekULC0RfxvQx9GC9AGBd0rqVbT8ymtB7lmtjCi23fwdB2KpioF+V9\nLedQKBr8qFmRzMCIDa+q7GpIlzzaMuhwINlhGQTc8NzTTD1CeLh5C9DhAfzW\nyHxhd2qGKORs3WzI5YzjdU3xPmCiQcwbCBAdbcnyTDCdKUyZMpf4twZ/FhZ4\nS2pbIbwFN+c5PPyimvpsARj5tZd4RLwjLFYMQeD1+wgmcKmchZ8vZ+hWc7d0\nBMfW+X8gO+DsBycp7SpogUSZcN5uxPXon7rcVRqLZivjCq3dw9r78JV0yZ8i\n7rI+\r\n=24WH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDDISG5j9wdmWoefTWN26lhaSfZqjopG6iROwMVKA5LDAiEApknpxyas5CBoduQCxmxFLiRHhqBzgTp77JphS1oBG5E="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.ef6e22ef_1538474396812_0.7220729933057253"},"_hasShrinkwrap":false},"0.13.0-alpha.94e4c061":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.94e4c061","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.94e4c061","dist":{"shasum":"e75b9f083da4e0f5c4fede568eb8769afc471be2","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.94e4c061.tgz","integrity":"sha512-65tP/O76GHf2KPL7mUOpjaAxBYsVJ1z1Y+mydLeUBxwTmEtvfjnBy+EV1j+5J9YH56nkE34hJvoXOQhWuz7h6g==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs0HeCRA9TVsSAnZWagAAuLEP/0w0ZyhG4A89Jw5GjtWA\nBEdAwGLNUB8/eK/5JD+mCcMyN94Vtkx6VxhBiBCx7/jcI4Ch3NWVaiyp7KsO\n3P+je6JwBWnop0sfCo97B/UN9kYT5FZmlALtyBFPravh1fVai2YgcuD7Qhcj\n0mwG9J68OIwYlPuwF1b0QbpcZQIFY3zkLBfpRVb0rUu20hdyYBwtTsGZIJqy\nNno3quWQVzMv3VhoESvJbQMyIWResV/TSwCsqic+tWWLBJ0Qo/VQsmKLlOO/\nd9Ui47xm2wto+vycEYCf/XGgd8HAU7WHBp6t1orxuKERy2LuP+gWkFg1IFMg\nz50g+QhQf3u1orbI/MpC/fmP42W2qejSb344/c+TQ+LA8w06FWpNycgimIA9\n9jBd+jwhobZlHdiSZKpNrCfkOwyI5WPp1RFoZSsSBhqoibIF5S9gBa7UYE1t\ncBa8eWX9XC73qR1GKTs9Z7IeGBG/1k5lbqtT/ZEUxr3WjOC5Z7sqvhCcKtpA\nbEIdaM8jR+nfEzWDpLL6R02nDIVmDBmwshnAcEzLfH3sRXuGZbBO7KyHswnZ\nh/K6tHf5uicpDKMc6nDSyRFJVYtF7bWMKlFTSNgYd12LAKQ/nCt5DqDwVul9\nh/ziqkxjup2Qp7WEVLrfn5eslapvcX0kCz04UfkDY/HSeysMjo4n+olt2Rlk\nNBfr\r\n=OmKi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFJuuRMEmVbBo0yW7g2X9BE4Ib8mj2/E1+CznnBRJ5fwAiB9c9j5OYUkRGmLc5fyaDUWx9xO+YAU5beQJTeiDyO9sQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.94e4c061_1538474461795_0.9915942840326901"},"_hasShrinkwrap":false},"0.13.0-alpha.307ff120":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.307ff120","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.307ff120","dist":{"shasum":"b15a9d66e6d4042781f783ddbfc31ff2eb50970a","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.307ff120.tgz","integrity":"sha512-rPyCufa2U2knerX2XFmfnzoERZXWWVjVWd7yA1huGpwW6Va9vZf9+HrnNnf0WU35oawdPCN3TbUH9hUiZtHlCA==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs0JNCRA9TVsSAnZWagAAi2wP/093IxuviOR/PMya4A0b\n4RaV19aBXmQFgIA7G27NC2PtGvuJNqOQlVEbXv9TW2py4aRKP+/oTL2hoE5R\nwAcUE29HTxa0zx/9+IxbSFz3oSut9Giy2FXdRVXQF58UK/p/J6jW9FkI53Q2\nrAiiF4APc7g7YNXGTGsHF+xJPNSQdAIo6KhqF5GwtJfby4DIZKsu5EtfIdhE\nG6rdDIPal+MGPAdIA+gcmAJDj1U8PqTZd5zqALUh+E3Y7O/K/8eimorfMrqt\ns+u945qao+D/KJmgXYPdqo05GH4lHwc7Qqpuphv5/iJ9VOGtMUZQy3tQQqmf\nNu5ALLgz8EsooK/CTjp6x0N1wQm4AiFxgzEZc17sC7A1mneKF827EitsaS4x\ncx/OxjKpMmlewsMirjPXAPwPE7xIhiBnYClAvOihMGXqH5TWzkRR45NOH7ko\npzd0yDcIybd4v+9RhI6sZ20dDdk9UHfqp1M9WY08QdB/QUQvXY7pTpd2E8y6\nzHFFpZG6MVtsWyimWEVmiDAJYN7mLeOFhWfqdTEYCWw2zoOXBR07foX1WEwm\niQfW4f611R9CBlT+QL+TCLbhMZXKV/dvLztIcUmOqla1EtW8uzPSadkPryvs\nRzSiGnu54s53Yl8LkGRdpiVZRFIWsxwWCrisQYKxDlf/3kl2E+LSEox3kE9k\nTlnv\r\n=qy+c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDkopMXp+cj5OfKFiX2cImM+AqAf4QE3UvwKg1De5QBLQIhAOvpVcg7EQ5YN3fjNy5XMtl/JzmKZATx0kGN2aizj7bi"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.307ff120_1538474572492_0.6205413352404849"},"_hasShrinkwrap":false},"0.13.0-alpha.67531045":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.67531045","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.67531045","dist":{"shasum":"59307df0760d63dfbf729b3ceb41d6cd42b26d97","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.67531045.tgz","integrity":"sha512-p87s2H4KVS8QY+WIUi44aFGoGwuPjx/hRQhUGVOggneScAvUX9lWFFwxl9cWn/x72IrQSK4Bbx2GbbSI322SYg==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs0JwCRA9TVsSAnZWagAAigoQAIGkIUp32TvBOLniZSry\nKerpBPS3RSlDEaOO3OVCDxIL9iljX2aebzJot1Luylf7oQ6p9gtWldal/XlW\n+UFXRsh4hEc/4M/0PlsOEycN/RpVSPztqtYV/O2ePv+8bcRodc6vNYwCyWW3\n51bj5/tiEMoa0VOkNY9Dajx2C3mkiBsxFIQkAYJ9wwoZgDFaIB8jUVC5zkKO\nC7mRQJNUokBzbHEO/IqXJ+oHlCA03SpcpHE2dE4MlRzg6hDF7hEGNkiN4xFF\ny0JomgOudnAR7lJPQd0phwFdGDck3DSyjS52ZLemPT2EAKzoK8Wd23H1/z7z\nJkReDgWalMbhb5xTjbaMb59sew9WYBRwMkqBNQBh6R03YfG4QmY5fVINEO3j\nNWFZmlKECjBvcUuPtNhKHUg3Ci8r7sVZu0pU6+7kumT/9cdUzWzSTgI0Q7C3\nAYhbckFCRQr/FSbu22TcOnIqeHPQflBE1qCVV8Ha1qFw6rLRaaw4eIS8DEPd\n9phifyToTOLYKhDQFMDJq2wS0CW8lXTWG8+fFenC0jyFeZDCd1fkWTnAiLJq\nRbvMh9UIOpq+a0SqYrR4UtPZ7oiW86aBSbE/Mc1tzTgcqidCGmx23C9CndTF\nCXG7GszuC7QlMekcERcyEL2NwgT48Yzj+X2MS1NzVeY1XiqlnYRdN0yhV1EZ\nntbv\r\n=3yG2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNCIp3Jfws+hsizT0O7/YDFY+87nT7hNRaguZlsJP/hAIgQrjtbrxmuUu7bE5hQ9u73e3qHUMww8IjKg+U4pEiTm0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.67531045_1538474608128_0.6950088706304269"},"_hasShrinkwrap":false},"0.13.0-alpha.4466a3e8":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.4466a3e8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.4466a3e8","dist":{"shasum":"dcb99e99d7d096f70830629856fdc2bcd97c27d3","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.4466a3e8.tgz","integrity":"sha512-YmEBtzKqH1maCq5rTZp13AIsunUjrckrd1amro5buFZkMkdlQvk+4lZBKQFmblMJFl8jfZ8uQoIKw7HtHoWj8Q==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs0KICRA9TVsSAnZWagAAhOEP/1spV8AkgKdquw00K25Y\ne/LDJZymzqJGov6yjRSS/zInBAxtp3LTrYas0bzNtnGgNJMrVIutcDQhyVu5\nmPcpiX6+Gxujn9NZlJPMicYmY5yrzKSaOD+GC0Rq403vcP395yZS+D5kPBFM\njACe4Wt1lJXwG0zPc2nMOWNmLzOHbuHtVLfAlmicNj+LQmHz0aeczQW5v3B5\npOIQ4eVBanSja7Itvw90O0QUHEEWjrmeo2HzobWtiDKJmTikeSSQ6Iq/jvHJ\nVuOeREfQo805mIy4FTNIkqKNOpNI31F8Emsf03qbU6hMwhRNgJVG4RB0mZEs\nfm0f6G8j6MJWojL1D66+QwpjB4ZsE+TOjywFTJ+kApxv64KL3W1Y9NN+/O7X\nhsDC+KK3be5qjV54LSJ99UhxmX825KBMmt05afWxCeC9X2g7TKVO0uTOWhsx\nhjBb2T98T0nn9wnDCjcSJodiEkrOAoFMiESfWBRKlRtvCLJq/qzFySsviDx/\nii8umj7ljKdkYDPdKVu8VP3s8k6qHv/dSBj5GBqYQQcYonEqNLm/Y0GKQG/X\nD4xqz6xSavtpphxM6T0K9ojJJ2BkfzF/V4WZQ8bX0vsoBgIqcIwn49YCQ+aT\nar5ZjumAIBsw2A467VehSxhKF6/1Uqgty3YeL94Ewveuiybpl5BiTOkiPXfD\nisZp\r\n=rONj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE3rCysSFYLDBPUEuNSh//ymwoSKNtIIBIKsch6zuz4oAiEA1RpaoOnQTS/MItOYu12tiarnutjsGlgHfYx0UA385AU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.4466a3e8_1538474631643_0.0026179684700662342"},"_hasShrinkwrap":false},"0.13.0-alpha.212bb6d8":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.212bb6d8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.212bb6d8","dist":{"shasum":"a07c767a01bce34f05f73c4a871d4fa417d310e3","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.212bb6d8.tgz","integrity":"sha512-ArWNGrCd0QzdjCfu/mjCxb5nE8M30HTVtxr/fIoI8vM2efyWL7COisBJhNkBIQAsTmrzd8ctUXn4W5pSx8ksNg==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs0hPCRA9TVsSAnZWagAA7T4P/RF9xHWmwUcNw2wB9kMj\nfeaks/gTe8t2O994GHhSNLj964553QjgHLBgWsV+Y6tcZpqTf6OwQBtFsrHD\niS/PhUgHYEd8KLdk9yh28wKXB9O3yYfs/U1laIhbe8QLZs94D/ESumINeh21\nd7AKbQK+EJRXw9Flmadgs/5gj4TTMZTIYORuh57TgpC/EuWy5USsWVGMn2O/\nppki2yym9tRl2O7C384EzSnAJRIFSvMH/CIz65dYheVb2cUCBkek4t2ZHTXc\nbXouQcgkYK9Dyb6LB+JmQ3iFIvxAhjxuQqiJikqYaCjIPj6fHZ/w30/mZwm+\nOJfw7F5JdiGO9SvUzM98ohb3P20ykyg1JsnRero/zJYrxuO+jbBbUVdM6sfO\nQRrfZ5a5MLOD46he0jIVIWpppoKh+6om3jHwspmY97qCED5NrnLkayDeUnG+\nXb2lUxzF5P8IwigUji5RQ6x1uhRR/1y4+EfHRLmqcGcYp9jOToIzd1CRhzw+\nCskMBRD3fh/VL0updzZYoi1pVM49Jsa12wbBRc8ucnP98TRPC1Tm/B6gbjmF\nk0uxJLhZwsOWAg5MbbH1wGVJ67Cn7CIWUsBZ/X6ue3cN9ORnZupMxesPwS//\nZHeYfkuW46PdKYJ3TqMOWDIC+LYvSsuQxyIA67vESkk9E75XzprSHvJOuYFS\nHOTt\r\n=olWQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIED8YwMKeb6wU08fJ+VqyZzZigZddq1G/MMa+6DNT3TJAiB+FatWZrGyUOiZlvREVP0r8LU1Rd/WSC6D4tUGpQm0hQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.212bb6d8_1538476110593_0.31140971069020607"},"_hasShrinkwrap":false},"0.13.0-alpha.965a9103":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.965a9103","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.965a9103","dist":{"shasum":"c208d178d5e75ac71e5e7e005103fa3502534a7f","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.965a9103.tgz","integrity":"sha512-UNv49kNVhLzuHttB3Lvpss8uoWaY59D9VqYh25Al+NTFDUYqujwC9g/DbSGwBA+/O5KBmriscCX4boZ6oZxDpw==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs0htCRA9TVsSAnZWagAAr0AP/3SL901Y/W5UeNyqrsXK\njCJwY2LNniZEYSVFhd+YOtFjhiMQjhJC9NHQm600mms6jpeTFCTO0OVmV7h0\naUSWxeWpsd8bUeFgFWii882enPEPc4/SFuAMYpHNLj/31feR14C37Jo3BR3A\nWRTrFbIEshnlqOeHsFaDqfXNEPZetLEffFqcsU54WpQ72tp6/vWTbOfL4qd2\nOXL8GFrjrJtAAgH4gN5Y1emhpUJBwqdzhnTXOnJWrD+bskO2LeIFLaxHOhga\nAVSCYRuiwfpI2J76nQAPiH7huSpsRue+fLBjaYzKv7XcUEBxQHRtggsrONvZ\nsN8I207i3YPPoJ+vtpK76nRMZPGATBFYtFRYnuysmTvEnUHin1AxRhppgAO2\ndQ+JrSq7YclwnbnG0GJNhoZjNjOOrG+U0EMBxZNlCp/gxHgyuhqangsl+PgK\n2a++IcrQO+YbGIGVtu48P0v3Qs4gEbmj8Jw/OkK1lptGOvR1gZWttMk1ainI\nsMFJTx+6ExxVRHVtviqfm5fNy0eJR53SiVn/YxxoF//mmzKqvoqj5MH/lNjW\nRSEWuVDKiN5WWVsta+ZiPTjUhV0r/3u9sH9dGQo8+kAfaH6Z4KBurCj4H+5P\nJ0HJ8NDHZe4s/5sE7xmx6U7rYOToIGRsOVsNPxlkIvyY7ysRGcbYxtUIEMf1\nwohE\r\n=lRE3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFkM8LfIN8lUBnEXyChW/bUxSXYMGOidejvegEHq495gIhANcM5vOc1wbjAhrFXnJJ+72qTH5oAfeZiVLFtpQXc8oJ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.965a9103_1538476140597_0.8208406566779443"},"_hasShrinkwrap":false},"0.13.0-alpha.c3e00360":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.c3e00360","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.c3e00360","dist":{"shasum":"15f1fe6a8328911d92e333724e1bd3228e342f3c","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.c3e00360.tgz","integrity":"sha512-WCVLzQMerobilnso+xx6VIP5RU1ScX1mfVOW27TgmJSVQCxxMR6TAZNp51Wv1FTUs51O66UIhzKCSgd7QQlFKw==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs0iSCRA9TVsSAnZWagAA6pUP/RBz3+vZPsBpkcV4b407\nzjwdH7iXJwdrlSaPZ18RIRtHtfS3W4bSKlNZTvt63AN+U0LpUvF/ImeaO9rv\ncevgb2zktze5bsLgvkm2FRyfL11LvB9NaHiq25LJH5XvkrXDiOpjk5IfDcmL\nKdC+/OXcMTzRkuKZG+oNOr8vw6aKwROUytOIy2r+21GJffm7vWdJKVMGX7Ei\nPPKq0Aqpu/RbC1W8VAuKpwLlajwF66+1SAjXF311FE7Izt4v4+OFrDtPjECJ\n2N5+friJqhTCp0aD6hWY/5HZ0BdyYJO4pQ/9i7yac8GCfd3h3SQSg7BFBAh2\n4pT6dxEiwv1mv+3zfJcJz5qKkcKuDYO68TsqSNuHWBjq/2vHOPxLEk+vJb7t\nzdku30EmR0QmRul1yMi+WVQRO5UGz5rcFCzs2SDZkvZVK2MmIkRczPcpE273\n81lxXw72mdAo9mBMxVv3+2e6zB5vMmLz7xHRSL8yGPCXEZjH58ptGauvjXye\nsz81Q1L6f44TAqfH4Mt+GJA8uThKdeLIhMjlX/ARtM2NhmpsZTwCuNpeEgq8\nT6UwpmxXPqS2FH9FGASx/8Z/f74OhP2ERr4x6s6lov888glOFFsbhiY3oopT\nmfnbBnBj5M1w1VhOz+qJ36YUVuODmQ8LAOcnmCqYQEXiWJjzYZN9pzUIdlem\nKND8\r\n=CPzN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE4eWAagayC6KwE/pIjkphm7hIeqpuOX7AKU5yph7wZyAiEAy8VkoE44xbje8tAy37tLmQRTBkkxwSvz7v1mOJIXjGs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.c3e00360_1538476177520_0.4216684555794241"},"_hasShrinkwrap":false},"0.13.0-alpha.2d904238":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.2d904238","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.2d904238","dist":{"shasum":"d24781973b78170e502220a525d7dbf3a1087480","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.2d904238.tgz","integrity":"sha512-ScWsytagDU32yD30bEgissk56XY79rLJt9NgpZp1hOUQk+RhCEnfIlkuMANydH/YTAjw7mJn7hkcN8eOPKRu5A==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs0luCRA9TVsSAnZWagAA2J8P/0SG8qFhXN3pyHcPy8K4\nyrwqcb8X9Kgzgiir2VFUnpqgRgyQd+UnFozSzgTG4nEBmXtWArURv2Nmfikg\nbEEV8xnt5fAYyuobqkMaAzMRaZMFtm62vU+vykmZVq4ei3J60MgfJv3fk9hQ\nKWAb50ZOto5ZEfHobm0oegoihcZWkKOI45JFPfmLOQaxy7xIoO3OMVv7nqOf\nzwDCjy+UTjEdoRh409n41HAgtxqN7s7bJlRo2kgL2pI6WhjdRjpzB3vHK0kl\n5fDVa7VkUOtKsyekviOsL9IXUTLxhMNjWBxi4CLGFn9ALjSleoeDLwULKIg3\n+PnB5gs1i1DGABTKTiIwQckQNhvriQt5RgUjlMKhnwkmZBWKpNjCyRUZlMdG\nEtcFruku1Cj7fgOd3AjPG2lOI0raXgK4uQzG04MdPHNlp29AToJiNfzju4iN\nkmZVTtI53ytlpbqGp65J2r5WitOuQGom3LLQXs+ABoSuqY2wwQ6PB8u7OPoE\nya3/KhfZsHLUpBh6knlVVlYB0rGIiBJ25ldg7yz44ugTtQJx/PKvth27r+Rz\nhOyiCL3SbdD1hfgxqngf56FcmaOas5LfUiiWb6EqVyCsxWnmkdy2Jstxw9uB\nBksyPuoFJKlKyrl2c1UX8UfXgw8sAvC04zmlblwoU9gSTg50KPKEdeGvsU10\nGuD5\r\n=Y7UD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTCa5n9/hs5sWIY//rHMue2kNqxeIpEafn2++e5x5WgwIhALR1pJe5kESL3gTVvShTOwzEKjJvlE2psc3PxF5y4SFY"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.2d904238_1538476397450_0.5756277777042451"},"_hasShrinkwrap":false},"0.13.0-alpha.ab37e4cb":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.ab37e4cb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.ab37e4cb","dist":{"shasum":"efcdbae262465d5e855c9c34e035d3fdf987662b","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.ab37e4cb.tgz","integrity":"sha512-O0FZHcqb7yh5FvH413m3nKnCjXhB6KRfinTkUvvYu/l5MOWuKOP0KScwCsTPyOZ6YbOO1LcGWdymUYm+slGpDg==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs00uCRA9TVsSAnZWagAALmkP/1Ju6LuhtRmmihzsmoJz\nE/pmPWaSv/puLFcnSn9lyX6heIc4qFL6Eac0k6HCs6ONqtT+XHupzydRaaey\nQLpyqZLHCzOUkJZ5JpAIR5Ti4TppeJHjkLOLF2beWTYEzi752CpLRrzeukhl\nnhx7tvqZ7CiJSrHNoj/Jx8Obufk5XbQAfjIMSenUJDHXluGONbCwPfSKekJH\nii0ZYskeD6cgxGIGA7t7EI1u4crx+/hVgcgrQrGXm0jmRSTfLu3eHbMkQ4iv\n4/5oig9u7NNj4q+QXlFI3OmSMTGeziWWXE1GKmO2+Zv+grMf8XF770ctQcTG\ndVRNATS7Y8e9miNKL7L9CGlYp7cFlhg+xMc4YrlAnDgLOBBnBj/38K8Z6ZZO\nyXp1LCqDthf+SBillqQSZoHD0aQDnTFV8MhBsQwWosko3LzrMbSjzI9flDA2\n9WQqkFsw/0Yvy8lC5hqNFDchS6nTYaWgq/UjuDYWmIiOguclWxFttCnP4cMf\nD/V9QjRZ/sjKjMBfqowDdFQidw+oRm5emKMBTmbBaL1oGkSb0cTWTBC3wwfR\nel3ClOX9/yZ/xBOG5AVbBTLljQCiQ+VAfZFjERpk1BrjvKuT5/SlTm6QqD+n\nxVNDE7Nej9Su2QWKwaR8xZ9OEBCw1ZwdDUVyE4LmLgubibn5cKCNpXEJgfoj\n0giY\r\n=dDF4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgJVYYkDLAl45L9vASdUw9k3Yvi/RW+OGzCsh8T7Q6GQIgP7PjQepPcF/2v6eeTHIPiL2R8nSPuxM360BpKgnWEi8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.ab37e4cb_1538477357721_0.8859992324937396"},"_hasShrinkwrap":false},"0.13.0-alpha.4d884371":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.4d884371","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.4d884371","dist":{"shasum":"e4429b837eed4d1ea0727482e5b63c5de4f42392","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.4d884371.tgz","integrity":"sha512-DBvQr+IRPejjp0Qp1NpC+67YUWNCt5PUNSn2GH/1VgUKQIg6ywBPi9hXCvg9GQfqiBdGWjbMoh4x2/2MTjyw4w==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs004CRA9TVsSAnZWagAAmNwQAKDbXnAFaLCehw1ueijF\nFDJZsU43jxbRem1L4OdUHV/c8mVK0lF4AeVquZXsz6nEOr4x7od5AZKGJ7EN\noAFEtgR9nKxWxAEOiQn7yP4Hl8Qno0aQG1qOOVBRxrcAWgJrE/bKqCenSUIq\n03bILVrocbuojU/nWNJYahaGzrDt2lOTSFT+KI+zuK6mRKD5FRx2kqjladTd\ngoUZiIsPp30VMlee6JV0L82C1TUDC0Y586gumX7aamq0tKMUMPD1iRYuG8dc\nKJ9nhU2c1p4OlZQwjELkKn7x41I3CwaoGl32unY5BfYgiSuqVwWHbvdLM3Z7\nXAQnoJ1/pccOmOKsg9NL+Sd8/syERr+RKJgcZrprP3UGuz4y9RCli0l4qr0R\ns0b3hZ+anhjBlQ1HWmHD+eTyTFqREzY0wKEIlIZ6I3PysBS5hGiebpRk57hQ\naQHGlDpxqR+iTRd3Uo8o9K0s5Fjrj5IP7Ae6Fq98AAR2wjsfeFr7iBb96y7X\nKsyW2oWBh9QjDVEY6PeGA5x+6hwOrM30qhtHR2urmpZfdjNiRnr8E8RbTd93\nNfeHsWqtHIH7Y+54SH9w5riKLEg5xDeczWtCnxBOfy8XY7PB1tQ4wdeVbDCj\nGIu0/R2IDCcAn2sTj2A9wu5m/S1zw7/yTrmPnzP1hFNmNg91eOQHSmuDngm0\nQwqA\r\n=hH0c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEMixLtITyRO0LXuuxpQj5LcnE2zSGYct8BYgH5hhP3sAiEA2rh3XR9B4YMOy8tx7a+zMUHhoEAtOHvyOGUklRQ/53Y="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.4d884371_1538477367549_0.23947317525757272"},"_hasShrinkwrap":false},"0.13.0-alpha.c2c17483":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.c2c17483","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.c2c17483","dist":{"shasum":"7165736cf1c545c5cddbf01a24fca5fe8834eea2","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.c2c17483.tgz","integrity":"sha512-v2SQzqSlODpq1sQiMeeG2SdgT4cKhTGe5MQARe3bM1xJp/eaVeIVRrQ/rtXaNxmkTovTxAMvx+cDD751gMtMzA==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs00+CRA9TVsSAnZWagAAmrkP/RjxHesk1fUBxaRMjDOA\n6kUSPV5R2XBq4xAQKsa6c+6nV7zh+anYGdSsjfOIA2vdu0I0auaT450rXi4e\npvLRhw6KQKrfpnI4pnS4BMl+T/z1v/+WulO1D+Ry+EbG5qjo71C2NTi2xYOJ\n+ruxcWwnv3P/4M4zhpKUvW//a+OiFz1WYPNxO4olRSmNzTuB7fjVCnbTVY+4\nZd9NE1Qfwn8WTr8TV8c9OMVnSFSwTdQyPWS9Ft/YmeLN7s2pM8kytc4EIQzT\nGp8Tufo3RIRpp546GvCuv1S1qf5aTP2StYl1oWbOdq/8mZH176fp166LBjqN\nhE0YY8DvQKC9COrO0+ojq6lycVBydhH2npryX5R/i3rWboDoabp+1W95H77I\nAH/rUSM8XrJgbrufeaW7OY5HxuA7l7Pop8cAfflqLvTdgWs6pok6JqhHvit7\nbrdfNBDtBeal6jRyWiZKa1ShuxMAfTdiKlBpm0uLLK1lmZPPZrokvFigZtab\nOqJ4GyeaM2pX5xroVFAYDgUSnFVEtFi30VkHDJjJZ13NvbMNDf/bBv1RkF5U\nClCu8CAvDmSqYgUZqSosVq3NZtciw6ahBcy1nviAG8w01/uQfvH1okyRKJJ7\nqypRPOf0pe5zhqoq6pN+fzJ79SeBGrom/ap4VtWkFIKXzUDmjTQW5mzztgcn\nuq3j\r\n=k96p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8mWZpMH1tl4P3P51wd1vaYW1LGCYbMKrR9ML4KNi3mQIgP4JCoobSgAjD1MkD0LAeAHlvpM67DkO/hqMkVVAkeV8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.c2c17483_1538477373548_0.5279828857362181"},"_hasShrinkwrap":false},"0.13.0-alpha.09f013b6":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.09f013b6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.09f013b6","dist":{"shasum":"732ffe5c8bf3eb5852ce3fae696731b448bc786b","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.09f013b6.tgz","integrity":"sha512-rVS7tXsyM2RZkPmW9giALBjv7ZMGYVdoi3wy4MiZ8bzkHmWvh++TNDpnD3xTloMGTYwdFiGvvetXu8yoPReJtA==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs01VCRA9TVsSAnZWagAAwEMQAIZjwBqx5tfO84dm6Zgu\nPPAUV0VIpy7MZ3/PT8QdkZ5QVclvNS2GOixJcWoxLlZlWQz6FKm4lcXsL8CB\niIVh7WSrFwm36opUwTFDwQYMjK5R7hzyDhW1Ci+rqltSzV5+dmzTEJKRCazr\ngz2m+umZbcZxKUnoQraA9Th0r8RRA0fVaG6PLAL0YeWMw4hnlkyqO1N5yuP/\nBF1e8pxSXqd/rF6n+VWSjVjpu7IrmiVX/ha7ocj94ZnlaK2JJihfEQcj/OQN\ntf+/uKQdsJoZ/maTsJXR0zTvVH1Yer3xvai0W2/ilYdqZzoDi+QWonak75/o\nqlyGJ/0lFud1M981GwPpZUaL9ci/+fTeNUr96MzX2CAHm48i9XwwTscgGnAu\n9ifjmdrOW5sRQmlLX3fbIcPhdyEtRhv1fR/XmUauF8M2m20M+UHSOQ0ufDAe\nwugAkmYIThDC4XvqoiBsxYTG1jrUOAL6s8zlNaIxMDeYy0XBL5+V+TPsP22b\nnYwPHNBTryd/rOpVZ578NXuEuSMbMJDxGhz4Yz5I+rb3I0I8ccKtmF1b1lep\noodXFgAV4sMXg3Pi5MZ+RFbGGJSqzraOJytud0sLQSZieN7ngorrCzWzAyux\nPQnsQQ6vNwABFDigeV5He5AL8R0KxPKYkamCMaT6RDbwtxhjyMbbR41CppBX\n05UH\r\n=bxJ0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEnGIsiI2rMPM0SXuubsdL3E2lHXRkRHOPic5NcRn+xeAiEAn6PybX8JfyDxmSI5avjZvPGKoWpY6n9C/mcLuWJ9viw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.09f013b6_1538477396782_0.7592928730992283"},"_hasShrinkwrap":false},"0.13.0-alpha.8f33023c":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.8f33023c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.8f33023c","dist":{"shasum":"97c8642a5fa8f80d70b9da5a5ce79aaddff4c77f","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.8f33023c.tgz","integrity":"sha512-djQt7fyhJ3592yFla3ray3u/+yXFGSbbwyHiG2tZhPsj6Arup4T7gOo64BuCSI2k54lC5n0XxyZmapu2Eq/3RQ==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs04tCRA9TVsSAnZWagAAHyMQAI0FJonK26lyEvUKUSIE\nM5YSlrQz37xBnzbyMs67kkkv0RfrZ/WwGV3dc6B9wLjoins/+JxdqlQd1/k5\ndjcgXkyqYXOnNonRN2fdt2YMwCp0niYYH/IjEtDr3X5ZYs1pJhZLvc8eG0ow\nNT7wn5iEGRa5jllAekUOeTigxh2Us40pOsD0N22m+6LDrv5ONgm3xVuMYQ6B\nob+Z/FlzB8SgbpI1ezDJecej9z23DQOnlhUVgb45635LIF002GWY8Skr1uUQ\niA64BsiIaQD2mb2rVH72KKk3lsSIj2vPfhuCc13qQtsyE0PZSb/qTax+yqDV\n8hUExWPwIknIXHer9Hf3/oZgTODJEM3G2W/nA6Zno/6+FwSbZKJxAXAetCf0\n39kde5xs4+YwO7uXt8S/W5JDD1mZDxe4d9BPfD44aUBnSKnBFU+PFugHT5s8\ngMWFTykPXyxTnNqq+NvtlfNiPnkzv+Ekm0jSHS0jNe+YymNsaxENymS4Q24c\nB/kb7d09648whE5zYd7Kx9vEYk+42Qv3/4S71QABsbcTf7llLt+xf2L1Ko8+\nsLuxQy6UV0uMCjuRiqsUcCCnollIOUsUG6AvB9d0qiIQO895HrCeilH2eaV2\nFogKT3Kt5hzHRomhnOiknylO0RAsY9i7kfTcT2T4MTSAFcCEDegKwh990QBE\no74C\r\n=YN7p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFPB5a8t/tiV8kECBHKRLaumFhsTBShKYTOmGEJfS0QqAiEAr45dBBK05K0ae+9+U6hvliwjsNmlEvXv/QxLGw/wlN4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.8f33023c_1538477612818_0.7700933677890245"},"_hasShrinkwrap":false},"0.13.0-alpha.eff53b75":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.eff53b75","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.eff53b75","dist":{"shasum":"07e9b28e171e0b3583ea77769ec57c44132de67b","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.eff53b75.tgz","integrity":"sha512-1eXdA6xvVPy9nO4HMlGps53Waq0sLK8H6U/4TPZr7+oKNqrdL+YAj8pBOFQfOkChpkxWei4s0lIdmfq2frd2wQ==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs05jCRA9TVsSAnZWagAAYzIP/04Cg3xSWraOorEpBsUf\nKRwwKB1JZesaskP5M7rxs4TUaRB2coRZLYMZ7MuIFblM6fwJRg1ASJLNOmiQ\nOi+Ewd6Sp1tTHUdWJlgvjKOhOrC1hQ1sRcfR4LJfbct2ojLAJJpsgKmaCHoq\n8qoXNXYFi6N7FXPfCxc8gtYLXYDHbwBAk2guTq6GYCDjzqpkkahYnGftGqaB\n0huzf1Q83tk2W+nEozQmhSQu7NFh9G/8J6yMriP6HlBSFBg15nEY7gYfq2bK\nMPJKxdqS1ait9m7R7/DZ1POfSjCf6EnngSf2SAHvgPauHVh8byituMFnDLw8\nGyt+wXYBpyPay72d9Ugwy0Fj73LxD2WS3sJK6TqxMaD8Tlg87ZsBiVKA+hAq\ne585B8S9ZgnXTyEqljs2FFacaF4ZLMeCfLWoI+EUfq3sFxbrDj02fW2lBrmk\nWzi92rbuNcHzHjgmFLS8hKCYNY2Ga8HThNWBc25zRI7YYDVvQwK3bSS5I5BW\noWLaN7vJAAI3IFYgA8B8CDIW+D8nbx1H6FneiBKQD4RHTCZwm/CtMYgqlxEM\nI+n5zzMGOpWhJ6anoOQVMx7peuxwvgDe643K4JeXacLuKUb8SeiT+F3QUgmI\nXpZ71Y0JTCbgA9pOunBBDgRI/erTSLSQ0X+izbcA01Iz5LdqSwyHDfwzDZNb\nHFZQ\r\n=F8B1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGj9VJqqkf6W/wCZbuRiB5SGPrz13O3vHCj5sakSrwrAAiEAh0ACVWEg+uLIxg3kyyJRQF0TneAhbiA6Nthw9y+ziFY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.eff53b75_1538477666954_0.002939562991505218"},"_hasShrinkwrap":false},"0.13.0-alpha.32c0e5b9":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.32c0e5b9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.19.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.32c0e5b9","dist":{"shasum":"417c585789da7d548f1e91d3a0c3348089305524","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.32c0e5b9.tgz","integrity":"sha512-xjz+5JKwX2exyVL9F++XXP4OCGyq/hsyziwX1lhcxjbFI82QqyGAgwfmG8wljb622qSvO+57+N4JrPPYNJoxAA==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs1AqCRA9TVsSAnZWagAAPosQAKEWi7s3KPFfsmkTfpxK\niVlQEFMzTMD6e9Eu5ykSdJ9PvfJoNx8Gwv7QzzNstcTh+WVloHl52Oe1zfrD\n/GTSi4B0RtEa5aP0elGtUXQQwFJi21n44hV5nuOr2EfDihds1tlcuoGvqf7+\nsdep3bPgkViFyWP/o3HbuiZdQilNqut9eOxbMmQQQFyv3u3skY0HlGdx5Nl9\nyeDzrG0Mr3ozDcjoTgpCh/XbmXtjBrCOdrFS8VfEb6FuuL05GS0atr8v+Owy\nUT+OoZRhLNZ49koF2NwKffq0JJjQadWutp1XDcFDt6T95D5jcB8aOvlAcrCa\nrJznslDEOGb3fycj/fgFo3I/XQiykeSVlbwVBlJa2HYqqTY4npEl+xFBb+kv\n9rXwWwXynyK6qpqJg0mArheys05FOdMYB/J8gVmTF2Yh3gg9CoQUj1Y3oRh2\nnMV5X/aGUxKPTzjxpo1CpiPvHfo8RhVgHrxVtRD5np5z13Jssv31u60I+D/z\njkD/onx7b5+pPNcpyukHZ4Xy96ApncjDko2fkvaHTzdlExdH3J3igMSEKexL\nQX9oVbNKKlqWKLXCrdo8tm5kxL92iKZR9gWSA1yB/G9mXzBXuAcvxd3ZEgTm\nF9LpUDVNk9h2uFwE/iZPOHMSep2keKJ/cTvDyzT3cfSPg8dIo9BngswCPkPG\nzmJ+\r\n=I0PC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBhnn0vY2P+R5mZfrdS2f6tVtzR5555TOFn1MMOMQuJ5AiEAoZ/NnX/ubZ0JkMG55DfFO8v1QzYYyN1CO4iDrWZmEog="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.32c0e5b9_1538478121409_0.14054410535565576"},"_hasShrinkwrap":false},"0.13.0-alpha.89295568":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.89295568","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.89295568","dist":{"shasum":"6c97d12026777546778f4b78914989e1065ac2fb","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.89295568.tgz","integrity":"sha512-uZU1rWsrvH/ARAX5gmdRUUkKUjlMPlxutLqxZLlrVwXh8j1cTMcWZiZRCEffbCZ38tRSPPaQ1eleQJsnWAlMqQ==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs1A5CRA9TVsSAnZWagAAszIP/ieRrex8py8QObmna61M\navMhW69bRiybKcyGX+L0gyhzK6yfTVoZhVaJfYVaVWJfVYUD88A1yWyrglEj\nLd+o3M3wkRsJah59QmxV9O8OkB2Q3XLh7J58oa3RAarhSFHYXJ4tmBLvgved\nN4KxAYaegWqPFn5h3oeSZJjHLl2e+4rq29ih7WlRUB7QgaoHTyms9+DM//4g\nC6uVqwtobbMvY7SuYGw0+yVo4QqIuDxu8S/e/KYA7B+jFzF0EcjDzGsYeALQ\nLUBeTVoXryF6ZHPydVIlmRq8I3adKtAd6DE10i5cfNte03bdH62ZouLCLCQn\nXUoDKKBQg7nZao3ir6OqG0W9q+/y5sVEPbIydSyaZ+3UWbKEnfNUQnGdZLUq\najZs0XeLOT7FYzfUYkm/q716Z6L9LMPvmRnKPv/8IoFpzeUSFyzpxahQHKTc\n1CpqllEtnVpxCXwlTDtPeo2ocS7HdjVKvTSsfRx50MvHETmM46H8YFu4m+Y3\n5Su6xInBtHR88YHJhsAg6BmmCQk0IPsXjIaln92u6er4gKV0JobcXAMjedpH\n8J45uOaef4pvhCzUb+Pzg4vBlk0YXwNF6MnzzmDUl4fawK4craa9lYrH+9Dn\nc5hk/wgyFKY2b0X/xVlNbVFAAHnFEI8n+le8aWk4xjPiLgMRaAIm4G5vNlEN\n5Pvc\r\n=cm2s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDV/SFceTJGCHavNa2LyMmM4qSQcJDST83v7u2iZYmgNAiAcifkub1t9fTOKMF4is0FaUOnn6BIT+NM62C68U9r0Ew=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.89295568_1538478136622_0.49212106546728385"},"_hasShrinkwrap":false},"0.13.0-alpha.4c5693cf":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.4c5693cf","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.4c5693cf","dist":{"shasum":"f0af5b3a478d584ba94d5298eb43c2f1decb4ed4","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.4c5693cf.tgz","integrity":"sha512-DFxXa9Qs/MZX18OerxeLjC2xYCZx+EfJ7ds3+XgD7hypPmnoWHw2t3XD9YbX1DjJZ4buOLVgzrc+63bRnHwOqw==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs1QcCRA9TVsSAnZWagAArTcP/3PnDBIyj7bbLqBCiWyg\nkcdHVZ8rLlFUzasaiAZSVEzTWxqMeoUs3oPI3Zy3E4SLF/v8lm1q+7r0FsJE\nzGKLAQAeNNpp8cobb2lPmjuLoTbRR/Gw37+tuz8Xbc7eRFjo4Tg8PR0IkQqX\na7KI47l/nIQudcvZ8r7Rlvvl/J/8UnuCthzG+g+ZDDgvQyMxB81eo40OEn3r\nzE/QDZFyv+18YMEftGGAPveXmGC7ttrnwVRNTfCSzyLyJU06CauVGRu074qX\ne3RtJmZYRvyLGwlEFis/gLcIg9ItmFbnGbk/iKSODHZ9WujLYYoZCCrlkjuf\n5j7rdOxFRMCtgoQwr1iqk38lbqVcLD68Aij7yTjYOmx1Z81ASIpe4mCxnmuV\nLADk7HqkcGxFLjqcOWZqKgJ1TwOFQi2PDxCG8zMX6gC9sLTsz0NEBqHeTi0A\n20IsQvR9JchsNa2Xo/5mJ1C7HPFYD0ehlZgFa1X4YSG1/QqddcFxE4ol9OpI\negZhqbN7ANALBjcmQMRbcv4A8w/6WAHyPrvvKDu2KoMOXSC5RMzr9/+1v/Z0\nQqUgXmB9uxHnjXljFm3d0YKUWYWG7TVZ6VXY/Etk5WPeQ1GqFO16Zzm+b9WT\nDCg5MN1D4CKBVMP3Rf6YUkOtqCRoZlWIf9bbtubD/52E9C102VdWisRVxmIL\nBw0W\r\n=7Cg/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3MqHz2EhlGaTv4W5/Gjg/+G+X8NFIKA6D2LR0v7HanQIgSQNiwjL9uCvTfHhKLRtle9V2UtXYjUZ6D9FDif1Za/k="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.4c5693cf_1538479131523_0.306204386426715"},"_hasShrinkwrap":false},"0.13.0-alpha.6c2dd4c7":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.6c2dd4c7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.6c2dd4c7","dist":{"shasum":"d3b65c5a1c16606fe9b601432be8c68b76e8f82a","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.6c2dd4c7.tgz","integrity":"sha512-p+3pk3kj3A4aW+kIsfEz36LvFlESkNCnkF/HQ+Q5hAvQOCSyX0tnV/23rBhn1YCrHNfw2GfclehInCtoaSTL+g==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs6JMCRA9TVsSAnZWagAAh5UP/3zND53JX64ERzk+NCn3\nPuXHZGVQOMuo39K4zh3BHXTclAp6CeWTsjLlE7GLQbmTouArlcIW3CMaY7te\nMDvTuPRJxEAYTHDsNSjZy19lNWarCjdLioyGYwOX3Vd7QLQfy0Zh0A67thnY\noXTZICYUvd/lJocTqQMacbhscqnmrWXK8cZV7olA59AY7pWO2b6t5/v1/1Sy\nusrGFI2YAsJKuqYR0iM+DeA5LuUz2FNbApgudVNvIoBUpsTndGh3bdz5yf/C\noBTqYzQ0IcNAVBmjiO/F9/gFnG3q1x6Mv0b13Mu9Iv3h+GbDPRi/uzImJNEI\nT5pBLclJgsioSzJS9Zvsuul3xWiswt5mG0hoNAaFTG7hQmWD2ZECCgZHgT3O\n/LW1V9c0ICxyFBwXC1lJsV6R+JFWzWPau1yQtew6ZdTUQJoEjwoi388PlWIt\n9aUiGsVCIcUjyjh487qEveVZKk3GLGPkgwHZtcpM8FqKBgovtoFArYRPAP59\n/wib3ycwMKTjG4BK0XYLEyFwMH+BhsUwARqlg1AZH1BsSMyP07G/d3QfdktA\n0A4fuU0VTXMJuEaHTNl9s1YXNOtxgon0G8lG0rprT6U4lGh4RxC/HxnxivMh\nb+TeZtHOMA5xorTsMPYzWN0ObI88F22ARchWG97FUIwfZ8piVRRiD3BL1AAC\n740g\r\n=qXK1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3i1iPIWWRFzIoraIdzaJU26lwtO5H2KV4JPJecplHJAIgKDGJJWiD4a3Ix/6XuIBCyAhXjuY5kcQW0LLfUi6Foz0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.6c2dd4c7_1538499147957_0.11342392667265178"},"_hasShrinkwrap":false},"0.13.0-alpha.cc713899":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.cc713899","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.cc713899","dist":{"shasum":"ae51179954c43229514a4e48a12e57cbb70b9b2b","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.cc713899.tgz","integrity":"sha512-SXlA+OE78COja3sG/Wl2q8RO5LjLmE+8/xwkPnuKUcn4WL6a34MMIfgU2WyCuAxy6v3dkND6M7Ts9cwkDxaoRg==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs6rDCRA9TVsSAnZWagAAyd8P/1dcHvBWx9J9R/lwSJnI\nydG3qai9XYJE5Aa+2U5TrB2CesXYDDPqF8Aevz0r7st8uT4vagqK/MK94CqD\nSTVc/tMGvKXb9buhoiGa1R/VfFrcbnKsr9EC7s3KS4C0MVq/YAD+C5FQl7NL\nzNXFMEKnQlewGnq/BzARSFPIFW6Iwb5+YrUrh+MGRi6bJLQBDkj/OPnSN9xR\nb51kAolWvhDS6y2uQ7VMbdHB/+cBucuLu5aABa2CX5NqSqHeofrNr/+ztGYv\nEhXFa9Yl1/XgSyIYxRguSAGaoINNeQ0WSbfIyWTZZ45V3yMqJ0kh92JrP0ND\ncYhejV4v8VZXCmKzDLPQVnyRzmU4F6wd/zuzzPdYNAqRqJei6PjpyGngSFUm\n6twf+wrhu2oIGpLRQ3iX9likMiufaKcBKNlhR/g1SqDbmaffrCiq0DZ1NkH/\n91cmRCuPUrxIxQ7YOkij4h1GnQ/Ur/a7fHVgTI/dnNZAqznIJnH+nznN8t1o\nCTyICWam/fAq2ELNv6s9K/rw77IjtDmCBIGLM1h9FFHTz/H+O2M8RGhppFF9\n1RM1IRLqs+p664kUg3iFyZv8wT31LD4gCyYNj656AUTthEz/OgF3W6O4Hsza\nORmf+pQRt5dLgPDMvsRGeaKe3NBeP1HzdS8SKV66ZbhPJ5MKhzZr3sComX9C\nBUOQ\r\n=stT0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDUh6dh5Jbqj6oOTo5NMoNopyenNUg2Ep+C2lrvn7CN4AiAjQidBU9yj42YaG3Dgifc1o8YqgON9R1Q0H0DPBbVxCA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.cc713899_1538501314578_0.94219690315432"},"_hasShrinkwrap":false},"0.13.0-alpha.5276d1c2":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.5276d1c2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.5276d1c2","dist":{"shasum":"dd8f42b1c8727959e642ddcf6eeac9761ff92d30","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.5276d1c2.tgz","integrity":"sha512-BAXmtMqKTPxYl6OtPO4PTUSM79QX0wAOFzOs29L7IbNvhCmPF20tkPCXmmi6VW5Lh+xWOue1ZnnYu29foL/6jA==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs6uUCRA9TVsSAnZWagAAXMgP/jgm/HKExK/cQsRLwiEc\n2OQ/s1kSl3uMB5ROVKN3D8uK1xatT+yRIRxFfhQ79fKA2e3PLi0XF0obHtO6\ncrWrRWjZXwviYqJnpKydSk90GhgCjopjggYs+EacqRG7xg+WKSvmNvqrncn7\nFf7bykV1JG1e88DbJkordv9Bra+wD3VF9aENyPpIYu6FZo3wXU7DjvbjTaAi\n7uCvqx4bADs4rmjArfgSfVGZzKSAncGtZJvVtCh9THrvueNl9IuXkjOuId8j\npRazhPcgamGP41mFcq7HAo2SswJTV5uGO0Nz0oA2NcyqPMg5BjDQRFalAD11\n1p+pjOnp6orcPiKnFn3IOqwoHEJ5pChFedQmWBVCy3mpUeKsTtNxFgrN2Dfj\nUoa8R19Tl8Q02QR02PmG7nN/DO9MAQYNrmGglU5QcYD9l9tG9dSM4mJDwvVm\nRNRSXXoTPg1q39/DSzZGuqIzYJj249AOaKcz154aQvjfOmW9FmACl9Yc48kd\nRNvRik8L0zYQeAsgXBw+IkkFtIDUmG5FF6t3dtTFUQH/8BSLqiisOZZkTFmy\nxBXYxLjFF0Apb/HJtbPTO6s2xifNngLA6GP0n1Taix7DdduVaMxnAfgURLHi\nllb3qml6i8m9sz9UIhWdGv9LAkR8nC8DTC1iIzvDSkzA+sx3UzivSmw4leQK\n7rsD\r\n=LZ0i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/ELpAQv6tt2iPRHSVWb8yLz/zlqRIL2mYbaxtmpYLYgIhAMHdib0a6kPPmcw9yLddiUJET4TQyBwWjitfqX02DwcT"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.5276d1c2_1538501523963_0.40360625665332805"},"_hasShrinkwrap":false},"0.13.0-alpha.9ef3d2d8":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.9ef3d2d8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.9ef3d2d8","dist":{"shasum":"580e1bd0b4883ecfd162a9ff847f42aeca874ea5","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.9ef3d2d8.tgz","integrity":"sha512-yPYNvAlvcSY8k4nfSbhOYcx6jkGPEDxHvTb8bLAguA07dZXNNCs4924cyKrXsKnCS1K9XYF0SKwWL93YGIFAGQ==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs72OCRA9TVsSAnZWagAA+LwP/2TDtJLkemDpQUwL5Wyy\neKKyasd9YzAeTUojW7Ck/Etiv9aRGJXNu009NOEcFds/YDZJVR1NWe44A52t\nh6Ea5eEDvZU1SV9X3r3yfYGpHdA/C5FpawIdxlxCooJgh0qSNbXXbnD/VgrA\nPPnaGeTUXaKi3gbzBaAmZi4vXWFLy7pb+ywXqL3U6m1yyHiDt6B5HI84WQKx\nltuhF3pyR73ZWXCLRZ3u7cE3uQh1lVFNtjB/K6/ZjIPFUbNqmLtKFT9CqPMc\nyTDXPoFXzisVhFzAOQjRV1KJtnWmWQitFVi6KW/O81AjgD6ujbar+kliYsTM\najKJlHrYMYRYYO4eAbsomwIwPbr6GLpXBwA4I8Y92GZS/04apQws4qpEoKSr\nOShT4uwCW9DbDPJ5cEMn7j5dsW3kKx1sx8cgUxzQlHA0UJMjwiNr9d5KVCiV\n4PEgJiivSfi1zepB+5H6vh1upcqK8XtaP7lPl2j9i7cBZPDQfu1LhiAG38sK\nKwUy+BMTb7H5CkyRjoAbpVPqd1L63/9GHDUY9LHeZuTEKu8ZvVB6uzEt2e0v\njO3ecisuQso8dziZsAkhxm/fJ0AoNFfzC3sHbNY+gaoWhYCS3iIxqs7jzJMR\nadXbUzxFDFp34gBMMiu4byckm0oLA/p5jj3xUqIOoxiaWOLa7UMrSXhlwBEj\n8YF4\r\n=PPYg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHrOYq3lbzjPRiKGIj6IrG7XYvht7Hf6NYGdLF2KPE+gIhAJMwDC9TGHbaVMqx0YuX+B2XDlbd3VcHhLcw/hLlZZfX"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.9ef3d2d8_1538506125568_0.2393282035766333"},"_hasShrinkwrap":false},"0.13.0-alpha.67178b71":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.67178b71","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.67178b71","dist":{"shasum":"3680445b7fc3ff5ab3f792c3ef4d7f193f979d37","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.67178b71.tgz","integrity":"sha512-BrgNF/aIqMec6C6X4fowUdqwvgROWgA8VyAaiJNPFSHfWiYnbCuuY/nrSkZC4KIyiULM/N3Cka6PXYYaf55Z3Q==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs77/CRA9TVsSAnZWagAAl78P/A0Gt/yr2mOKo+52yJpc\nh/hqTVKjAKQlLhfKNW3P6GAPPvLFVcOFe4ZOzYNWY5XTOTaVAFjBB9WWHlgl\ngvN2mucw3FV6/U/ImEGs2WfsjLznvTUVjjhY1+rViRwfiwmiuTAFxkrVYwfu\nn5SbF03uBZ4bjZ+IgtOTqBOS30Z7yV1hMEnjTFGzANHg62KkII12UNGbQIGq\nCAHJ8rtymKvEO5fBXHBs2/RPoi96fwIZpq5/Y0OUCKSHlevfgab1jVBr9+DR\nLu2Ikg6JmFaQbZlE89+XQ/SneK/R0oKUbHjb7oLxkx321cLVPMEJxo3AE9TQ\n7UJ6jQPZadKlMDusGpepCJXhOIGhCXQI3pBv+yVTwBe3WxaGdynvCq8Ls++E\nAfP+X88fbr2HLdLDxPpRWzy6tyEPID/oGgHHBUjsIJxRIu0HuT6aNb7XU/Cz\n5eunCv2tFg+8wYM+yTs6qHdYz2zKca8eMgaguq4iBmfnK/HQ08u7rcs/bdQX\n1YReLsPhxK9xcdiL9b21GquO9amiGJ/PkqMwO/B6jOIs6gkBvCMokDwBxOSv\nl9m/P9sYF1UQzyyjOZkIATqrVjLRWlJhtjE3DeLAl1SAIkDDHXyVSOv6y/M0\nYZIOnKUVzlHnXrWnDk14FQNV7mL+oUiNVUCLvxO+Hx3tGZM6IJijXhvUojdx\nGq6d\r\n=iBzJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDBZjOcD03zNwlkw6F7mRk6WNQP5d5jfHQ+vQVKZ4fNUAiEA0que/ewq8YWcOeWn6WhxKZw6RE7J6bI0u+1TBJ9Lhcg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.67178b71_1538506495133_0.3157315865743091"},"_hasShrinkwrap":false},"0.13.0-alpha.827d6cf4":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.827d6cf4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.827d6cf4","dist":{"shasum":"6db9394e89a460e33b78aabe1598832b2b1c9ce4","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.827d6cf4.tgz","integrity":"sha512-B5X6qB/fMk3+BORmEoGLUY/5cIOhE4wvPVdbABGw9MAINC9AWyVxkM2ruFrhEGKvqF/JK87HU+PYw+X2Du9wAQ==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtF2zCRA9TVsSAnZWagAAIA4P/3vEqmiQ02bqnIonhuR0\nHFtfmLxGIDyr81VJ+DLk0Y6DZdHScF9rknkHOnn+HvzsGfxv+1Xq9FCh6hzv\nhZsNiYp/kJbs3jgNHq05PNsp4tT45bYp8HOwHHQeHEMK0NYr/L0KoIWuDZZ6\nIQ7HHBHeQoiddDf1uRXFhIeLhDugZyTGb9WZhRnU22oPRbsI1PqKEefVYEFJ\nSInf9YRAdYZWefigOquJakRpgiW7qRQVEroQcjvwYskOHynTPUVEi454lbX6\nNLRtiYCU1CJSGPyhKqc3KgjfL2WUfgRqt2X4KBt+k3ASc7fJC33qnEL9lVdC\nNzfG0ukFpPa5fFrO3LPCDGoTg+rJLgJZG0QoJY1RWpr4Zb/ghFnaICIWQWb+\nclVLLNwt0RIIxFgtEObGpZe/CFYBLYzBwcnr7+91SgGuWbyLkS800H5ZI8pd\nXBhfBvnESFRsZneDUiVSMwPHrxnzGY+OfuqaozC3AW5sjEnMUW/mFihVpjc9\n6A4DmwynWCDsn62gq362EotM2ouB50appyaPH8esRU7yCIcNgazaPLmiJJtk\nGCvdgfsIom5yY4C9MJTEv0oTNsRS803vOF//yHsGWIqS2GEvkeOB6/TdmabJ\nVc1sxqfkYVu1SJ2bFxkhLIoHvEMijTHhFnYxoYPAkmWCvt0UAnKfjusyHf4f\nlvfE\r\n=ZNuD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAWO0NXRIH1PhNVrmwdhJN3Uw8nM77gTx5qTVG8dx56KAiEAw0qaVaYLfk7EEM1SpezbrqXjYiYv00kDLuqgIa0AZkY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.827d6cf4_1538547122066_0.10027245528186834"},"_hasShrinkwrap":false},"0.13.0-alpha.6b090baf":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.6b090baf","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.6b090baf","dist":{"shasum":"f456c6f5a26a23acda98e4fb28c3eff436c47dbc","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.6b090baf.tgz","integrity":"sha512-j7SMjMyErP2yp9/dTSa2h4W6+LW9lsa4jQ7l5Herai6nrGnMwXDQRgpqa9bZL1zPiiIO306iboUIXSMjA3roOw==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtF5mCRA9TVsSAnZWagAA974P/j/QjvaSqoh1gsMxIIQQ\n5JVdULO0/LMxNQ9rxAFRTSBwQ5seKizzazJu9OA92fsqUCBPRvqziF3c59Vi\nHk5skrB9fx9VmxJ+K7VHVZ8e3cNIQ6bpWm7D1iORhVS/6KeISjki0a5dOtZH\nT+F0nH7aJoPrfqXF3wzKLT+UEnJH1xthl1JhHNPbNawz+OKTHZwZ5rAuS9Gu\nlkqmgpdWrBPTH/7trUoW/zZ+imOpS+XGAEGP0K8YoJFdn6eytCABSV6nZR6c\nX97Oo1tqzLJKP0d0W/VcHi4oSrh72YIRLRAF0pMeq4/KlS8Mpy4TOOvo/qW5\n4ENVwyT3UPAMjR/pL7i18znSJwczZikf+IfV4ck7ISg71tEMPwXSe1E7Lrml\nWW1NiFkff/xxOh/a5bzYTAZ5RrelTsjTk/ESwx+3qNVutoa2UnVwZWWTL6Yj\nrlEUU2Li53cxxBmIakB4SFjMKX9DXKnGwUxYfjAONwOpROTGM7GUgBDM+GJb\nud99l9k8cuI3tj43gtBzngCX3ngedgNcAiG0rvj7vbTqfbXE6Mtoiljt+KFf\nvOizT0Yb2Hv7CwOU/K6X2FzDifYFJEQVn9SG2BdWO7xs5UY26ZvIjx21wWC7\nkeK6etHJb74dZZLf56wUEznvrFJK90RgkhWU32FbZ5pp1i7kDIedj3Hs/Day\nnlEw\r\n=K3XU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQpcvAFwZP3b86iVyJ2NedABJ0VF5xTyI2KhOtnd44NQIhAIuvVD+trRrH+b/aWhOjtKV8np5Fd1vv3rV5AcNKMgG9"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.6b090baf_1538547301671_0.33903035121821556"},"_hasShrinkwrap":false},"0.13.0-alpha.64db831c":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.64db831c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.64db831c","dist":{"shasum":"2489cb6210c3439c56d6b2f6aac4cb9ca15f24a6","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.64db831c.tgz","integrity":"sha512-HumeAkGH9wWbv7Drvwla1i7GftlLa+fLUvEtCX3+SaEyTmXS7caZn6W0M5frnP9TxR/DFZc6zLE3AYas0/UDPQ==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtcejCRA9TVsSAnZWagAAh2YQAJ8Vs5sGrrmNkP/oFOD+\nQqnn+jiok2luY7HktR1eoUJFRhjEJmkZIurgnAIrxfBsF7v4ytIoj36QQ6YX\nAcRPvyI+4A0l8tfPYc1G/OA6lNZtqdtXUOdbYl9VwAuwS1BPlULWvULBtD4s\nGZLCIfEyq4uDrPBMQTX4RP1w9dpnj6Ddw/2gh48zPzv5I02kqzDYKrC432tr\n9ziWyF2KnP0B2mmiOr/KZ7xsHSlASZObjMsijckEeaypNri/ertsbWDlnVpp\nQSyloKIADXAHYeM7Bscuq8M3LrYwqQWrEJi8S8p6CDXeVarJqOFQ/wV8ah9k\nfIenyqC/FbZwexKn25amvbqFFAN52oBeT3MZ6Ha+po/E/2aIXvOenWok0Zfp\nia5XUnnumhboEO7viK7m4hyCbrrewCXuak24l8EugAKnd6dqisITUbixXL4N\nhqfQrmcYHzGzHyrjh0c9R37fqLST/pA1puLrw1scHkmWGiC+g105q4wOoOmc\nRJYt8gp2c0qyTzsRAKsqSv5026lYVa4IGTWMtjpraXtfWphjIGBVo3ubprgW\nX3TSZfAfhdZQdU+qk3d2lb3gK/1dApAlCpgRfW/lLsoUrMwvEtp7GzSZGQLu\n5kZq9LHMM0KK9n1H93eXP8q8OV9n3qIpgofpEFNp1iVDOqxv9oPPrjwKtz3Q\nNDEj\r\n=2yEs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGXGBT1wthcBHr7UHjJpQDDVLlV2hhY0z8ujYhIOta+wAiEAv1UyfFZO+l/It8qV1bKlAfk39/fMhWY5tO3muxm9qsY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.64db831c_1538639778485_0.5426804856753311"},"_hasShrinkwrap":false},"0.13.0-alpha.21eda4be":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.21eda4be","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.21eda4be","dist":{"shasum":"d9625413bfe625c69edaff0b3de0b147c3ba8cc4","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.21eda4be.tgz","integrity":"sha512-I8PoZEKjwQLphoaKjd9eZNA3u+jRh46joEzKsuANO7GjZEdFIErQW3gZ3Mui4TzUXMRFLrCQg6H5SoQYPaoj3g==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtce7CRA9TVsSAnZWagAA6IkP/jzdyVLRtogbIao02hIK\ntfICCBCtq3WUKUvFAfR0AkTq0aDUXSGtGveH9jqd6ZsQ+piw+K9PBAhChdCA\nrUEtjfDIRSbOHkS+otv10eGz9bb03rkJclVCGtYgjWxCCok0ED4w5rDtwyft\nIgxjhm9QXgtzsQENkncBg6wXCKQf2Cgc8+UvDwM9mtYT95rVztnUW3riHkxE\naimnOiIOilPFJONWBcfT8/Zu1/ByUttJI9t7glBfwS+eXWoRuIQE+1n8cya0\n6hS4V4J8RJG0sXD2cSo8g8HZDv/GFTZPurHY3sfWaUvbrDyhuV+qV1iaQWCG\naPMzAG0ISdnfT1syjkmxMbwnp0n6EeLXhifAe5kDuOXdqEUcuWSlWl7ST5Jy\nNB0wFRLx3EzHyMoCpwXg31FOvGQXAMY7OyHQyBeQY+LfetHJl8MomTNP0hZ7\n8JSdmzjh5ycB1t9V2bk5iQXhgeVTK3QqbkbK8xGvLtLh/9u2kYncLFbY2eh/\n8aCjZQuKbcjf5esx43r14vC22ADgdX4SKRZHHyukyuIGG8MGgXeoUw9kqDTX\ndx3NoOdGvMH2uCh2P57HKNf0/2pqhl/GUDBzgS/6tqS844sx+SsxG/yl1LuC\nM37lCqJAe66wza2RqsIlOwpBdaDQnc3MtXJQ0w7+hgky12DxGTRhthRuLKB9\nVbp2\r\n=1udw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB5ZueWQtyIOeGOa26jf9RQ0/8TYd+5ZfArSEATsNOlwAiEAg7WxfCsz6f82ytOHVK6QliQBiWGzfuvQqEGzSnMzOHM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.21eda4be_1538639802712_0.20914488819032906"},"_hasShrinkwrap":false},"0.13.0-alpha.de54a1ab":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.de54a1ab","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.de54a1ab","dist":{"shasum":"f557e49adb4c0a41711502cd979b1ac1c08c6d1a","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.de54a1ab.tgz","integrity":"sha512-oyhzPwEVKuTjRhsaR4GPy0DVh0ts1gLeSxDNurFZAC2m5TVcD79Ui7ogVMKqdrdsZ0PQhFtmEzqb2+6b2LuvtQ==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtcfOCRA9TVsSAnZWagAAfG4P+gOBUca7f6deYjlp2MnU\nnZTbA8W40PwH8OmaYBcy9+CFlncaZezwMrtcv0IX1xHxdbMYoPVkU65wEgtk\nD1WlRfSdBjCnlP+9g75IqYEzF1A61IosohiVavSRhBDTgVibsWc92PZA0nPz\nENuK9V2M8c7bErKkY8cpRciwYQA1yDRcrN02SC6MX040vpCviSjdHXFWzVkp\nwOH1Wz/jyCmmO6MD/A9iRXGNvT8+YjjKG31j6601xJDZ50QX8LfwMnuHdDsL\nlGPvTN1kzQR33BDQVZbXgiknrU5Q+1fKv2ybHLcUO4celG9R2vypEM/l/4FO\nRLBR4sKY2/6qQ/NdDwfsel7jkMqSD4Smanwtv/Ofn7XoK05AUgR5XM3JJPEg\nNrn4d/lBAehjLMwY2pzt2SPdI5VKZY80Yg7oV51XhnJiFMneKR3hQq+/6B3Y\nGxNFOUh+3ccuHYYuNNVyl4dZj0J8e+EfcFqNwNq09NBMnO2j5AXfciq5XsGM\nB/dhdfytJ2W1Ec1ygIyN0OrpGyiV3vtsqJEeAEUcoeIbWEe+ytjY7D9feAO6\nilaA7mxPvrxwkKxzxhzlDWmBOk4ROqyEs3te1IfqoXWbQxk4MMVyfRCx7cTi\ncYXQg9sFaQPLydjVJPOaqDFV3ObdJDfK0cnrD3hOARa+VOxZpFFWsLeM1bVb\nDWjW\r\n=vr2o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwxez9pkaAXWzDceLvTgGDtWupfACCIuoizzfWNRzH9gIhAPiQQ0KGNtBUCwX0ujH3P4VnzJwofvmNLePkGYy2iU+f"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.de54a1ab_1538639821181_0.32475832291104223"},"_hasShrinkwrap":false},"0.13.0-alpha.10ba15b1":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.10ba15b1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.10ba15b1","dist":{"shasum":"69af3fa391c8bb78e3970f54d5484d2866f70939","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.10ba15b1.tgz","integrity":"sha512-WMyTlM4RSXs00BBMGN9tcaRZdknCTNYRfDilyKH2gHfIkup0S6Rl9B0jy+s1F95Ef9l761z7E/VMFNH9wcEx/g==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtchfCRA9TVsSAnZWagAAL34P/RTJFIWsHauZWDTchhon\njeEdmUkDqBwqM2ddE62mNpD57vPtn2tZDe2jAfX82r3l/lRDgUMUMAFkNHpu\n8Wa/nSkwKSMXL0gk/AhwSaIOYaAAHvbg0QE0eENdaHZganX56PMIG7k5EENd\nK5t4KLa8M9JinZ30dZZB7IN8ZRrRF1X2WSHy8CcNeWgMtHrY32TrM3vuHl24\nD6cDTusUVzQKla8B5eFNmX8dzNlMpwPpiXsOPHuZ5IuwxCwT+520ErNq1Pg6\nRNHxSw8idmgPhf83bkTZqhjfledXxIVzBNSeMdtL7aKpzPS3Hd/Eeq/ld72Y\n/DN8NBMvVX49IKDs5coSbe9Dux2nRfeaBxdH2y33k+fM0wpyM7kfLj+HTHN1\nzrGRfNQfts2fis6cBTQjNSmqNwATStaCvDL3eML157SbuYal+E1VAsU5Ly8H\nXU2YNRXGeVIQVzyafQ2TBjkAl3Q0X4YHZqGlB3OhxeUrTGY2F2BfCWttBjnA\n4rUadrdp5jxkhB2aJGQvQiWoPGqcQZKKZWSXFZja7YHRbWdu7i4WukEPoJaZ\ngjapkV7Knd1Eqmf/I75MmRt2Uq6FlWMYDMzPd6+n07vDw9r6gH8qvg/03fHk\n7Ktw9fuQJyRzjpzveJyZFV0Zqc/XE9/il0x9y/d6Wq8xBRbaCkiF9f+1FN/d\nhzc6\r\n=7Ofm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1mVc5uyAK2Q3XaKErEbXXQ9b1ebI24Ijs3/8/BUDnvQIgdbuowyIvj+DiO+4CbxMRg4yowM7cighGSVUPXt4TREA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.10ba15b1_1538639967013_0.2963265082453732"},"_hasShrinkwrap":false},"0.13.0-alpha.53d0f6e6":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.53d0f6e6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.53d0f6e6","dist":{"shasum":"1b6b0cb1575fac48a4a310a4cbf81fd3bf3b8b14","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.53d0f6e6.tgz","integrity":"sha512-aLbFLBAuXIVfcsjktfveUfC5npWPJxESPGsC9df0JiWBD+/t3ksp3KAG6nAp3hksTR7P2naCCieEe4cpWvZ9Qg==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtch4CRA9TVsSAnZWagAATIwQAKPx1wAZfg+nB2/iIH4D\nDkUf6VffwnnlEHXdwYo+mSreY/hoWbtepuMMpWP+/d8bZnUsJKkdTXbrYjzj\n99sKbuxHPYFCwiXumUrS93GJjG+3ES6+jDxW+oaDxDV6wFMAO+qyG21RIIXh\nWWsVXphCbXZC+YUNC+41TsVYB1d2tWhdbJ7inHGtjRMxU8W/RSTRudmgfEG7\nOwcS6hORJNfNBL2LLbIjbMxP5XVU4RcydQEkN1ihlSMr+w7zf486J4DaKbwG\n+w1KdesYjbly5+rvKZUfIICOTMT9eXixHNP2CHOOAT1O/P+AWjywB4Kj361G\nKX77eR/e87njJ65Y+HRmfnDzpCw2VSV3w0Ll4pRDkX/y4JvqSyp4Z+LlL6uM\nP/EStXspIoTndx//inLRyWytjQS3hxm6nlQae3EZi4yToEvd8sXtcxkyp78z\nwwYILtXQqAlwkpXu153S59W4FYFjeW3oT78il4yJTRlFQEqaJUO3s9rRoazO\n7dAfPzybycPipvce9FBATxLBjBRRhoT27QieQMvyeEiRN05a9cqRgn5x8RSA\n/6T/yaDd2JTxXaV2VnCi9+kzsDfVFKLZp0ZjB26EBNGVbaOBNb2bnq3yvN2M\nqGq48VGZfwmUwKLhH9iagrqHqYRhTpXQLyZqRYU2nZ7HkwUF9MCP/BSs/0a4\n4X8h\r\n=drSZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuhuPml9HXznsLLu13MtCitcJly4TwT4PG1wY6SnzsrgIhALyAlrDKp29KbsUj/oowytY2CwQNNPijcfSV1yUyBaLi"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.53d0f6e6_1538639991561_0.7039261794384783"},"_hasShrinkwrap":false},"0.13.0-alpha.dda39b74":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.dda39b74","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.dda39b74","dist":{"shasum":"b93a659e0216bcc2c4204554ecb7eaf74588f323","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.dda39b74.tgz","integrity":"sha512-9lI7PGHrzxkw3D8K99PzR9VQdlelg8R1Vc6888e+fCePyoYBcoKd5wh0b+kIzovIHrjB6zyVuimZaFByiC1kag==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtciSCRA9TVsSAnZWagAA/zwP/jjLpK/lzDf78C/uVkH7\nb7iQIrLqjwc1Wq8sHBxs5CPBhEg0bmN8UTCh0imKL0pbuq49GbXoG6tGDnAg\nIaHUk5e3TCR+YqCM2WlkITPqB7olFTOVWSbqqEmGDYeCxqAPfRdjc0vOtJF2\nAAvTVBhajivjI+AlPTB85/PAS5T1VB8X7r+T7XhOKR93sN967WHfWHKIbYjK\ntdzU+sKaDAbnsQWxfti/gtP67MuGvA418ptogCDwrutK5gNT0XQb9YhvSdDE\nQVqNmoFSnFxQ455tBM6fOL7MzZx5G2zKlGtbhwYKcHHfimdNsJufFmwyuZUz\npB1by9YPhn3WBqrDOtdkzO61oX4sdzYeZTVFKTcSsUXOeFmwcwLqnvMC1Snq\nahlbJ/6H1OGJh6AtXBpnP7Qe76JRyMZDg14qYJHnJCMHO+ho2rUTM9Oayv2I\ndl3ADKGuBbAjBqMTIEC7pBoeENftd7ZDVgueAdWeUuY1YA/th7D0lh7yJIZ/\nlsLqhbQYisa9jAjFSG4zGFbW+lBATfeKUCnloxm2YzQ8I4jFKnchhtGOoVge\njKWx1r6pcevNGaqOBnaeGWsp94c3mUXGqa0k/IIphRBGdcY+6cv0+u8/0nQg\n/ogWbiDKqrZWbWl9K+/laso0Qq/1OEqBIUrfumr9dP0kdo/Z0rc6kdUjULam\nBa3D\r\n=jJFk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjlIMbm6HKuiscWhx1Zokp6aW93kfu3ZDS+wwvDvRgjAIhAI5xXCXbQEm03xihUj5SyDlZD0xckbpISTJ5FwMRp6ZZ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.dda39b74_1538640018173_0.193331085372902"},"_hasShrinkwrap":false},"0.13.0-alpha.812f139a":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.812f139a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.812f139a","dist":{"shasum":"f68fedd6414c5338dfc9025f156ca2017a9dd8b1","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.812f139a.tgz","integrity":"sha512-uo+3KyUwJtNJvWISCpakZweyAs77BUrTPkPt/LOaRAkFxvbAVce1LA4CD8fdOpU9flPqybY+AH/TdXEgT3Y2dQ==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtgbnCRA9TVsSAnZWagAAnKQP/0gLH6ZyuObwJI68N0//\n7oq4DdTJ0cbciehktTlWhXWQpz4VFPEGARe0uwn9ffow5lSwvT9T21rVnVEv\n7wEsPgqzCZMs5iGgpfHoEAfK7Pl5dXaOOQVRLFbjHius6t0Cebh+mDpMjW4Z\nAT2cWiyNNMKP18dekBOm1gHX/tj/EalWtvHJ3eF/VOcpriAY2cz0AH4ga3nN\nFXeUMDr2D4L9eo0JnMpUuvYZqLXmMXtSWuug47VqR5rm+7qWRDbsOhJOK1uV\nVss3EfZyTbvwdoadlL35LaWkxYLfpuQeb+5i3X9ewIL4NAvec+qISdxO3Rg3\nTEFgaIC76dfOQI6eFVn1ZxQFeCDZfroeUfNYzuCqlXLR5SjC44rJiaHgJ3vS\nt+b7HTAeY5zqIXqOYypP6E0kXAOaPPW/ql/Av6Pm904Cs6Evc//bwinEbbtq\n/WnfN+wrVrgdvosK+PYvosTdvn5j6FCnpVyQEYlm/IxR2Hix3+VWvjB/COIv\nZnI0icC0CLUs8ACuKQf1bJxKz+JTsWdFN4aw5CyLUACH7AbYyWF59J5oNSfn\nh+Xt2rg8rESgduoCqNVcmJ0PmFfbN/iT1iwsjMc7v+Xfgc6d12iKDaHJQ4dT\noMC12i0uvQPr22d3PpbdqNi3INwbje7kD7RaNi+cIJ0XNBz+whIfrOvcrJU0\n6P2q\r\n=RTeG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH52WzYk2CNxyO/ZCxr8XPROLlWe9C9TDyGleE/R/yFXAiEAsMGRgUAmstiZdujH8w9uIrNRDcLLWTUGeNRzn+TXS6s="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.812f139a_1538655975151_0.24001050315449746"},"_hasShrinkwrap":false},"0.13.0-alpha.292c69e7":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.292c69e7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.292c69e7","dist":{"shasum":"9ec905169c9eb447ded1b9760c1dceddaaa44198","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.292c69e7.tgz","integrity":"sha512-eOMi0qDbDyqb+zat4ZntwC1PD3xACLMw63kRBDvhME/921u1PuRue033dnPZyLLJ3a16da397XWYIICypPzB/g==","fileCount":22,"unpackedSize":17841,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDx1QKWeIdgWyRXpB2G60diGeMDkG23XWq2FuYSBFxZ1gIgOSVlx2w0ZDtvbGsYV/Y1wwB8DAZhi0rTHLyBvg63tsk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.292c69e7_1538656156510_0.9632131499897123"},"_hasShrinkwrap":false},"0.13.0-alpha.fbd5cfd0":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.fbd5cfd0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.fbd5cfd0","dist":{"shasum":"1bef21eec4a155e09a83b1998d8d8da71ebce055","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.fbd5cfd0.tgz","integrity":"sha512-H1mwk+M9QhHe90WppFrTTdbxRHLpR+injehASJj3q03Whbr0jFAeEs+RUCvFhAVjVYaskLKtp1izCevLZGt3iA==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtx0DCRA9TVsSAnZWagAAHWMP/jgi0z0zaR6dWDvKjyob\nxFCGLOs5oz+V1dsCW+DH2TMijBm0NYXtqeTn13NhC7ccg6xirZykq1qoO7g6\ntdyEifW8XZrcQh2pIaTZlWITYohYVGWxnd170jUTYERYXfINaRX/19z9GXkQ\navQkXInsqjmsii79Pvr5MkT+2jSOlVKHIsArHdJulxLnc04YOV5Lrd8soJlP\nnQODfxOJYyHcirfTTyi1nHMi1+5eIGUNvyW5hanNkXYFvr9QFKvaELsBqLnm\nEmVf1iBCdMx8EMza2v48LEHstC4c7nWFGg7A8MOSfzwzecOEu24Gn7hc7Rxb\niG4E+51wl3UaUHMRZ+V7oaSZaXgQwOf1s8nF/fPzqVePUjrGbCn59n4GC/2h\nda/za991my1kgFCR1xzIh/PdbLzV3I/xjOgxR7FFNA4UDuwd2qSxcSnO6Vs/\n65CKig+L8/kWbC2onEwcjOmR/0hLKgYZRbZfFn6xh0mBGmZ8SQdnmcBi7Qon\nFcfZlwn2fPybi6tD0vJLkNa9v8AF7PU4o3XZ76PFxMA62I7mH3UwZwTac4yk\ngF2nmw73efkdUhoHjJ30/D8gbfwdd161/U81XifiheWSWN8JDwDqUcKr/PSJ\nylsE5XM4Hzccq8JJI/gYK5x5zCirWdccHwdo26t4hR6OoqitZeYTEg7f1bvL\nglia\r\n=XDlD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDDCYwvyq8Epy5lmawP8+DTQQ52hr4cKgOSk+w/SRqHgIhAI9KPV5j/Z+HnCyyMEN/hyoJhHMMRjPr79QG0CPu8j5A"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.fbd5cfd0_1538727170228_0.4173097615455843"},"_hasShrinkwrap":false},"0.13.0-alpha.70bfed7e":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.70bfed7e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.70bfed7e","dist":{"shasum":"7b7ec6d2ba26d54a650290238bdc02d932bfc34f","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.70bfed7e.tgz","integrity":"sha512-VTbiD125jbToGheMIJWAweuSudGrx+dL5/sc/lzTbujnln89iBj2yYyyHw/iBkuOCMgLKV+WUInDFO9/l+CEEw==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtznxCRA9TVsSAnZWagAA1wwQAIWNT+aJd9xeji/XtoId\nIUvkAENlUv3KvCddghFc537S14cnBy29qNO0AtXidJ8h5MLnevnSzNQIORel\n7zcdYGgOIc+YXRhO9qIr1oFr/CJBY+3Jb6J2mcID+1l2kFJoppDy+agcmKBc\nL9PeduGnihcII/6m6lIKKE2XHH9+kweeQ9fB8syrJdW/B3J/S0LTPjXlqPfq\nrIIirMPiwM/2KpT4Srv0eo/HQx+nLfPe7IRvWT7C/ThiqzDpYYiPWPm+2Hqf\nwDvsxNhVaHV4l3Qw70xkMxdv21un8kTdJNvHKy3dKj1ZXUzZEFn+P4n+Axpa\nEs6KH+QjZZKM9cMXMpGRsX07pHNGAjsdVTpSQQQDcl7DYVWQcoIdXtjZC4wO\nKcyQweVztrxw7EqBXMwMau2GJkgUfTiiCPBKBspRX+7DH52RnVbpcONWXFUE\n4En6FGRUVVeOvR2kKUI+BqKNNQTHQraZTrKug2yqiFNq6YKlhfbZKa0Jw3fa\ndrX/SIWyOMB0Z3+LwOc9XDqn26PhuHSqa/78Bj6ZoaWNTAh3o7dLEykj2zU1\nlq9Kb4lgF62dmdeemJWnqGhCANBsLM/u9tto1BR13D0bikadzOaqf6dw/lXE\n4LpJfKKvJ0uqdWhCz7fVRKMHZHzE6gKq/LODaWhpsCls72RaN8hLLJYQbg6d\nQDo0\r\n=1wzR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBQcnrOoz2rcheSPIt7bzXWp+h1vtQ/8Wh5N7wwP+nBjAiAKQITJsRJGOmrfLu7ZlSeCODBFxZ2W6eJfZvUviR6VEg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.70bfed7e_1538734576768_0.6973780559390472"},"_hasShrinkwrap":false},"0.13.0-alpha.f84c63c8":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.f84c63c8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.f84c63c8","dist":{"shasum":"d6a1177b8469bc606ae65bc28eb8b965508498d5","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.f84c63c8.tgz","integrity":"sha512-Edo4OGQyrLCgzMvm19Bar2uBHtWYX7jijnZGRyXVsvDyANyX4Df4C83cFSZ9YoZCUCk8OpdjmE2kIPXKnqKapw==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbu5nLCRA9TVsSAnZWagAAB44P/RACG5KQLVjqhgujab35\nRb/Z42V1yRf2mLo2qT77npKu9om84KfV9dIxEf6UVeaHDBsBisfRmg4P42Wb\ntP3e+TZeOtRQlJ+C9sG0NpNuO3sUS6L5oj4c5CKtUNFOSBafT++RFPCgnWnW\nkBqleiJy/mTjzpaZm5nE4VIdbjl6PIxzQUX/6Vy0yROx9xTap2ucW4x0GNqS\nNdt/44hIal+HtF0d4pepkJ/9TZQWw6EpnozZ0jj6G7cOssYiyuZqZLgkBDmN\nY9cZrYXafpGZz+5LaEVhR48VMwxvU75oaif92MvoRbN+d3Prr7Uo0a3PVccU\nN9GrsUjjpqNFc7GRYaoe28aY3mBvS0T8cn7Hf+qeNRbt44NW9adRa5QWXi8C\nXpvrpNOzaDWhT4faQ3R5YLVEUJ+JuGaH/cnC1NdvpCHJfd3nDD/ufOxRySYk\nb5U+CiPuXez4xcgAGhW7t7NADGYOnh/WV6NAK8QEWoO0eVEZC9X1TDCOzJ2M\nty4fwC85Qw6BXnwp4WpgZhvsZTJm9fGoCbqowO3LoshJP1clHaTf6yzW2RHl\noM64AebTPE2MsD/ndiqcBfweOmyRSfxVdED0RGSQoXS1+UCjBl84JyZe59Ut\npiJNRbCYNEkDd4BcadqbnjQbJW0R5p88WlvTUnO0is7IskSr/W9PKw0vzls+\nIwPk\r\n=fi2L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID5ZnKgxHQI3uEScUAPoal8CDeRbuLBCBIJFf35Izx5kAiBnpbWEB9e3jFTsVtNWDUP8eMpWkorm1B4e9rARdrSF/w=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.f84c63c8_1539021258257_0.06704049989709815"},"_hasShrinkwrap":false},"0.13.0-alpha.34876635":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.34876635","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.34876635","dist":{"shasum":"e3e7885043e6de392bdc44fb6dcdf409d0b4a6a0","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.34876635.tgz","integrity":"sha512-Paf+ojZ7VKjDBmQEgTAgN+3Wm/JmNHfnSLoc/Uwues5mKWdI84MVOubPUTMy/5PkijrJ1I2X3CNf5j5d1U/Fbw==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbu5noCRA9TVsSAnZWagAAC8MQAI2simz6SX9CKN6zU7bG\nCR2kW+iY8I2uMJjGp8MCtC2s1iNUxK5FEO1QanOtVofgz3rctk56siGXhPlD\nqX6p5fE+sWRLOHoCdeI5aoXjbG6qLxH+ZFY54+XFwv49NRD60GigBGQCWFPU\nG13xir3tyEaBYlwYG0JX6gDNrah5ynTqGa08DSQ+aNiLcUxjCzgdoZvQUABs\nrIHz4On9w8+BZnLkqTbShAgQv0nzTeDNad8pMeW7vSR0j9c35rC12EscH2bI\nQ1pxMQ+B9FvQVpo0lT7ImCh6YCZlqsEbMNFwbBJJx6TWw5VTuYi1KpUSPz/N\nXoZzgTX3WoAuuuwDAFsMz84sys92mXsPUI8hRYe7lFDh2osXjJW3NAFJa8jZ\ndGG6g51Ai4sLn55+h1t/kpEL+LqXz6Ar/q2fv/pGTyet52jqI4IprJRZVVv6\n/SaIRMCjbvGpJ1H63nDTgPKb/mK0qEyOreAAoSrDKRMeU4HfL8WciH2RqSjy\n44r4uqkPadMKzMY0VhW6ucl17mUgIo6BAwvpARy7zeHSkMJBrb42ApSVt3rl\nYa/f/l6OkqHni437YgBELZBVf52bjG3HG2iUnA7qxVwtpR9PsZdy7XC3Z2Re\nbbKaRTFPsiusaz5/NEj+zzVNYQTIiS04LcUrSE5+XyhMAkIu9pHAogq82+mA\nZUFj\r\n=58OG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhAl2D9+a1ZaIU6+zxQL3kTYc9R7FMo9kHtjq/0mLQGQIhAP0mrMjvAT9NXVlsGC589d2zg1UmqT8e2bVqonSLfIXf"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.34876635_1539021288170_0.22625784118583492"},"_hasShrinkwrap":false},"0.13.0-alpha.ce92f1a7":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.ce92f1a7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.ce92f1a7","dist":{"shasum":"a92c9a319c5a34caa7ad36400e4904154b6dce92","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.ce92f1a7.tgz","integrity":"sha512-sXvmQG5f0JzzI5GsqP6uuEvcjsPaD7WUwdc13ECSUWNwRrcu61MJsOnI8SMgHL7U9jJCZyolW4OQHIegkZUWOw==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbu9JZCRA9TVsSAnZWagAAFRAQAIy82LjjfG1qpNIVlFQg\n4IPrFoCkANFg4a9s3MpordW+/gVoUC1Inro6YWoZsBkBIRSKPflfGI6Yz5ZP\nkQIZ2A5RXsrXEIzjPDLFuM+PfbLhh2cBgBhCDBAj4oeuo4QbA6npFzq3Nq3R\nbvzdhkVxOtyRXOdHCI3B51HwyYJKljas2IGJLXt6x2QNrAO+WQPpvLZv/or2\nLhOVJQPu8gkw79HRvhUavn+/naixySD9vFjPXDz/wLexIcmFLpUs8kyOtoP0\nqlY4cFTILZt7TkP9OHJjOkWGIui6Ykf6es8nOHyNRyC+ygetFBpxvQl+znwU\nFOEEdS8QI+jkIlMvW67FvL1kcYY3MvdWdSCyKR37pUty2uu+5O+t6iLLKLIm\nL0V8dbiAJQKfyOGd1nK4dTpm8Qwb5V/O0FXK6wuT4a0NN0ZbSFZxut/Qnfh9\n6+PWtMMSFoEisc3aab1R/DEDBMxH30IHG4ReYGQz/y2UXnCO0cPiz/DOMY65\n4q7XS50SD7OOHwAD4aGhdXhr3uWO7pFl1mM4QWznccQTO7hkcUP6NBg6lBKj\nFGyuKopit3IMnyMy0vZU5EwmMG4FlogSs77DCLey7GMVvdWo1mrqwGloNCKE\njTAxlqOXAP3dTFoD4kc5hMFAGuOX127+gxuedHJx/odglzvwWjwJcTMjMyGj\n/Ycz\r\n=Jb+O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDCPK92YbF2a4+vfZuDMWBw2zxBSz1QO+8q8XRgrkukUgIgRueTpfh1qhuoeNtYeUXwVbHLGVLMXqNMAyoWxo98mKc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.ce92f1a7_1539035737097_0.6128202118045927"},"_hasShrinkwrap":false},"0.13.0-alpha.52e11cc9":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.52e11cc9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.52e11cc9","dist":{"shasum":"7eeab0de39f4d2f62ba663c9518f5b6c77e873ba","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.52e11cc9.tgz","integrity":"sha512-QT05xrj6pMFnWGUUBebNlmZ0vse0+jT0b8fiGjfInZNf5EB1eJEyvBH20ufVSiG76ZkPPiXukQClC6jMNV4NpQ==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbu9nYCRA9TVsSAnZWagAATz0P/RHqiPZ7DCOldnfbq8Ko\nTEbHKc4b77WUTcr7xO/cjOlDkguHPGtCE0FMHXPKq9X10+MXO/AKxz+Lq3Me\nyJqbPkXqI3xstIHTr55Pp42jHk3/eGpYcm+NlgQsUGY6avqXNW4qV7ZeLFf5\n7jvgMR5bX/s7PJ6qqOAA9aJhmG77eqbVWd6nD73YI/JlP7BGCwmBXJCMRAMB\n8Cvpuv8gBipBg5AF5fuvoCstwo1gnsxz3h/fkhxW1/lYai554YAswrgHIyP0\njPLeeUHSL6iXPnDK7aKg8+35wT1BTy90PU8wn0J9SBuKNlRTV0NGMriRMFvI\nZhrAjjT1W98nPvUcBMxZ6cmlN4vsB5ADTJEdW/BvoCZ/D7PBxeel29RTya/S\n2v20cufnQDlvh5BCKu3MQBJUDu0hr6lF7aNgHbcrypPb/qw6O/1VpaMTsF/Y\nFj7FzA0ZfpOefnXuY7fBAn3hnD3iuhGHuNQ0mGeM7O1tpdc73m3kkTO8iSWo\ntImVzvtFqkLvPev1gB3LGDYbErUCAztY1wf6jqZ5ktUDvp+hJFoIN4MK/0/O\nXBCxMBsULvtQ0bzKllURdTKLn84yB1Pp6aKpFlX1Ct8PJ1bEHMRt+8n5WIsM\n4IeWk/9BNRpP29V0aqTLVrnpr6w9AQgg4uUkH3ber1d4d1ksnWXDHvLDV1OF\nJxPA\r\n=tQ52\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoDWKkr7ZxC0UsBK8TIlG2NzskjbpXq/UYQA8DgpkfhgIgaDaxxQTr6mDhIwl5EAX3zx1OZoqsGADk7dF+FjK4Cxg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.52e11cc9_1539037655675_0.16260819543299054"},"_hasShrinkwrap":false},"0.13.0-alpha.2d5bc6ed":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.2d5bc6ed","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.2d5bc6ed","dist":{"shasum":"a4f47d3d42862d0583326bbe53802d2e231984e8","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.2d5bc6ed.tgz","integrity":"sha512-qH3zPwyx0czFqi6OMzsCmpRLupXanJ+rmrvAWbD5/S9PWs9lLmPywYciwDy/iPEEZG00PYo1n9CsnGEEo4dfHg==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvPKsCRA9TVsSAnZWagAAZHsP/ifz58SqUeJTO2tBFp7Z\ngXhLN7XdteWApv894o8+fvU/GTKoflbnIIG4OW5DqVfIZv5PbWM03qbLGhQt\n7OAhlqqzzOwPdj0lzSEG5a712nvnfSrYEMouaDipDZJhK69/3/F0gyK0YuUG\nhbNqlTbA2FI/tOFbhE7EEvgAqV5+kzRt2gn4hypz0vMbCCzK//FmmWl8xc29\n5b6BauMwdOiyUMi3tHNUnE15kwxUJdyOaKq5/Eif2TfDCZLaa/2yvLYiyTDQ\nunT1JLYBmE2e9hIXyt8M0+BaM8Wedcn0YUFuf3JRnlyssorEzYXjdRymaXK7\nr7/BsGpUsV/CeHKMdRSR2+Rbg3MCCKRuFtrSIUZYIEhGz+gJr0Q9o5g0ozK5\nVREBZi0xiKmwKyEQp/k/ZZsNlwUXUcU4OAeEanXVZr/GkF7EKSbL98nLeBn4\ntzuyQ7hCv7mI3wssSlv6WfTqAO8X2vHJ0TIWjM+vOZhtcqUhW/w2NXzsr5R/\n9BrGV4WYiyKybrbaBDbSViOqHqSlIiASbl+k+5BLEgvPhNK6czmfSmM72zxE\nvYR3JdfXOXMnSw/TemWAjU4gPz0Y5YrQ0Eq9kfFOEg6ogedj8iM9YJAlIIvx\njdSQs9cg6v9pBYYQmFRFl7I1TAkhUUst/HiqmPIQNYrZsRXOd9m+LlQ0QH/S\nJOaf\r\n=zOig\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFaW+vvuU5oCipxyDBVbt7rvEgj4tZ78AagXCrvEs/EfAiBR6K87wGLqc9VcNNRr2ImUosneIQdt6jrg6198oO0ktA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.2d5bc6ed_1539109547446_0.6840533083867717"},"_hasShrinkwrap":false},"0.13.0-alpha.3e15e493":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.3e15e493","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.3e15e493","dist":{"shasum":"e76b10819b026c34694be73ab7fce49dd087e405","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.3e15e493.tgz","integrity":"sha512-rk5ANyltESJxIIdX/Em0T5S5Gqwkl2ly/d7I6/Co4rixuTGMD6htATvR9t5HKV1aUp0BU54ZWyqNip2ZUh/awA==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvPK3CRA9TVsSAnZWagAAOp4P/iuTHjUD2HMR1ARh1zYw\npLoKvFpKtylCf7EjEeAntexb5EdP3KrArhZ6rn77bdHwEimXSmaVbtUeVhxl\n/14koNw4TJg8cmOi6BCHWAswvC/AiK7wyetBcJzXdmbf+WQTMpPcOiImpYVL\nz9zusrULYN2aw9LTvt4zwsPJseuTwOLRA1PNYjSOgN6HMH5jNo1N5wsJzEx/\nRBGyrGzK+WGZiMd0SwAnkvq5s+5YEGWAWEy36uDMCFacEsVJUR6fpcjgadmp\nmq5WA1FFpD6A5HVfOBiEjnwEwYe/y4ywAec1h7BcxnuIekX8TtyuiLYOMMMV\nAUaRhAufkC8zUtP5pqY5wVsrbfFohRjNR3R3PNTsH4WU/+Pbx/9qVPz8O4Vb\n/fAvtYWPuzTt2UAQOUuavDZqyJBvc+kmWysnfHgngHnYmYpRdEjc7OsN6YHg\nCXHfVBg0MROknWRkykA3qf3VnKLalPVpXaXoVI1prS5s58gJz+/6TLr34psq\nhfxRNYYpZBYA0JcMH5O7Eqc45YgUY9stkkiTIekHoHwg9imTYfMhpF7+Isfb\n1OXll9A6nxwdkl+jSv4IQy9FPfTB6jiM3K0RdEkzD3hvmKRGkdkT73fH6bkn\nYOZESAQExJH/QC7ljLcwr3NSxEug40YxF8jRue7f1jNGhlOE57eNIIceZu46\nvubG\r\n=r0xt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG8YuoymfFXMrohRzwsefDlCIP7feHYLgpdbB7HUDMh/AiEAgBSlXfjhW1K/zFbX5JbPYlw9910p9fdQRvTocVypZJs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.3e15e493_1539109559068_0.8664342841085786"},"_hasShrinkwrap":false},"0.13.0-alpha.3c428293":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.3c428293","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.3c428293","dist":{"shasum":"8bcf0234f9037f2aaa096c297e60b2194f630236","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.3c428293.tgz","integrity":"sha512-/qWDRLr33duKq1Z0puqMP515MbtfnLA1yScHbQH5vT0XBZOnHHtS/0fe4AKWalNK83JC10yH+2XBfW1loHHBcg==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvP3JCRA9TVsSAnZWagAAPPYQAJfdW87DMxB/ereaUGpf\ne/dRcVEiT4ownud2Vy8tUos9W7Q0qsSXIR+6KGxw5COsk3oDvaPyz71wq10H\nQBuDIww6cMJfFxNiNwoyToQnj8iOyPTi6qo4aLcuUx2JRfmdV/5imxJytZHw\n8CqNNQymK2D6d6vuW3AAIuL6q9g4OgmoVYmG6kVAvx8EXmdj++rNJPPEPxPs\n71P4vmfbrlNGr/GNXinQhOdMzXCplyiAPzicnDPE9IBwzOftqrXS7lxot4tl\nXeneZyUSfhqPALH7mm5CitUU3yhUO0sbT0UIG1O0T8A23mU4eRFnAC2Ajldm\nRSorypEUOcNrrKBda8NHqhEGCMlS6gpxOhhHu94yRnX5ZUJYdreTn1rKYriX\nxTndoNsWk5r4w9qeuCnFQa/7WFe7vy+2GY8QqYwBMuyRKeStI3ZYmMmgm6Wn\n/vxuvadwGxFUMLGeZ4zPTKlvXmq7T2wgsDFcVKDXuTgHmh6Phgb6j1yTMolL\nTBNMUOP+O8Qw8iMy9m77jXoc/LshDIOR2KQg5e6/9fOHJS8k1vRMz/DyrZSn\nf0WicKb33rB/CC56WKpfa0GqXJEDZptXohguPFWGcfNVWQUzRHk3tVLTncCS\nvsJYK320hGu01BBiLDYxVR5R3P7CDwD7Ij2IpQQF5UOruBuh/THvkesTW0gZ\nu+wy\r\n=XUeh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEj1kCYTFRVaXc5gsFbQtIppxUfXbETXUA6zYqjIsYyUAiEAl6G1reRhxGLiLqJ8+ZkgwIFtCYDfQivYU05RdB33eXo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.3c428293_1539112392235_0.07132273768433439"},"_hasShrinkwrap":false},"0.13.0-alpha.b2838580":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.b2838580","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.b2838580","dist":{"shasum":"46c863928c20a5c885d9d2bc60f4df85a487668c","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.b2838580.tgz","integrity":"sha512-niCk8UwC7ymepFPvxJX3FkFzbEV8PnjJ5NrH1ZLqaK9zDa9G3Me0nW6htUe1TvaSew19lS0ryIEiLVb86IMUtQ==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvS0hCRA9TVsSAnZWagAAqgoP/jmqmt1UXtxBPsOBsE+O\nKxAmKfYfZ5o/VqYV2xVasLy2kUSqZQsZgVaS03FWY4e5EMQhRqMWlzrzvPa7\nk8M2/pMFY+zMjthTxDrwL56P+C6P01GRJotq/ME52tStJzFiRAbpwoLAMVjd\n6MicMjL0urpqx58Zz1d6+R5SLJDElA7JBOEBROvV9G5+EI2kXfKxA1u5kXSX\n9SOHiNUT2zwa85b626sIpknkHMHx9eJAin2Fe2mU0CVNx2hTBldmjI1wBZ+T\nmHVr2eBP8y/rxJncpoaUSEXIRPoJYbfR9So1PFUDqSLfgd36GpO5A97G+dRn\n7mfM36SoExx+A7RLUy+kcBE8CIE3oGCs9kQuwDpjwO2kysatFSZkaQ2mZzQd\nuwK49kw4v/AeVcbiXxn6XDkuWiH9bYhfY5iAgv977bdT6+cnMgbmdXAWkKLn\nXd/E64hOkTeK/vyp/KOmJ6YVsz6i9kE3UlsrD2PbqcywoPvoXwnj6YhHC7ju\ndIGiyiAAHJLc7cRiSv5tFRztV66Ec0ys9r7YvEAtURNXPRupPeviDCr6rGrY\nlEugs+uxuhG5PkejqBfzWIfo+pCg8bgJOlVGCutqGFP6/wQsBXno+jhqPdvA\nMvVkDst9+joBOAXHhiozr+dm3hum8b3papqbbEoxRrbku51vXmcElf8Bv8Zf\nenPh\r\n=+kGF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHbQW53OrNPFpAHaG0JWSWE7bop9ybkS1y/1K+uwMwedAiEAkHLk+cvm1F02f1gBh65f2JrmEupyMtIVbk9OLvdf98Q="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.b2838580_1539124513080_0.23867649372146515"},"_hasShrinkwrap":false},"0.13.0-alpha.e695e4da":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.e695e4da","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.e695e4da","dist":{"shasum":"223d93a86fbf639155e30b0cfa432d5055d1335a","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.e695e4da.tgz","integrity":"sha512-sxBPoqVPVcPVMduig//I+cEmHU2sieQ1WPkn/pr7J+YfULOaWT1JCbcAW5KIw0k8ytJqx4U4E41S4JQyOxvc+g==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvjtKCRA9TVsSAnZWagAAl44P/30gHeuffD6ykk1NXKiR\nh++uD+RvUzpfJ5Fw7nAki3AsKhhWy8VQEkn/mVUxWt1ukVm/z1vbyEATsqaA\nFtF/a5GVfJUMvWBiEVYJf/XNJ1LIp+ifz5JtCrU8vTWmrDHzORgY4JyiotZi\nN2ZRQiTszqF1KiMT4HdGLBGU6tRQlbwjlsnlaUxtTFosw7L/QeTwkRILzy3F\ni0v+yJ6fYnrpOmu1QgOTdVz4xCU3Dyai4WLEgqpgBHatycCHohqPM1cbotq+\nwIqXPTawZxVaZcPa1SHZVLxj4ntLWcUphvo3VGEueh7osHKnNjk0tgzVpZnX\nRIUZ8nG+Hyl936YlTlv1aYCAxfhgqnEXIMtm5+q0Rt99Y3afPaCOcM3Y9let\noHa4mhtchyQ/8O71OZW6IM3XttqbusK1SlvgZTbg/Oxh+AZlzalB4wXxwPgT\nWqOB7hfQYYHC64ijX1Zy4cXIKd2OPS0XhNpJWhjZpFSfTkmJu0zm0BVqxzN/\nzrIOmUjsZ4RpfBSqITDJYjb0PTghbIxnmlXS24NQ1c8OIOL0i5PAJ1hBLN4n\nodYJXYhxuUZTwHPdajmHfq1qbOXKjhAuDP2zaVMazrgtvma5KWV2wkY23EV2\n4vIFR5pOp8jwlFit5xw0ywNujh3kariU1zjTNTmd6Evt0iKgbBwom5vG/2jn\nLicR\r\n=nc4I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICfafIwnE1z/jG77kDeoTp7PWHJL/gwVDLL6rLH0ALAaAiAstWxyk1YTC69hlXPO8bGaJQSoru1eOhjCMjR/gKwcWQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.e695e4da_1539193673244_0.8690323763646257"},"_hasShrinkwrap":false},"0.13.0-alpha.c15ef569":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.c15ef569","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.1","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.c15ef569","dist":{"shasum":"e4e7d804bd8762b169b297f954a5605c943ad167","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.c15ef569.tgz","integrity":"sha512-W8Cngpqe5VZlWvuDPEprD2kfuNDs8gmGXzpsOa5AvsFfOdq16/MYG/wIROFgHUe8d4DiNJGazNu+wciPXRKp/A==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvrOfCRA9TVsSAnZWagAAkrsP/iqV8fbMQCeet9UOwwyg\n6o3RrzIKzQhcaYU6kvNDS++ahlr1Tas+XHaSZthRYnin2kMUvsvMt8COnNlk\nkdH/3v9EM6aoNEj2if/IX4dvsA2j+ErxNUl9uuoyafX1Oz/STetza2SAx/FZ\nc9ey+8ZIE6Ec/GlPDYJ99cDE6y6yahb2VDysJc1+TrflIe5FHuOt//P2u99l\nrBXylwIf/msJTao0N+RYzB1Vnfz7oZf3da3KucyoQbRdJf9x3mcaSXGxUvLa\nWNFf/7Tr1Y2wOcjE4i6nIxKVQCm816E/grBuZ6LfYNxJwYEmVKpueO1/cZ6J\n3smR8YhXZozQIvN/Ceq5jjx08CyQ+ixV9TzryTrbwrVBwvs+N86FivrBSuJi\nP6RawLRlcY+ymyJh9LBi6A/R67NgEuaVDSglCk7r5nD77/7u2930ltczWB9A\n8TS9iFnWjJhc2coE0/8t5Ye8igWRkjFs/G4TgdxqVvk0NtwXvlOQJGsPS1Ls\nlUxtwKYNHKvWi5L4kMhx9PVUIU8XXk2JLwNAqiphqyS25JPAID97vlYr/EGf\ntrD5WmuJZ3GNIM+Xk6P8+mxyNWtQjkZZFOVhRH/shi1VsDLFDBCs3pV9AgKP\n9uMLlu7R0nlAsai8J/RwbG1qUwpyG93g2660dZi9sy2sdGRuv3FbdaOLRu2t\nj3uj\r\n=BwMo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7t6jt6lY6lsakNZE1rQZhRTlKxP1mAc9xFEZmAxfbfAIhAJBPMcXVDR7M8nud7OqUXYS+fl2LIQGPIh2ubFC0kMxn"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.c15ef569_1539224478507_0.8759404044089987"},"_hasShrinkwrap":false},"0.13.0-alpha.9d055057":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.9d055057","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.9d055057","dist":{"shasum":"e19f10d1ee1fd0a4efe14b14954bf022bdeebe70","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.9d055057.tgz","integrity":"sha512-8sm1C8Xa1wMLwJ27AsZY02YBAR/Tu3IOMKe84pMi/1AapjvkSmwqTucdHKxkZYAp9uV499bh8fumOt1nbmgwbA==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvwbzCRA9TVsSAnZWagAAyBIP/29RYVfQqkyFYuPuQt+D\n+1Lp0DbxxaIDogRDgtR8NQgNiz6H6zRvJqjCcbeyrlfEw7BqONCjWeN1YhZO\nXzOMd/2SzLQa1/p7Vk0V9mv/iXbyunmosW0QD+lzTT8+X+IhtGIQTWyGKuqu\nzKRxRpEFknwXkwksOVvfTcM9tBK0+bXRQbxOrYLiUP2v+BjYJcwLxbr0Qklh\niaCBJF+xOD2w7u9U2mYI+EuMfttc1QXazI52CelRSUPxhAFb+z3rtZBdoSti\nwz/Mkf2VKpHZNAZQeRQ+KJFl0J8D3i2rtgntbAVjgK+LwuqDZSm2Uf4cBWR7\nosWBcYi2m/a1mR2DIxezMBA4SaTnlMovCFoAj4a4x5BE3tAhR6hzfenVgak7\nGP60mvZm/J2TXWV5F35Aq8/5Cx+hVl71b7Mk/VMLYWJhQGiBaFJ6AacTD0bq\nEAnvzAgewuBWd3gslYR7ibCRWu6tD7TYQ9IdCbYOBq3PJmmxNKMtVWkcpjXe\nQILwQZeCEDQTKPwcZwYHy2OiNJaJMrUv/UZ12umU7BOyr8lWeRBEkCvuuX8p\nr9ks/ApbSYce9c6po+G0MK4vky9BZ+hiwchV2ouJ/j/X43eVfYbck9WO/h7C\nwdluvlsi10Zy5dm3Ji0y6gEJHRB5s5ALBGR0wl76ZLa8FDFHodZpH9WP2NcZ\nVeeP\r\n=gw4O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBxrmqJOE+Mdm6P1ibQEIRIteyzCukna7EfQfgpDLwivAiA9oH28T3DMovM8ji4A9T/pdsvinPTfxciXNha5f3Tt0g=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.9d055057_1539245810418_0.7927392814101282"},"_hasShrinkwrap":false},"0.13.0-alpha.6e088183":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.6e088183","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.6e088183","dist":{"shasum":"3deefa82629d842e88b31bf30ccee18760351011","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.6e088183.tgz","integrity":"sha512-wiGC42bhXwIJIpfeBkn5dNs/3SIOXQpEbe+KohjmnZxgwhJc2SwB0gvv7yyJJ9TfCdTMajzn7Y04pTBvpqnNuw==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvwcLCRA9TVsSAnZWagAAnJMP/jpw6zaGFYn0O31HAMFv\n2rh8NJkSzCNGNbooov54VUoss/u6t5j7/hf43WIYTLJ8tI4hoaNXHj01jMIN\naQ52DHpnxYrEmHeK67Pi2ChPRBwvOI139SfOq8tPTMOvAwJ6nAW2L1jKSxUk\nyk6Dx8hPSscIbHZAzLdko7GkNohx12tfCXTa8CIWaSSGz3N3N3QIbYDrZ981\njcCuzkfU6gjjwTQBm3Pd6pKyVv5ZwSBR+TrcH2dMkIkkCaK0VpjOQsqxWetO\nTmMCJxXdnjRTFeBMuSIw2j5e7G/msM+gdhyk2rv3Y90xbOj69+5k9cDpi2pT\ngNtkpGFi2ZBD/iWdPhz1mrJyp4KUCqFQXhOo6Dc4Gm5ml+5CBVVx6QXZ5ZE9\nB6euzVHRecxrhl4IHl0VP3Glt8MmRgpQGKPnHzd7CjYa1Tb/vgOnmPFrxLY5\nAnAEsL2T7I1/O10ia+1PvIHooHPrauwUn/4JDExDKoVAwIYVHYqwQT7J3DgB\nykrSF1CzRPIq6GeBRyLCLh00aGG7/TIxu6yiJG2RJpXqhiH28/eFFVFXG6nA\nK8s/WW+JoDaHLdQNcCFKIhDTogY8/Sm0nKQ/Eb4Tu/eHOb7FGoutOkZhtiVa\nTj/JzmqRKsSaQrH1RTIqZwwXlSOWJKOzTb85wKE8tNHJ9/8RxUuiC3vxcu2r\nsZss\r\n=nIj6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE+ysm+x/kLznm92bqRJAB2aCSyZNc7aS+ENyDbPgKdzAiB9qhnj1CMIPhLdPcgd9zMGfslpYeaLLZHU6YJUGEV0zQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.6e088183_1539245834569_0.4619197324132258"},"_hasShrinkwrap":false},"0.13.0-alpha.b10d1a81":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.b10d1a81","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.b10d1a81","dist":{"shasum":"1af4cc6ce5db676355be648b131de60a75b39544","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.b10d1a81.tgz","integrity":"sha512-GibkYU/BRN0ldvDYdkMMsCabOg7whx2uS3OBjFduGAwYaJ3a8VXWzrXJhwD+8LdBGtb39lWg8YOCan0/NS1z/w==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvwcTCRA9TVsSAnZWagAADqkQAI7hmMDP9QYgqYH2M1vi\naoMH9EH1lxdVHwqG9Bozivuy9soWg79pNHrlC4aA2uXeIapko+e1weYFEx8p\nG5/u6PgY7rNY741hBu0gWTX+cuXojo0bJQp6PqnIB2OrpsmbV+d69E0UNJue\n06NV+1d7VO+3IiM1Z1MrYnGn5xf28i+R554C+PcJQ0tO6c3ZUPTOFtzD/bHI\n2kCWYjP4pLUaYqk2HZJkOfuzB+fopoHVbStf/DUxGe3VA6n/373jMHwwHo51\nJdoduK+cKnZMT0I25lagEYdg7FuO1YGz2XYVLcB3P8TmDEgSfSsM4/GOKDRt\nihD60wX7OEWVv0AP1h/SeohuMc/QqvzeZrX3cYJ51c3mOqK3FEeWDxPcHsXk\nyEqz8L24ah6E/KtGGAGxKNtOmYKQpgDHf+XX7jEiNXIDZdZzxo/hX2EgwPt1\n+OCSjREDtNJ8JuZXmzMDbfTNTUu5wHmO92YVW+SOOtHZNJnzO8SAWCvyOB1C\nxRsKrlg9r9/o6qiDkfk19DUZiC7dM5djQPWv1fTmS2Bv/xBq5b9w9CNKmJhh\nOQWqwLEEWNreJUpDku3KQ2YcmnjGIcOVZv6J3yUCzfWZkO+dy8nK7x0I6qNi\nFRtG0ARpEPGM4LDd0G5Z4yOkcCoghDaDgd+59P7kaMpejnXrWjgTxErpPP8R\nKnML\r\n=Yig1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxXqrtEja3MbbtcYhSE3xcG30irJ0Ej8+SbGstTmFfagIgYHAYX4cZXBAarYI11DSVczMc31cSOTHte2KSnJ+K6aw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.b10d1a81_1539245843145_0.050141481375547636"},"_hasShrinkwrap":false},"0.13.0-alpha.fcfe0f11":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.fcfe0f11","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.fcfe0f11","dist":{"shasum":"7405a3a4bd758f831d70cfca690979ead7ccb76f","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.fcfe0f11.tgz","integrity":"sha512-d/J826N5pCJzM8ytWAPOxe1WDQ+SP0bK6PRMdjr3ahxin9qyyeUS0QkUB8mBt7x9qFBna0Y6veSzDyqTSVCeWw==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvwcyCRA9TVsSAnZWagAAZfIP/0gQxD5sUVgwQPrDpAVG\nPop2/Xr4gKcH+SPNK38a4ZbQp5ssNYz904VEls8bcI22h2SvFL9Eu7Ub8XuU\nNmBux+KZ/i2iZnqvom1YDMyG0Jj3/uMEbtUkxp1eisSyIMoZypvsVjirO9Xs\nDofJjuwkB+4ojW/51WCJ76g47DXZuhYmEo2u3OL9uzaMu8PHN8qwmY4pXwIT\n86CPtOp7Fgsq/s0f0T2uZ3a2OUhn5OLgFThOWWccfZ/CaxGYM7XgpL/7pSK5\nNFPejtqhicLlNM+0GV+DabeY6xseRKpn+DbogAsdYsjg5vUDU2GQK2quE8QZ\nq/eqMjoaJhsdML8oAXyTtSuUGTJxXtoFQNtQ5ZtOyQVw+4YNYYODEyU6CANc\nV2h6QgckGlmSKdDWN9GIeCvb9srdpkbStTaMdPFyB6uMnaxpRkU71fNSHYFL\nULQM5xjbFtKPNb1wczZeGGIXM1vKQO7W+V9ZF5obasYTvO3Tz7Ru8YL/Kknm\nHViQNy5OH5f7tFcQbxnmodXPzXHH0CMX5cH1c3U2Y3qt0vuhU5PbTyZF2+Pz\nh4nmfLFLQY/lbiZVDQX+v2aO07zlyC6dRF65GEaYpQaCWd5mE8XSuUXpG7MA\n0OVcvJL5PzcqQPdvU6qmaVDn/b8+JJD3SzV3MzXmieDOX6NEz1z9LXO++4BB\ntQsm\r\n=uOvs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxp7mArWtC6a2gF3H0aUn9UDwEVSY/LJpCmehUxyEk1wIhAKlIG77/8Bg59s228q0bJvPfHi1JU3vZV/la3kmcpZ1Z"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.fcfe0f11_1539245873578_0.3044338231925041"},"_hasShrinkwrap":false},"0.13.0-alpha.c8fe1522":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.c8fe1522","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.c8fe1522","dist":{"shasum":"b345f18616a1a06ee1caa95df643862d05d9edd9","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.c8fe1522.tgz","integrity":"sha512-tYjY75pW04i8bshNXBX9KY/ni4QVA9+oO1ZbKOGM6G9UshQDSualJFfY60DbhrxTVcLhiOc282/S1TV+YRlO/Q==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvwdYCRA9TVsSAnZWagAAaXgP/iA+jr5Ou/wO/yHRi0xh\nbb0PW2cuBIUDXct0Wg5ijGT3ri/V4Jbfkz48AX2MtHImhYvWjHU0xYGe6ZmD\nn1sl4IoFfj2Iq2zfUtxpng/yHW7YGFOhL8QkvnssNwBOtR1KZK1VvZaN9lfI\n3EFAzFFuh7EK0uQ4eON0gao1S26JdsaBgXNw0yN+Vq98b2wk8Fit6Fvdvfgd\nuKg65iuPFbjB2QvkW7Jn/yqWPukRTm2EXXXkQ8uQLvEQnsDlx2UFV217IqKb\neFVOXa/hkJ+vp6pSWIhteB/vIMkSprrCLKaafP4JYDKY2v6EC1co3jP1qjq/\nSwH1cwTdj5+zIZlmDWfDp1gAmuc0SSAmBeuocJXbS/ShNA/QP/aKJXCAxjL0\niPJbgQN/74tBhd4KDy8q9jc/b/IEgEBr0oOpchpaZK5rrLtcpaVywkcl/Hbl\nftD4wPrKevkIyfQGZzI6Y/j7m95pn7WjG4X0lVdaj2Vbvlq1O28OB3vIa02j\nKYxU90OHRK2TUyZXbeOu1+XxSNdxQR2IPLnBhEfJBbQlIFj0OV8gp+Nhp5G1\nropaKLUVM/NL5K8KW7o24/mfHe5fO+ZzOiTH71s/g72oqgEMCxbX5sLXSYjs\n4pAZmqgW2+vg6mIhmcN6VUMWjg3nSxim+p65jBTE5Py9NwpoEh0PqapShj6O\nhnVG\r\n=NaJF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID2LuGs15agafv7Pyx8D4lGlCb4K3iCwmeT/KO3v8M0PAiBNjvZftRF1GGe5PjEFhoEkqh9UzYv/DQNw/XNPezf4tQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.c8fe1522_1539245911580_0.8056736000657079"},"_hasShrinkwrap":false},"0.13.0-alpha.22f8282a":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.22f8282a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.22f8282a","dist":{"shasum":"b0ad222712e665fc4a429042a55924dfbe0a1040","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.22f8282a.tgz","integrity":"sha512-JXF9PGUETScTjVGAHwF1whxGVYRqR9RbdzcM78PoU/c55L3WTciprg5gLdd2WFOkf0PdwMd4DEnbst0+uyI5qw==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvwdzCRA9TVsSAnZWagAA6BQP/0yy/zTojQNmb7n9YX/T\n3XIQo9RILt/uNTgrIe6uqEySvSWD+sury5TBQEbARcpcnj0/1oIf13TOEOLt\nHXxdaXUeyqjoM6/pol+CXA0op6qFPvgZWcPNyV1ky9DOH3luZlMcmeFJlTOq\nHAo2SyJ/gQ0WKoNZt/3o/Kgz+zzheJHdWeaEzedYIem/scNepuaVO3e+XxPt\n4ekWJW8bRrqTxfPrwVE38l0G6F16Je0MYGkcapRJP2729NcV7Ix9Kuf66IK+\n6lXBR0l9IuGEO8Vk3b350c/CGPTbgrocm0Vr+vx/gC3yeAGH4pF+3rFMOVdR\nRJLzMCTJvfk+l9RIAJh9kZeJ3x8nKm1EV/QEY5Pt6BNm9iyzUni4XIH0Gn6M\n+f+IZxdEUVqHtkaBjzVvDJwov3LQJEBulnTZf5zUiHf4MQgLAxn4gIHDkTpq\nwRRxB5DFMI1wVzoYfKzX3NK/q4KOtlhkHBFGfyHbRPNjL5wohQymm3E0B8qJ\nPWqVzWyIFwwqMRyhe6gUdvFU5n5iRe04yrxw1pvPHHk3h70ICkvfDjpK8sYQ\nwakO1v+7+LAi3AacfedrB2kaiCP/rhr2SJPD+QpmPpRW4CRNiznMCMXhgbzN\nmT/v7Nm+OPwqUON00WzDEDjXKiHYST/kkr2R+6Q0aETYe4dHXA3qI1oLXCzE\nruyJ\r\n=Gwqz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPhoA9da5zLeYl2u84pbYtyTHv4/IvCITtpvcLWqoZMAIhANChJ9SO7QExY4SzP9eb3codwYvI2H2jm8mRL5cEsvcg"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.22f8282a_1539245939172_0.2843302778196193"},"_hasShrinkwrap":false},"0.13.0-alpha.540619c1":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.540619c1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.540619c1","dist":{"shasum":"d912855092c76dc47fb4ec5883665e269fdc4003","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.540619c1.tgz","integrity":"sha512-Pa6DMzb0velNdQ9oGjaWu6BqzK2ymyzHg/RNyWIKOcHwAGoBsGfkbYIKCvpZxE47HFHaPy/XyPbyLvxexMXftQ==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvweRCRA9TVsSAnZWagAA/EMP/jAbpXW5g19i9lItNoRD\nqX5LAw1MsN0N61T8JnHzizgdPEL8kMpF98Ai0xU6sp/5wkCPB3LF9/VEyNXR\nM+e+bWX9si4tupPgSEyJKkNaj8eXTNu8SVNoYE4Fx0+iY16HI+NQCH5Y9xUw\nmJIcAJNuOP32n5zHU/SHyC98s2+cxgG9l8xcDcAxhqwQrvwoIHyNQtRKtdFy\nu7A/EC71shswfvHNvUdHL6yWZOuOGrbM/i2K+WDS7ZlJJksdjNzFE/VDSrtN\ny6AwTaJTr+zozJD9FoK7xhQLXBK4WOBn18lNKw3SkTzM/4155rYu7mWmHjFh\nKFs4B8cYiSgIFeU2szskVzsxiXYq5QUv8AEGUAa+3WqRtsxvu+h34mctg6TX\nh2D1PUJwHUkr58sDtblWH5mv5R5lo7cTHzhWNMsdMkwbP067+AnjXVI7/oIM\nkhtRs60odOoLTBzEtpG/2RC+MKdbeBFFHan7om556LRUSIuAZpRrXgtXk5dm\n5uuzCmI8opw8nN+iV9tKMvP8eS6MDLSpH+dHkkp+fl6DgJt0DQCFBWLpBd/Q\nwbODUbfPAY+3vdOW2uQ7Nt7S2agcvY+c8EcYBWW1F6UGR5NxKWHDo2mATVZZ\nn8zPseuawvptagVqsT8n2xxYW71ezFGpodXBlZ0j6jYi8UXMwpgs4VTFjSuk\n3uNz\r\n=TaP3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC33lhITS89bfNRsYkL54s93IC1yRA8RK48lWALo1zmXAIhAIW9L2eTemLS08gbCsoQR/NDrVhu6J21gKP7swGwmKzD"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.540619c1_1539245969212_0.7374919600346796"},"_hasShrinkwrap":false},"0.13.0-alpha.5f5dbe1e":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.5f5dbe1e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.5f5dbe1e","dist":{"shasum":"e45446348420b61f00306341ee814b1d97544e61","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.5f5dbe1e.tgz","integrity":"sha512-9KUXttY7V6zFhyh2s6wBytubPial74TubBlD6b73sqCcSvlHWt5v/09RJvh1w4KdGYpXxf2rR786cbrrGiQQAw==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvwedCRA9TVsSAnZWagAA4CoQAJ1A7TY9IN0V0BdZGlfx\nsD9HlvKeW/CDOFeJABYddAyxp/cI+pK5wKY1zFD/5R4Zt2cEOJmgd1sQXiRf\nyC8t6BbyFi8jOLm/YcUd7oXYrBoQQO9319vj02hQhzY7dWq2Z8K6TYE3DLYW\n/NSw7r5BU3H8Mfg/wdSgHHKkDYHWGBnJefgX3HS15vBf5VT8cIsQtRIjLhU3\nCcdSU+cpgzrQzYiOEjjtDjDywEkGtXUaclk7VCbnfJq+UwFBSLju6I/HvkTO\nsxfiC49z2viLy0X8Ho2MW2F3XJhQhVB4/rgOhiiP1aFTVAdlTkdp6JMOr4Qg\npi5kV5ObxLaiGhunrlMxI+u9QBMouUp14bHgHWpdaF1xo+CFkriDJsOc1jGs\nCYNT4aiC66USmITKiDtNrLyH65CnB/LW6hlyKiAdDmx6ISX1/J1s5bHp3SSX\n6mry7rBkHD/s2rLGRCNzJNMtfop8LT2Gp7J5sPQPLnYgekrDbE38nrZoUTIq\n4oHO8EEX743782KDk5Es4HWlhN/OdoMxPRu46NiFrhgta+RAjQbAweH2mmTB\n7EtNmKLdzC8wFEoCo/8NLZbvQi5UYGTFaq7tzfFQiohsmow0sMmwznOEZpdZ\nFXtKsfnAOqormgAGPdwj11mlCjXF6tFGi+hIUKQQEQq9vD+E0hQSNc8jCvPF\n2zvl\r\n=dhm3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwX0ZLhwowoXaiPlSjYN5kc4crnlQsOzX7FU4CQ2TAOgIhAJHfB2HzvhJRqeMyKFrIjxqVf6+MpW8dpKpHwGOteqMJ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.5f5dbe1e_1539245980787_0.8597158969049208"},"_hasShrinkwrap":false},"0.13.0-alpha.053c787f":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.053c787f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.053c787f","dist":{"shasum":"7675140ca0a3fffd5988b19e4d64474d265e2ed2","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.053c787f.tgz","integrity":"sha512-jX/s7FzQaDCD58QwaUftM36riuvNIO3kqboUOuea3hevOFcz9zORRRgW3uGTDRRpTFdw2KaBTIQ1CynV1oWkHg==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvwe/CRA9TVsSAnZWagAAUusP/1/DaiXlXSXA+0XpSWrd\nrBXHavHgQykOuo0FAH/A0KAGCavjnFp/LyOJGNSwTMa+Yc2YVE0yPwIIHxfT\ngX3SSk+KnRfoiygmw35oPuiQvbBK+TXLGaHYknWI9anEoCBYZSagBT/fWiVd\n/xceMVuSmsVeakKDo4J9yNSgw620ykMunb54H+l0sV4PZdOgz9KEoGADVMBP\nEWQ8JX3Ll7KTu9Vr7X36HmMC598zpnNHJIlCB+3jBHpNjir5KsgUycHbImx2\n7iTzRmZDToq3oQyhE7YO78z/QBV7FLlPGyeUF9Dm5GJv3cPjqlEsFZMlp5/8\n3WjHWdBtGfR2oAIPtegIq8To/OcwLInzMLaKghXJpqmbHG0hYzuTofy9WzYt\nGzo0ll5mFYfwH6ln8JItGRkwOiGXH+leEyp1d8AUzBmFkIufNspvR3yYuaqd\nHkXIFzU0QHp1VMXWyZAutsp5eQK5F83HPrRiaMOr8nGUCeHQIZDv0D+6Lekt\nY+oWO2l2z9XaKC2epycPoZd0/0prQk3H9GrSTgbflCuOnPHHu0x8xztScKuJ\ntq6/enk0hPPGd3c4RIjcqHRW3zbUYyH+ilfpqu3nJpWQqx7hb5/vKpCQKyfy\n/gRG3Aapybi+D4JQdta/t/tYOp37pbIngQdCOYfvTnRRrjFF9tSo4HNNLIvg\napln\r\n=UNnM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIPoB4CCsMafYce/GlNwVLXARr5WbB6wJV7j7M831VLwIgd6+uPRBR3ZJh3Q7NYrJLoUwgnHQ7j3Dql+kc5RcNYPo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.053c787f_1539246014316_0.6992330348148501"},"_hasShrinkwrap":false},"0.13.0-alpha.eedbcd5b":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.eedbcd5b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.eedbcd5b","dist":{"shasum":"701b7b2eeaeffbfd6db96c27ad59baa830271f9a","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.eedbcd5b.tgz","integrity":"sha512-hw0mImgatEFKvRw41U0Eh10IvRsONVgtTgJbMehmEs7WbUKQPIQ5vP2vy0+HibcAIEqnwMwPYg93lah9C94G2A==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvwfnCRA9TVsSAnZWagAAIIkQAKKBxWSVucSRkDYCIYEe\nbaD0SrKouxr0TAt0Juajxalp4NyZQ7UV8+vSogGsI5F9ugMm24cmIMH4k9C7\n8NucMiLGqOYpqLur2LcwYeiWP+HXaawM4ibi+fJkA0mdsVQE3O41maZwjxhY\ngLHTx3+2z30eSaozfSEorAiXDu8QK8ew2SpRletFze+1jY+BYQc+0qXnmwK/\nzNjWq+y4EYnlaPSWKuBMdXOa3nRC52zOIM64CfDsT2ewz2fOZq8iysj6Kdsj\nDUwWB8bvfAiYzj1iBurp2tJD1LVfhPX2Vby/OHK+OSznbXpgom8QInU/6vqT\ns38TNRC4TPdqAGmybWFtaBuCEIEiL+1k3/8jX1S3Puu/u8Q1+zEnnZfd/g2h\nwjmFAiojHWf2eeNXuSBucIHqkdY8UW9RGv3AIrPVhSpcdzwAuSAVbcONDrCy\noZvJxghJZ/b6r/w7ZFmCB4uNwleXo9S8T63jS8fFTo3SHH8KdPnsx+Db8uPK\nK3MxldbhUikWMAy5EDBvjNyqaT+Jrc7zdnUCp+OxgaJAPJ20fbh3dXlyM7pD\nh6/ajv78ldNqbOVv68ldW7vjxClSWxQIH+krAz9Q2Dh1t2dCMfbrRqCz0kSm\nnogspON8m5z0n0poDf8hfcKAiJv4XLIvBthdSjXgTM85UxJ3QnHQOygfCBGW\nymRT\r\n=B/AZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQXNhbXbM5RS1BusLPSSIXR6XRUJOt2K2Uu2HFvz/FPgIhAMWfMmzRc9GWFNTeu9wEw5Ax1nZ2hUxF0gTDAEk86742"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.eedbcd5b_1539246055250_0.39030199184799685"},"_hasShrinkwrap":false},"0.13.0-alpha.7f8c1695":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.7f8c1695","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.7f8c1695","dist":{"shasum":"0a04798f3d356a2af43ab09b0199fb1fd895700b","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.7f8c1695.tgz","integrity":"sha512-KmmSXHXQb1dvVPQKfBWEUzG4sZOnXKM8f58Khhi0GscHxbg4XLM2L+DC0WZ8CyQsr+shvUKKGDzBe4mOFVHWjA==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvwf9CRA9TVsSAnZWagAA/d0P+QFdR8R3vPkjVejpGePp\nZ8QN6C4NFVY2qy/78cFwm6RKHJDFHbEOIWHYS2/R3VbCCSio3+FtEmWjhWdt\n4KG773twN7ITr8dJi7dz1wt/rLvyBWutAH+jUIOmzBCkFapBoZqZJ+SqSPXV\neNJKd9axOy68QRzRqWfgOkB5BMwnw4snGeMjJBBCEGfFQ0hM6bLU5gam66+r\n4XJjoY7bKtaVChrmFIP3Gt5P/lPDny0LwSW3YdRBODqe4dXtFk4oyNKyHBTW\nZFES9LzqGSCqh/TAZvNr7gF8Jwx5QSno1AEgiZVLB9XTOhv1mU5/MfnZcRxg\n6wy36qCn2H1NsK+hA0JWa/sD0mbq+3wnLKIzhXqZDs8Il2dw6080ECCGptMR\nIwLA/+J2sEYI86XRygs9cKn+N3MlRl+2yudsbYhz6oItMhfJ0/AFjXScm8bx\nY19+U/XdgvtOWawlAPwwsXiS+d1T7UPeFZ1gtQK3hxxycQcme2dP2uH0IfSz\neBnd2cjYiqCy8frFk8uZT1jX1xb3iIHSqF4OXZnW+8/wqe50z0jtzdajF6ix\nK/43XakfQcdx1Wf6Bwde91pu+wvUwAR1Tp7CSN7ZCU+c+YVDvSHfeZIzlb/B\nC5pTqqsESOdUDFXcx71NgLLB3wvBHDv8becEbx3b3jZ3Z1g2DolYMseqY8Nx\n/mhL\r\n=kU/5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjjo3vLs0zXwXUm0SfIIbqpeaSY0b6Wtykn3OluAZSFQIgHfwR7KCPblqyqAKOOKqx3yNlOvqM4GLW9wwUd+CaDm4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.7f8c1695_1539246076757_0.05650227351209147"},"_hasShrinkwrap":false},"0.13.0-alpha.0c715bc1":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.0c715bc1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.0c715bc1","dist":{"shasum":"2b925c9eb9ebbe7e61e99f058b6400d12dc43f08","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.0c715bc1.tgz","integrity":"sha512-SylsTgpVpM76ETVka0cf+zrH5VEdciuxZ7MHfp2n1i9ljF0ABtkwcUaBIzm2yMT7c8eDjDtN7kin1yM8SIUOHQ==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvwghCRA9TVsSAnZWagAAjC0P/3miXuJ9rWz4z6gioGPw\nQ4UaOGQLOpoDMYd2XXcrcuDaRlC+XGhvndR9xS89erEZnMQOFd0+leVTZf19\nbtmGuNQuw1LVhGhVxISQFtePJb/pbiyuyteOUNFUPm7icdhoEvwBxvlNqf2j\nWieGkchgRji+5Md0BNKcw6PfrFbmhThdZgcHTpDmVWy5785UZQQRhkJ+HudW\n2cExK0S/EbDaCfb6ZDUiaN+72r1VNX30GDYsj6EReb5zeJis6Nk4oSZ1on7g\nGGrBdL/I+HS4EOcMq0HJZ6QkyfBysuG9tKbKwhHrXxWAwtTjlwafGd6ho8lM\n1oBRjxn9CnZck9pid1z1F2hl7KPt1NObCqqzMyetoXUXN4I9Sthuy+o1IopS\nkzu/9vIGs0rZwLE4bkXZv6r5ZW8K+b1YsGeMOPrePfjVmy6GIcRLYCZ5hOOw\npzYT2tRmIl//Byzuo4PjYfexDk/wPmh/uKqWk6UfxMOZwzlirM0dVkYI4Std\nU5Q3XuF7M3+XHbeSKww97He3ZK75lwCD/N5kR8NiBhrhkSYHPHiMITsXgXXB\n0yLe9GsieiOu0v3/6CnEcOH3UeuKPN2He2eRal6Hu37Z3AK2fAH9/kOD92Tu\netibnhLyGKrKQ7AP2SkO4qsuvqXRRqxtWvL6aNRBVibHkg51I0RoZScZxnCi\ng4gj\r\n=WXS4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID6rq4i2hIQGFy2/ms8UHkoDD9tgzTRGlto6YcSSGIrBAiEA2fn6qSKSFDWEkMgNEDJ6V787tyvBobHuiacjLMDiDC8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.0c715bc1_1539246112228_0.021663442798972365"},"_hasShrinkwrap":false},"0.13.0-alpha.cac7575f":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.cac7575f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.18.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.cac7575f","dist":{"shasum":"abbad7e47d6d4bbda3519055d0c05a4a57fc43c6","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.cac7575f.tgz","integrity":"sha512-r9NabhJ8MhHYTrl2JGA/XEQ757rnBbc2ZbndVKPCzq9eGLPyQnKcZ9rnJfxGEqqOQ5kXc85lZxMOfa5/yXCvXQ==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvwh1CRA9TVsSAnZWagAAjHIP/2cWYvcc39beH5Y7H/LK\nU+vTjUIlj0CSj7SpBXzCfbODvvTxKGUsTLwG7XPY50JGzwXQRy0nIT20CUuO\n7RJNdQ0aNDxjpA0tSEE6D16Z/swEV3qO747BDlCR9tmMpfouTrN5VLsGmQnU\n08DQkQhuAlBXT8P5DPovBbVTKaJNJGtrccHGLmOpJFqoUccljp6zIhHMqyCn\nTDnAbn8YdeRd2ka5wuk1m+idhD6DzAX8Lrn8c1P9H2dFMY6fokiniUhOjVaC\naVO6rqQmIUnOHkGtll2asQkFOV+y4oOB6XCweuayWj7SR61WrHAf+bcnjl5N\ng5CeEmPIRdHGMPk4eLJfwP/B+Fjn5AR5fu6qBPieD6wyXXg/xrLy0l0KUcKk\nE7O/MXH1/OGcERA2bf8Uw+njMKACZ7WujN5UqSBIDTH6ZIkz5rKUqPsBwgBb\nChYohmapnzfE6dbPwnllghVSIkf1zgZU1kwu9NcRK/wrwrbjMKSWl4s6WkhI\nUOLHmkSKGY4RmgCo3Unp+ZLW4ImverNSSrGGdHxc3hZJSqKANQ7xakiwbvnx\ni5aSjsAdIdFhFokKEKGGKrG1bSDhlRpOM4Brbh0uqIgVVOuJtlMgYFvUQBVR\nVqysXQNcOik1K4dCOLU4U197wEC2OVnBo+OBIP/A5vY2Mr7mXj530DSgkimP\nKpWL\r\n=21MO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAxAwTnWKjBFkgsvx3eAqRltcoqbRaieNpZpHBzKO7jxAiBi/LoWLcVeO0dBeZG0aY+vBnLxnL5f8SDpYP+FyO/6kg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.cac7575f_1539246197078_0.8904913330760729"},"_hasShrinkwrap":false},"0.13.0-alpha.c70ea0ba":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.c70ea0ba","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.c70ea0ba","dist":{"shasum":"66948f0e3df2a274a690370bb5eca97f5c963d88","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.c70ea0ba.tgz","integrity":"sha512-toGzVC0cZ9OVZZJzWrXJ2+d2G53I/ylLj+Ntv7Txm3An5O6FEeaf3Zs33ah5/udptZr/lwk7ARCAeYWsbChoGQ==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvwjxCRA9TVsSAnZWagAAFFIQAJOdcJ0DerCtS/j+SPho\nsN5RfukVHM/CEerTDqbx09H/rLhxKKzCltinS4A1P3ifkvyOis+DJJNzucaP\n/uZ92c4EWcOJnAWcfAc6zfbsg5SsPzghgSIgqi0EiUD0HKATcYqQowAgJVET\n1IUPjBX8NT77ZXEUi5fqXvtgRwbjVyCflFNyW/WEVk5nWDHizl9U04f37hR9\naKRiHc8fxzH8I5YLaGfqGGJIcLG6pknz+IRU+D1T++3dpB5Jjdy11itDNTut\nPEOLvEoMD3UHIZUi1FC0DTukBfXxGNafw0zSQatC0Aea7/5P2S1iQjx0LlWj\nxOFBRUs/sC3QssoK26J16XFsYpPULMkAwy2K6XKcSSKjACLsem+/bJb3WPIR\nsLKcKOmqZoxrOjiTt5pjDVbUaC3bP9xIRteBwqyhc8hfMol/DftTAMgh9Jck\n4cYjIpNkiUsRVohTCxLONly2rpuFhLVKy4YZU43mKmuqFgINGc0g6sb5U+cT\nYEcDZsLbdGqQoEg2y5s3q8HHz11L+B1yeZ8jmdfCyKW32PLFuUy6MUBsf3ic\nnijUM7cku0cNFwXZzXs8ypwccpH/dBKkzj6lIotoem2Etsv6U07TKS8c5mcn\nh9jcFGydde7nttbamf5aQ7EO5E9kTwltAuYJWBpKKxlCiHr/MDznSQFJjljj\nlQtv\r\n=Bx2w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6wxQBT0I1cvsgWnHLFLLBtO7kEMfyuOB39IQQcyHUTgIgAixXjKDr9ucT91ODNI9peeGn3fsMA7HCfMF/4duBJR4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.c70ea0ba_1539246320801_0.08573036631524489"},"_hasShrinkwrap":false},"0.13.0-alpha.7d3cc003":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.7d3cc003","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.7d3cc003","dist":{"shasum":"23b2f4c667fa13659eecc362649dea7a30f56662","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.7d3cc003.tgz","integrity":"sha512-maoVKInK3cksBgAQmwq/WLZggM6mG62jH6LWl/+fNBOqevlFTPnfmL6ZgDWDULNaok9jrN68WYGI3VpRybrFGg==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvwlxCRA9TVsSAnZWagAA7DkQAKDY1pDiNOqJy+5wxyS9\nahi9udodsw8ULgIBd3kKS/DQbRuzMZQmwBGhjXHEghlvhLyr4xfbEBW8eNuD\nseAa1RbF6A7CVQazXqkjVnaEVqORi7i1i5WfOoDWSqzhHy3pKOxVcWSp8O+p\nTofmLoynt5D11qP7JSmQpUQgFwV5MG6lkhWXwlZ8Cf4CudVkpFrBMdyfm38D\nfPhoYsa5z8GAvj694vS2OVpTTy3IFQsXt8MWxLW5uNH8PvsgAV45n8rES6+6\nSUY+4O1HplJ/gRfg/RI4j3tolGtqbJiDiDi40YdDzBNW6aNFmVG1TiqJ2QiF\n+qmZxvUFc8DaTaTbqHqV6Y/jnppBLbR7myD4db9AEYePRiO0aLooAvxvEbLa\nf5i+Uhm0XAFIydOabkbAjJkJwppAWaRrfDlvD7ROuVszp8Nf2zJArRj+hu9s\nTKnLWSYkj7MGZLXhlxPbS3+9UIvFdXYt0q6ibh1Q7aGLjMLy8B/OGdhvDJDz\nVXUv6P59QaqJuLLcDzkxESST2kRgwkJ9p8+zfKp2SoCk8BWWUOrckWfRt11+\n/ImdfNwC7hwtgUTLtnBKMETCMDOOWhPOAQWqZN8dkxMKvGCuMWV5FhsWi0JJ\nXRFoQVBvVMJJRKY0Hk9r7o8wIMWMRv5sYiPAw+lhpGzPoxLksjLJNTIFDTg6\nz+3f\r\n=ioDx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDnftRKf9+yFyRKzfoLnHX0i0P0LFEeo49Lk3RYShitBwIhAOgi100oAiYULxsujPoNwxzARwLchT3JbgFpVmdJDzjA"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.7d3cc003_1539246448855_0.5210007703376223"},"_hasShrinkwrap":false},"0.13.0-alpha.f3ce681b":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.f3ce681b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.f3ce681b","dist":{"shasum":"3ba9f29737cd4a4e6f14e418fd12a79c67c9f35a","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.f3ce681b.tgz","integrity":"sha512-Frba6vjPCj8dnr3JycjeUh7cuPfpMt58NKJWTAw0/rJFewjo5usA5L13pjigyssff9OkGJP1CaS4L2ImVGNmzA==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvwmYCRA9TVsSAnZWagAAw2EP/0b8ZxJ9RXyNHSIrEFo3\nQXJx3Jy6EmA5tWbFsODsZDrVz/V9SOTFaCNEIW0bzQBUsBnQ2EI9uF2VvAzI\nNEI5ZABnIqaqHnmex19J/YhW4p7vbcq32DiVejQTx3Y/AY+/cWQOzb1UM4PO\n3RSZI/EfRKHe2Fq3axoWwx1u/pgi2AiuYQ2QBT8zjwvLuITjCKWowNgD8vy+\n0zrR07ku/L8Pc08zWEqnAv3zi5umyRjr17Bv0KYhzV2yg6DWKIWkATVZQctO\nAacgprqOHbahKpZNt2V9hLVsMLL47jPpw1qTHLZRb36RXKgH4VEtF2wTsfWl\nv6IkpEZb76zAKQkEW7ucTOOOAFlWTnGs5MHQpuCiM5exhPxBjhr9frHn64m5\nAbzX0zPA0pHzXhtrMX/MFI42YgxgdTNlUKwBS/FKdWMPaE79bnib6MaqVLQs\nG7IF2PpY+2upRnY2t4LZkvBV1k1lCNK7KQomrQHV5zdnJRGfdTJHJIrSBHZX\nMVZfzFrOkh+UxThiQSeOuLwdd3xW36hfaNIhh14oVGKzE2HMj5blYh2xOtRP\n1qtBlt2Z4KWkRHWCWz7EE0QrVkr5CeDS2jbBGVPo2760mrAfSzIpFqN3HggZ\nZZmQPy1w6JztYXenb/+3LRUMY8ZebXs+JPHx9+SbTBf6VLcr00jjw9SYsKbx\nZsBO\r\n=bbVa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjOi14Sj21MKYEGtn08qj5zhDrK5AZjEZnxDFKjW9EKwIgfJSNz64WdBDl7DC+kHmteC9Twi80+vNMeT2pyABmW50="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.f3ce681b_1539246488299_0.1774862182653827"},"_hasShrinkwrap":false},"0.13.0-alpha.41e3af52":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.41e3af52","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.41e3af52","dist":{"shasum":"71adc9025f7f5e1391c587c200a84822059a8145","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.41e3af52.tgz","integrity":"sha512-87Txvyry7r3x92nRNDfkCuD6soJZ/nzyFeRE+Y4bcYlXoM5pC1p5NhnQNQpuSFkWsP8GHnRVKWBi0BXTnEN8Lg==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbv9yfCRA9TVsSAnZWagAAG9gP/2wpaupWCCtpY//gX81e\nnNattU2hHAI+hMudJfK4dv4WnFIpMP+dfAueAyhnvdjpFtoFtyVi7UdeX8NC\nAjI7NKUAufV/Rp9oiM9u0V3jdK3Gv07mlm2iTDKa8nDjjmchpjauKmywXeC2\nkA6RHMXyIe2IzfOo2c+qYtZMpu46SFQFB9VE2IwY9ynKLl0MsUE61XXHVuk8\n4Zzwt9f3Z7on4Z8YWy4+AohY25akI6V596NWQWotSEO6UrMEDobP3WcuyGSm\nvzo4n21iRvZW9COC9f1icXQDwflPksw8RcyTg1whoozlHp+ESXs3aPAGzsI/\nqIAMpc+a959r0kA9Je02QI+h5UPFo5gyJjnZy7Hwrj2c1++nqIoS5T8vb/W/\nnB3Zd13ZeaQHDtrNpUmIV7CFVFs96I+uT7Q6aI1QV2t4S9AUO4EckOXB0Evy\ngrA0jnfXahwrRKceUWrOf0GR/l4a8zLnhyRnqfnqG7lt/4QP6MT/ieODflj0\nidHL+M4Wo1JfWPhdiQt3bJVZYbDm3ZVBvSHBJEuiJzBRA+h2ilWz6eisB5b2\naF7MRxxBpecH83Ilx+KETCi6wEJd3hx58IL4ic1rBdIavvsoLNlbjaoCu/oh\n9hIz9soxYyP5GPIuuiS7ar/nNUAi0YX/NqA8xA//7FljAJRis2PUVHYTejh9\n3Kik\r\n=Qxiv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaZ4lfK9qb7hIxiVWwm66H0lbUzEzWtyWPCfxNrKHvCgIgAIAaMcmEHGGzWsUSgMWjIV0V1lSe5K2quLrp4G8hcIM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.41e3af52_1539300510081_0.05316225127816265"},"_hasShrinkwrap":false},"0.13.0-alpha.c522fa56":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.c522fa56","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.c522fa56","dist":{"shasum":"d435bd340e571306626f0bc961b71c8ff3fd951f","integrity":"sha512-RLXT1Y1mkwyJIjOSA+9KZP4LZoN96h849a0yaS7ho/KqnYrDpHsUl7bxVu7sV6WdIz6CO6HlNMaTC3zhg4GAJQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.c522fa56.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbwHBhCRA9TVsSAnZWagAAWnQP/1kMKgb5cz/RYDgEzLzY\nDRgUVZ09koyfrsXdLDbWZYHVSIvw+Uf88s+bmWhJGGR2Y3CjyAwLW2GbqsX2\n0YxL9xDz0KCZbS9/VSpxS7Mp1dCZpl7H3Y6LQB02c94fd7L468Fvczjb/OSD\njWZwue2/pWNZB0ykwJO2khP5LBz5KkT9dNNA/q4fc2wAPZ1HAF8XbL/0Y5mx\nCo9hY6S8r2uPuidHQAnKNEmM82N1TQhLDddmEpOdiqmJXsTspX0sTh+hyWTW\nlk58Pj1fRP0nKonQo9YZrd79TIZ4hmkYcpg4L7JKYFKYfT0qHiAUWWWj2mwe\naPqy6miE2Oq2tmfym2Yyw+6w67OBivTUnxBrQ8h/jRVaa+jbRFuRYMrNBrj+\nZE9Eef15pzKqNsx9rJbsVcXmQVbgbyOkov/52gCHioJRIeoH0pVfWSxGqhPz\nH3ZkDJvb2F0xCRvCCzvSvObDCF3lqgwTNtMA1M/DnzHUuSWuyMZoDrsP092G\nsiMuk8XT9tZ0q9qrgBKi+3kpesiGrAI6fQhF/6tjCZdMCyDKo5//CSg+hMky\ncOPVMj3roYbD1gYeeBWaY7qGzqhi88l+s5bNxDQl4ZkNUi9BiWRjlxhpE/Sf\nTYRgmi7SiZyITTJXE0HscjXl6D63H521aH1I3tsRZU58NbmHd42EYJ7yzBn3\nl4S8\r\n=dcv0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF+UXFHeRmmaTRQvGPfkjBEAHRe8AHxGMzVU70qy3tDWAiBYV5/WVeImzwkPI/f/LptjZGsyCNpipFkB5AvMawsVSw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.c522fa56_1539338337204_0.4389883060309061"},"_hasShrinkwrap":false},"0.13.0-alpha.c7a25a9f":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.c7a25a9f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.c7a25a9f","dist":{"shasum":"c2eda2e968f56e9b6a5d7d858a4a6a95bad4971e","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.c7a25a9f.tgz","integrity":"sha512-qPysvr/v6pG3i4jcJJBjiIOR7FjATPDybYEnp/LmJjZwIDWj3lHaVXFygSj2K9SQq1FhY9CIEcyWXWrRsmG+VQ==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbwNAuCRA9TVsSAnZWagAAXSQP/3QT/2HYZQyutz5YRDKE\nFn/3jHfLDkeIh0+NP3lwx7CA6t94hstsOCm17D10PSOhOYKG+Gcf6Cgr82Jf\n0i95ppaHNyRUMQr7hMaV6ctfU1RvWECkoFEjowlAqUnRH9QIP+Iu4/n3kMKZ\n8wDDfa+d0BS/fb/xaDEFiGayBtnd9uKPOfG3CkOoQRamSWdOdQLKaTZYu44O\nNk/GlmY2+oq8tLbfrQTmGSbxDybfEqThd+aZ1GzBGtjORuKDELnQx0Wnsxi5\nx69DP7LRPAWzjAUZkfp9BBuSODiaaI7zg+uNCqsFawuFIJOjmXn4oXQX+ULu\n3Q9gnACYfpZJx7ZFJ681T7ztELZFWMZ+rfVPEqsNi39fPwxuIC/ShNT879j7\nEvtOAqRCpkXmR8u5Ury8DceLYYSNteno5K+CSOIPhTgQwzRKEKhRHkRZb+FK\nlljijoBhwuJ+LWY7iOegJ6ywU5BlzdnWq7wdEv3RRVwlmI59IvkBuneWn43C\n3B7IXF7dvmngj74Wz5jGD2eE0a8spSESxQQqyRuxcb7Jg6PNbpkKvEaqp32r\n5KPtHqr1E28Q8dpw8HF21Zrb5t1Y6ANGtC700Hov+2+X2GsRGCJDLgAmQUld\ntDAkic6EzqnijwomeDeXdA4CT8JFkioInc9L82vdtuapd5z+/rTFVSeB7CGK\nHYFX\r\n=+I+1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHWvK24ES+JliKbhPHOVRJc/dHKvf11cIPGwyhMSyeERAiEA42yrETZAUNGKLIM2vGtoUyAs3zGRtW+dN8bVzvPrC9s="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.c7a25a9f_1539362861534_0.4752014807062406"},"_hasShrinkwrap":false},"0.13.0-alpha.02719f3f":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.02719f3f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.02719f3f","dist":{"shasum":"4d804069e5956b330686dd5961ea989f44e6600e","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.02719f3f.tgz","integrity":"sha512-9aAVL2fOtrb/2wddD5udHLdRc2G6hdR4sD4eyYExqbbLUFDd/U33CLfeOuTn4wMlySICzeIdtnt+owJn5JrEWg==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbwaTLCRA9TVsSAnZWagAA4DsQAKD+DhlnTpVlSU3xON+2\nXThHuaq8uZAncm+I4+hhN3zUAYaJ61rUo+oZPFLcaf4CQ3eRXE1tEkc/LQZ+\nDbmAink8nU3MLTNLQjzMk+Gy5cUi19ppL/t5K91MGvuknnSQN2Caekf8Y79Z\n5lPzD7L8QDSZ+Bx5bzdHvotkrORo+JRjnPp6KbJ/v88AG6ND0rIq7UGmZvMz\nin2J3t/4558ehuQBA460UK2WihCXMrKUSGS6psEa+JoYnVfdGyq7l0sSiV6a\nddiExdUYK8Q/kqMhH6IScb6W/cya3lFJSjqKLR/Y1OJt/JOk4I522l0sfuXT\nPgKZ+POpJmo0+QH0XGzIhygovNpMCqgb+gnOvupeGpazeQ7B1OympU4qDQHQ\nPy07+JAVG7tx4+SlPLoDXIpdg+bUOyqS791qidiHe4AFRr79J3TcLWhKYPYZ\ng4CSlLK7HT/yOq0HhiapAuX7y1dioJhxSatLakmCabpriTLOiMbRO3MJma4q\nxPKcojBrxfDl6AEHWYcS8NuRoOIk607urgIjiHdjXvYQW0iup/hXsvkfToF9\nK6cd/lYXaYsrGPLJ3GstLgwcjmyM+uHy86RUViK9K0At5IDnrWrFurfVBnZ1\nrTb/xtfilG+cqGBCG4jI723zdjnBtFpgDIbt9TF27mH0BkX7oP8L7/qB6lVm\na+9w\r\n=hmAP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHmwDEzSyaD5QOK3H9Nj4Hr063jSC3Ux2fi2MlfcFQqLAiEA0OUFUdMvByj84xkWmfp/SC2x5ZBJEhFzOONIjvsN/2k="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.02719f3f_1539417290968_0.08755491843008056"},"_hasShrinkwrap":false},"0.13.0-alpha.90c73331":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.90c73331","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.2","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.90c73331","dist":{"shasum":"e7232e6542ee95c83114ac3bcef03087161e9825","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.90c73331.tgz","integrity":"sha512-yQKVwRSpzY3VAf66r3CTQAPKQNmfJmJ+tfCYPMLA1c383SmHPOjXrLvsRlv/ZCMzo6m+SSzAxD62zhn7IcAcaA==","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbwaTfCRA9TVsSAnZWagAAXZEP/2GI7TF5+4OcK8492WLf\nacDAtSb+tKzF9V8ESBJUJu4AHT9rdgBDisRIGUYWrAmUI7KoGfIcCji7jF2H\nOIilH0TAzw++l/spWhgCa2ddLBFQsF485JGrJYWLJ1227kxHCO9KSbtcWail\nUYBHaa2w+LZcL1XY55ssSeolpG4npReKUoHGsmuoo/9QYaG5dx9ZzUKaFrP3\nwXgYrBwFsO6ho0RAZEFRkdJbE036d7OXBKFzCZd1BdHG8rDS/YmlxhKsI5qo\npT8ZTiV18wgEmc72iA3+X3tBqaQcPDhytZQ/kYbpP9zaDXjggKMrPhY4UnGA\nHSAnBHtjXQ2sN1bmHDHYk5EhGsTU59pinP9UBC2W/X+SRce9KGmIK+LAtjgx\nysmlAoZg8SulKLBzGOGIAS/Vww75JOIgOuqsHMjZZoFcLyiaJnvf66HxAA/V\nHvYyF4yJTe5mNIFBzHBzbfNAJOW7bt8INQtsPmFG2HnBod1TaI2V7Weh87te\nsje9xj3tHof9rINXBvbPOQfFX2Vmo/2X4EYVP0EVidZNOhsRrkQJncLq+Xr/\nWbhoCZERe2Y4MstIFTNMu7tXGG2oOvfarbAMWjSxBAyzY/T/bYwFm2inOahg\nq0e9IfapiXWLbj9UX34rYDlhnsuA+k2KBu2j0mEHvTkHxIoD0ECfRbs1gCjd\nAI9D\r\n=xrh6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnS86oxXYW20qcMrDJhKDXm3v6sWbk3/xq5MO2fjesiAIgUgs6JVV/u496VXhOSmD8B19nFIzPvImSQXyo4s9WZxQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.90c73331_1539417310741_0.6630041618029423"},"_hasShrinkwrap":false},"0.13.0-alpha.1d0a3ebc":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.1d0a3ebc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.1d0a3ebc","dist":{"shasum":"120c082413cfe68a4822ba35d202fe9f69a6adcc","integrity":"sha512-xbypqyDPXyHIbp8lxDS936xmmVho0JQgVg3q41Q5Yq342/rQtxMFQA7gAqsJ6g6vHMpkotQQrjkFChxafpCeaw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.1d0a3ebc.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbwaTnCRA9TVsSAnZWagAAoIoP/ijSiKiGWG0a7dJPhpno\nLjhEyUd/3EA4/JvfzeTrcavRIh0Zu1I8C85ZPeLi/WpsBiqm13sO3mOs9l7m\nvOjI6ZE79PlSJ9S0VYdQF1xAW3mcvSfavR9Ln+Eas0tlQvxtgD9QgAlQ3wjG\nNpJ5Id+z5SrCVeNae9lPSq4zwW3WynjSqW7orbDDt9PJ/oB4MHjEtDJj/iyu\nd0jGQmQOTqTsXXAGsgzcJOK+zSMvro9CbsvY6wDskz1L0UlCHo+4Ov+qll0P\ntMTb9tn//cU7UgYjAIM/lP5BasAUAt3qhm2l8B78hZoFKmrnOE9BZdts8iPJ\nZSEO6zVy1ZTuQrPvgvlgXvaQVpVw4zZ2ap7VwvTqccvtu2xC6lnhfEMi88vu\nIWqLVJmIpas5JqCtyliwHfIbuKaPUaN7jsmGwC4ekdNha4CHTxHLAuxBssa+\n/KQhcIEiVHppPkXuHlpus21Jafi2MsA2T3eMODQVbi9HF5AXRvnIJCUQHOAF\nH4tPM46QIeFZTS6TjZ/wFT8Rb6a4tuFTx9McYuWFq+0xLotZy++0N9y5Jn98\ndnAaiYah3GkJKs4sjzUTFelNzdIzgVILcGpuMqd2ENPqEZlpKelUo7e39d7b\n49J5lNPMud+VfMydnJ7jEo6L9d//EuDqdGLZdsgMgzshEFDVH1xcrslUt+ao\nRmy9\r\n=qHSi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF1jRSTWjEV9ZyTL8chmKaRfW0k6W1sys+NfgCqqguGHAiBIjWnHB/J8Lt/7JnDRwSRqGQO7deXfuLJ6Emi+I1ctaw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.1d0a3ebc_1539417318712_0.22656847232030408"},"_hasShrinkwrap":false},"0.13.0-alpha.d8bd2057":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.d8bd2057","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.d8bd2057","dist":{"shasum":"50a06063574da8962edfd489cd98ceb7d7bd58b3","integrity":"sha512-iVML/Y3Vew2iFUbEL46cvJJC5ZMXC7WIcWE4CENEjY593LSrlwsOp9yr3RksT1DHHXF8GlGnPYoTUffEVoUo8g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.d8bd2057.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxSAeCRA9TVsSAnZWagAA+UYP/RDh+cZtdcL1PnEwDMRG\nffh1+VF7pq0RAUVZjircfxtSNwA2LoGt6irQUYuUpnjc6XGOQCW2ePPbEl80\nFjkbxkk5zu9qdTOzppbdJmUk9jnzz9VjqvVFgd8+l8n/37/TslYGLJHi+jfO\nlkPxQLnbiJOn9TTYWNHwqQcrhVF4zSxSb5VGFqyh/bmLAhwcwZ2wB9ehBt5e\n8yIP9zwIkaVE/cm71l3sxlWOpPDGThO4a40HwIiN0+SS3ZYaf8Vr0CvYnTDq\nEXiNrY/dHVzlq52Y0XbCb9pqK7b8ZPpBJ7XaTRVrUANtZwm5pNtCZBOSIuOx\nw0gP8mzO5Ab+5gT8AVCKfSD1SVkkP0RdeHRju9a49k7/yGRrjNLtr16IPnZ3\nff2veVZUrDR1sbEbzNnXJ+GVgEj7810uvxLjG3mzSZQxJ6eyk03jCQDhvp3d\nx/fmA/Yl66aqWohOhbnNuRC9wtCaQefo082rBsSIlOtuPni7Hpqcg5P5vSxV\nnSBDjWxIjoM3fmXynO01jzoXe5J4oHlBc2kDAC9LSgFo3ExdB2Gs9Rhli7U7\nPEf8y5fhnfzkcuNzbO9Kg5fHzNCELyj0/TPOdRngIChIsDWWV/hFvb848KGT\nEgEIVqBZoTaND8xLJnFOE7VzXEPE0HpFlSM6rQ86XiBsqXuxVidq6flI+rX2\ncKOS\r\n=HctE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBTAy5OeTYbl2YSbbpHW93Cb3UoJrC8uhsVrRYDMVDdOAiBw+EAp2Ws+9lnmSojjOnM06q8XjCr9e8GxfxnPrRZx8g=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.d8bd2057_1539645469215_0.25710681177274375"},"_hasShrinkwrap":false},"0.13.0-alpha.df4e458a":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.df4e458a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.df4e458a","dist":{"shasum":"2a71c74e1556ddb79284ee0fe2412817abdc13c9","integrity":"sha512-grxWew32o5NL8PwHFjMmNVkcpDvi/HjM4UJZNT7zMq6n5RXecWrHF/u39UMQb1TjrwwscO7GTQl9dyIwDu6QAQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.df4e458a.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxTyyCRA9TVsSAnZWagAAmu8P/RGHqhpRGY6KOCCu7I56\na+CTN9NIlrFa+UdXo8WWWnYXT3iivD4fZxZIvMJuWmGbJxZzd9ifxnOaOfex\nIvGh03adrYJe1XeHwQRXeBFz12feA7QoBcgv5yHGzBluX3UXhRMC1ljX+zM+\nAyLS9ISwHcIMVUghpwMWxW7A/S8+RKnmA5I9+2QZxCK4PzGHvcRQtb32Bn/p\njQ8y5yAvM3TASovKrz07g+cY5GekPG18zoI2Nndkvu3x6TbFz+Yfhcg0E3vl\nvDFQ+bbA7pcCazC1Ye5msVdjALJHjynnqPHDCeQ+DIjnpPnmxoH6g1gmXmRv\niKT91RAmOrXBLPHBoLwgZMeAuEXJ1p6pt+HG2mxwecYTk7RmfasPdZTy7/WG\naoO+rRQUj+miT9aYtQRS4nm1XY+GuQRjtEr0l3fyf7uYuQp2U22BGcXxgtGb\nifiTHrS5xNitFHLVEDcf6220sQ8LD3P8CCbnJ+PVzPwelLe3Ow3Pk1Mpkdvt\nC1xTBNWvRVxZdBo/I3dNDUlE/e9SNKvewdzL68FrrqnNIV5pErhc4cUPC+XH\nD0KJtQo0g2Io9T9VbZW4zJ2651ZCamV//0ecQtSiA2Ll3nvJGqwGJT2MtXQf\nAFOLW2pTb2WXb5ZPQKRnWVtlWbFYsOcbwvTiYKQr9MC4E/0qO7S3xRDZkrGR\nhh+d\r\n=4X8J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEOBzub6RJIxJ8IBi7G4ADf0auB4eFJcU2kz3RU4BNSkAiBsDeK6B3Y0XMP7PYF+wxVJC4QIZuNbb9z6dw8tsaf8BQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.df4e458a_1539652785896_0.32379502867881405"},"_hasShrinkwrap":false},"0.13.0-alpha.7f716f02":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.7f716f02","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.7f716f02","dist":{"shasum":"903504e94eb653728c048946168f7dede2645a42","integrity":"sha512-POVRsTiI6tvnq+lTVwz0WLxa391PvFpNyU1juS1FWlya9urWrkz6P5YMVLiQlgg0PZeAdxsBQFSEV+QHidu79g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.7f716f02.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxZirCRA9TVsSAnZWagAAzU0P/3ZI3+ckVGdZyjEv+gWP\nZk60t4whLqsJnQznH5jvSYzICLYK6j16Qpf4snzsa6erbQ4yE+Wo3mCKKuR8\n/AvJjNOd0D6eqEKr9HthtxJgA/Lg3KHsUpaHIHiSYRYlf8yLY2kHCKtaVozH\nUXJ60dEc+ijcTc5zG9PJn0+HiQxg6guMFekHaJ0BTfBSxY2Bez5qFUpX7/Ah\nVDUTKMiyj01B9iXQ8dHXpQqy2qk1o7qhfGnGVUcOAs3RY5+oiO0TCQIxBRjN\nR2Jv4eWYJo766Q8Vbh+ILB9mEhPBkHAPRlqstlgpg8M1XfUbeaPzJiTw6sw+\nGZ4pHVB+d73jWozTNd/uCDEDYb6A08Zn4RS0CYVh1qWuKC9yYPcbLiNJZWNQ\nMzTyA7lYVKAvHmPsRkBdLRCctmemoO10cnppRHiNk9Zz3Iohn2v3g+FAXt0F\nhC9Sfq11XcVvgRu3Q1zStoika/vJD93061ypp+Yh9S/IxXYArxUPiLwtQs/A\nAuHI92Cv5u7Y9G9y1kvo+c47hksMO41+3hRsnFMG+Ldt+T3EDCxwD5Cel4Uo\nZYoErTiXw0HGWMfVTUJ6ROjSM38AfMbRRjmEs9aJnBQVDc+9CuAi5EoEULie\n/pM2D/3UPxYOzNLaBTkpWQU2MRKrHWTVureCGcJNQnQdMa1OLMZUdnoHr0LK\ndwPM\r\n=V4Me\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIKqhOzyCA4dTHHIb7Vnu6GfDes59qZqhsa4cZ/7+jpAIgMEQliNkzWoicJKg6luDydi/JZPt5Vrg0+Uv3DC0OG44="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.7f716f02_1539676331086_0.771231105261384"},"_hasShrinkwrap":false},"0.13.0-alpha.c5ee0f70":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.c5ee0f70","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.c5ee0f70","dist":{"shasum":"0629e9bf0e6e63eb906710ac062e8eeaed451ec2","integrity":"sha512-FqzOQFnxi3R9F4ScAH0kn0cFFmRIGxEzuwpbmtmpH8nFNnMIWKwEac+xXSN+ODWHnoiwv1fmDYk8i9dPxe4D8Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.c5ee0f70.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxZlkCRA9TVsSAnZWagAAvncQAJPgep3VRWT/psDphw+m\nD7a9peu2SHK6LrsmTZjDm789MtVL56uEAKWXTUylkNgdmhX2DUPRqhjo86nC\n2QpYvoKxyeMChO3OPuW//ZSjj9Zkv9iShnDoFzmyqQtJPVl00AktGSaKpl1S\nxXmJ7SsrnK1P7qWOBW/oIteOiboafeLc7zSCZKJ4eF9baOa6aqBcMTMHhnDE\ngWXqfb99KcARsp7CbRm7gduTb0QpTd55pjcVzqfujPp2RpMy8vKy9WRUa+Oj\nGxpKCtUpKLqJXQ2C6B7DulejJvpsPWt4dFrwgiZbEjIjDTrlYV51NSoenI7C\nx80svXilhTpucbi5zWUyNqCjr3Ev9FBJCnb2u1cRJ7ZQePH01bnbAxWnTWG3\nS8C4WjXsUtazm2YgZX4RDB4wVzOX2CyASGVasSl9C2ef7QuZ8UYCvX1eLnsc\nQHdeT5JNanecNLop5+W25e2vyu/BKkXkaT+GSBtMlOvHFcuCi2L22xuqm1+X\ngeHopbs/IGHm9SwwDr5kH7+C9jWOk0lLmYQl73yJjEvbGPvZlQFh1mTY3Olm\nSNYoHNMlF9ubdp+z6GRX+t5AE2QfpXzOw6TXRkckqJcpJct5i0G7PVmziLYq\nAC9sqz9/1/zQlLrBc7J3bMIEx+9ISlxmDlpiMw/hRkSorFlBIxVPYGSf1n0u\nxKdA\r\n=Z6++\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICoeJ8n1HCDi9LLv2nISr3FbjQfQOhAZkyGs4ht5/XUFAiAY3zZo7+0a/VBek7PAk6czk9NMThIoneAGflQb2uApFw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.c5ee0f70_1539676516001_0.5970012461094516"},"_hasShrinkwrap":false},"0.13.0-alpha.4582497f":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.4582497f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.21.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.4582497f","dist":{"shasum":"15719646d29810b1d66cac3c52ea89fb4ce2f508","integrity":"sha512-JpPS7zJ/alL8BSoRxUFIXc83FyY21WRcppvo3nlKmyeH2B78obPAP/ut5MrEdYO9sIrTc1sH3KG4ZZsQf9Ba7Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.4582497f.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbx4CGCRA9TVsSAnZWagAABXkP/0Wp1Sjk7i7NN9rG0zNU\nGrw62hk7rEepgqiyeyF0DNvMxRP85aY3tNCXwY5k0n2BfjtcL9HFkR5un0e4\nzo2+p4q3uwcogmc4vrkFhh3/6EOklvQuhfy/03oUHPoqSM7vGiQ2p139x0zx\nPsLRBrBredvsP2VoFbFCZreuMS9s5ZQ3yIR90YXk02/Nvq2JrYeNqDJFyjc4\ncYR7IsgBFlLEjRZ1ouw8kC80AsU0KCE/n9zTU5z15W0IB614c2KmbwWcb4x6\nllC6OMrKK8F4MmoP1ABEolaPX77NuBv1k36fPYSbsTZnT/NFRp8A1n32OBRM\nNLJwwpX7ceksI6tMvFOEWuyqE5NjqBRuBSXjrlxm87uVVfb/ebRaiHjlxrAU\nyL+D5nS1oTSVhjINGu1fFFzeVJk2uguqLCdqTYmANdYKa5msI0amAP6WBweT\nZcDG8sfvxUHWeaMl9HKrmJe2yMroyO6mNyKd6DUrI1/7O0P8gF+W9oREKrWU\nw8mHLIPtJva8Kenc27xnbVmLJ3sIjsJbT5aKst67uVwwZHDK6lDC6TwzxWr6\nPkIDKb41tLkZ55ndxLZiwecJOvTL1RgUitHIppX2+lKVGR8q9c6lN8NG49vB\nabDDCmmIPuY/8ePtciUgxPJdQG/8WRjdHBzdB6RYqsWraU/Rj4nfq6msAZJ0\nYo7g\r\n=igvP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICeQ+840+H7bvcbIirBtPMFymgKzMozHpZQkWyNoentWAiBVnxAOpjLnwWGa/t7QV6Dli4U9i+O+8cHlNysksJoiJQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.4582497f_1539801222130_0.038778158813165264"},"_hasShrinkwrap":false},"0.13.0-alpha.1dde25b5":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.1dde25b5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.1dde25b5","dist":{"shasum":"6838d814a6ff83e37c3fadc8ae6ebbbd1632509d","integrity":"sha512-KOP+RVg5inbi3S7NhR3PhZ/APu5eXGQtFBm4MEhtU+phkpUv7k9M1N4rV9Zkhwibqyzz1tjOLVEv373df6Td9Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.1dde25b5.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbyFbsCRA9TVsSAnZWagAASC4QAJR9c3O7t3OFkXModFae\nzdJz+J/94f3WvW1FVt8nXNPFCouWWIRK6p84kN4W56KSsHuZGX0VlRz6zRAI\nzzLFAdzJVP5zmCPaAbyFFjrA6AXB+JYexoHot1ybCDXs3HYUrt09GngkKTTY\nAgOfPTUxmhYpyPWTDnuOL4WACMUxfP1Ew7J1gVKsrlpKcBLiGmkveKhdoEY8\n4SEAF+pU4oZ1U0rJp/Opu7GyDhpK7kVHwIgpw3u0mqSIiaUHPs8tbh94m/vf\n+NfqrhdITQiIqfWpF+VLDbzeOMXUcWlTudeVYRWmXZuGkEbgnaCKDeQb9SKI\nXr5hWCFLVhPEW+QtKNcWDVDIDG6MmJeT8NV9q1QfsEDDoHGW2bu3a/ChHZIJ\nmafcTefqP/3dH4XeX/e58vICPEp+pV742omnj1rMftqWo27IARctYGnMGEdZ\niFCy9iIeVZocKjOzDiI1i3my/FQ/R9ryE2/HHIHI0b0x5lwL0YGOz0keq4IN\nMf7ZawStVsIbSNyAfNY/bs0cu+Yzil5JR96/ij/5NFTsnXi6bitFW7ao5Jwx\nXirnYNUJjj4Q/4GRmPon8kfnHrGOl49LkHDfWcFmDBjDbHPFQFjJeNauekXX\nG/2ErMLATqRT3xS9WhrIQjfyUeq+1IJY45PfloMrmJ8dmwy5Y3CLYpGfrSVo\nKm/4\r\n=OLB9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4FJD+29NTet4MvIhRUN7b34irnrZXbe5oK7uM3wKZzQIhAKEdJudzgDJRxb3XUyIF6CZe1E69YsmOjKiBeF+koLYR"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.1dde25b5_1539856107469_0.9700919524023266"},"_hasShrinkwrap":false},"0.13.0-alpha.8e20bfdb":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.8e20bfdb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.21.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.8e20bfdb","dist":{"shasum":"3ddc5708890138a70457c673269c55f426b09e84","integrity":"sha512-nFrHuTWYUs7ywGc/rvgU/ZDjVePzzTcVomQA3T0ZYFDwmWD73/xLc5gbVdgUpLl/REk9+OnpbzROY6SsNYibGQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.8e20bfdb.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbyG8ZCRA9TVsSAnZWagAASt0P/jgJhRJiDUKiLbgH/hkx\nfaACWklj8mDcvN6yqSgGe/orflgtZa5Qo//P2gisg0v67dBBwPm6Mou4BtUn\nxohd7PLGvMBsjcqPpi0oeL+3+9m3frqnsrS7CfCHbQ7v7Qia86BOE2ElP4/K\nvzhbM0CaPuMTzLFiJMjEf9nXaL8Om711LBcSpGgm/kgy4aJzQieMZEmDKniM\nlA+b9RI4k6b3lFGNcBpILNxc7TPNJwd29qVUtJgLY2pCAvJm9AQg3ZQNzeTq\nD5jCrpKHhHk3JUnzgEMll/zJ+FrVREqvZHek0Mpe5Ho6bSvN+t372kqg2vEP\nRjOEjypEfRLxsr9q4eaHwP1TFgD7770Wuwns1zgVbMsT2h7mRPiB0dY3DWtm\nnEkZveJSr58tu0S49a9T3Vsp5d4FbSZwNX+CxVY4usf2ZF2dJA+0z7+Da5bc\nBGda0nqCqPHQWp8ozKkdJzHX8Vr9SQhDD52Lv38Lkq9K9+GosGcQjAkTYfPS\nnmLOnhPvb4Q6pZF5Q9wjrxsI58f0DVSDn/3n4b/CPj3xl+U0MRxX9fM37hRm\nSMW5qqVcrGtjB8H7AT8sewSdDbpCmRoAbUg04U2cVeS1Qp+X1h1KYv8dfdWL\nRdXi9x/P6tzUNXTIhb8jWaSbvmXK1h/7WrOVTMyfcV+BLqrzAAJD6ygyXqoI\n3RW1\r\n=MbUT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtjwoF8/7X70JA360brt+p9Y6+9WinUzcGWcrYMXoGQAIhAJ211nmOg1XX+ijYeXCO/JL4qgYGseQUXfrkxIOEAQmx"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.8e20bfdb_1539862297137_0.492882520448525"},"_hasShrinkwrap":false},"0.13.0-alpha.b843184f":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.b843184f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.20.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.b843184f","dist":{"shasum":"87113e3645db9663f3fdaa5cbd52af61f4fe7d07","integrity":"sha512-9eskQMn7YNEzazy9gl2WGHI2g8RPHOXCbhIa3T2URoxKm2y7q9A/BUWlrLf+5BU6AluakOBrV+SrCwNu3Px/Yw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.b843184f.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbyG8qCRA9TVsSAnZWagAA6S4P/3gfALR4gtCU1kL1JFl5\nzyTob1IDG4XzG/sd3+hMGydjfPHniK+YgGbR7ecKSG7ePohTBqW1VTZ9A+wP\niL1stS5mrb/k2h/e4NGvW/YP1ynUYQRX4oDwK3YApqFdra+ecD2+A2WzjZnt\npacS8Bit3Le73ZuEhtt3UouQZEG3m3O9aBQSpqWo6rBTzIWcP5NpEAjs4IwY\nmuKZWbbZdBTis3J+7yIu0gLvzxTlqxrDtEG9jEfIJqulL548rDRkebYUY538\no0+mc2jRm3BCqMip/xZ1UuwbJiH/PY4wRpcq5xgE/0yXp1uHnPRpNaBfHcOE\ni+i0rZqrbEeFdLkvFLzKMQ1BBeX5nPoPCoQPZ5PIEbnmKkcF3ESFFv7fbZaW\nuNTyS2iA8k4aCQYQh2Lo/xwXqj6HHtt52HNuhtaN+2wyic1Rs7/xkrPLudlS\nbdGB+bjxtuVKWpdVQZfMlE9C58S+mhPM+ZVhhgM8csFzqlbgITC+xn72DyEn\nf5nbPCbwSq6v6tXsVmvZEmF1mxRpqZJRDlKvS80l4md0asTDF4sR5W4IwJOq\npzl0QFsw6tqGI63txFzZPT+b3IIrmevvZyHJPqLSlcBWEZ/A/V9556Yh6NQ2\nsGPwYMaN6s+cfh8wP75i+YUz8Iy23KRM/D7n9obVw++j4mv5Vk6QS6Nwghnq\nFzo1\r\n=X084\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSn2a2IbcucNvJS3LT3HW3ZqtnERX/VrwA6RzUT5CsZwIgZrDhLX7QroLVo5URQ881XYSGYUE1G/JaBCqoo1E97bY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.b843184f_1539862313578_0.43986650040960096"},"_hasShrinkwrap":false},"0.13.0-alpha.adf58fc6":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.adf58fc6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.21.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.adf58fc6","dist":{"shasum":"a275283392b6baeb83a3e2c66b68f264ec9a3823","integrity":"sha512-Hf3AK2trqUDuMbbAmNermDL3k8VjfBsSk0bmJDBrpiSAxLWH/mh38sA3WTh2xUNNKGfN+dpsWHLEPhwfiLcpPQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.adf58fc6.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbyNU0CRA9TVsSAnZWagAAA88P/AsJPS6Srlq6oh5tgSn0\n+vxUQcF4g/zqa5VQ6BhFjDBxNrF4a3vM+pQmQQsuNOPZhN/fupCvVqtq874R\nqbzUaGlYrSGrYOS2S+Mj8yKNxUlyyH6iiNzMf1ms1LcQeavAQRRqs/Fm0So1\nkyb/OFDxy+7eWi0W6frujP30N0/aOxjcbjCiRqxvy//f+pw59gUYIET4Hbo2\nXIPHQJFMYkh4iTwcJlOwzMsh+CibP+L0r2onXpsHv7Vr/Fp+bUMFkgkUvu0y\nMTeUsB8hNhYEKu6HqdrtCBQPX5U/D2PKtsHKvkb8UtLPnnTSXze1fOS6QIzL\n8fxCGynMEQ2qIZl2gaFTJBAYAuE99z1pp4I7Q/OA0d4QAP7cXkhYPNazIOSd\napuVafKe9nVJlFFtCyUkOyRRk0MlTX7y7v1ib/82xlk/hN76jjRNuf+DNEEc\nRiLbyhHr1WWn8zDjr6Et/coRzy7srq00tcwdoBu3lEb5TucChMEcn4d3Zo9k\nnah6RPrWVIIgEWnvJomofVDY4/6GWUcInggb9Llu7pSVQC5oQyDfcfEEtEZZ\nH5MkyfLcGwq0j04hlkckzTiTKpaVgTDdesfF/C0SKi9Vra2gEnx5ZMIGtaPj\nqlMEzpReYjikbfE4rFZGXTNUgkvN/WTTbZEYbqAPkiUdPWC0bLAJceLN8oC+\nzNES\r\n=2ZhH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDW/XhJeRpeq5T2jA/jpM1xYQm60W7yJ6mFfv4NAn0EtQIgU51rnmTaLUZm91W3pO/iwPkKRH7O1IppzMpDoaL1Li0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.adf58fc6_1539888435299_0.7469502215292148"},"_hasShrinkwrap":false},"0.13.0-alpha.1b8ec9bf":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.1b8ec9bf","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.1b8ec9bf","dist":{"shasum":"4f28dec82ace8661a7db2317321c43776809fc78","integrity":"sha512-Lm1DJCEblgeeQclbQHGsCY/BiX0xvMvBl0uLxAIDL4ozJLi/XPz31jyCj/wk9/4Agn9v6ClE50EryuXPWWPEhA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.1b8ec9bf.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzE3nCRA9TVsSAnZWagAAgaMP/RfnAbsWNI9GUg056fBy\nyDQhkG/vjDc+a43tzAMNvzwV3Ok17ewwNZ1BrPu0UwiqIKdphGDnUMoF0hth\nOzuurunAgx5p/+IqD5/q90uI6lelwPZO63mAZZPeVjoMhdMUZGBM1fsuJdQp\nMw94auMPeMPGJFp5VJgZcnDlxPSbfqcMk8E6+ArD6DtRNGL3Y+FmprNbSvTb\njNOr9fPB+HwZa/uvZvzRzAU+mUFS+ut/RHnbr+vzgmBlJEWnztMQX4tduEkG\nddquyPg6QQIBcaE25lZAi4rY5YI8peHsU8gBhXNEBQAQw5amG1/nxKss3FGY\nT83jrm8PhIGP1+lgNj/0nsx9smEMrsVuhl1dfFITyRJ8jkONI55oHfRzTK72\nNQqRCJadNA+VXHRhksbCs+mYXXDstRUYPMGC/NIL3Fzf1ok3vYLVdCiVRJ2Y\nLZ/8W+ArkjNc1dl6xPsMxfUf6XHmVXQYgG74LSDXR92l5YkZJ5KPhH1Sfp0V\nXFPjY9T0qFV1uqwBG3Vtlx/T5bBPqM0PzEgUPbXumMdVsBXdKpN3mAVNBIDh\nzw7Uyp03H5BbWXJIVR3E9S/4709r1ldxGFDiNxjw8i55j1agZGUd9Tr74NTP\nZ8PdncS52l/6j55qfBd5LXdyUTrPZKYgHdNYZWmGm784FZPka9/lKqPSoyZV\nlb0w\r\n=VWSj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBE0aSIKEzGqPz0BDuU3hEkx3Du1O6TiS7O8zo40DxrbAiEAm15p4sUodn/MXgC0UxJWRYDwuqqYf6M2yWk3RX/1CpA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.1b8ec9bf_1540115942402_0.7967736232809759"},"_hasShrinkwrap":false},"0.13.0-alpha.c5c9f329":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.c5c9f329","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.c5c9f329","dist":{"shasum":"e89e07f952af94ba243ef390250f51ab55e70ec7","integrity":"sha512-xslxmAm7ppBeuo1EJ2OaHsTzm5246MEegSIpq1QdK2j9puYWr+C+2OuaD86DK/8DqQADS0STzAakJBBswCa4ew==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.c5c9f329.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzISMCRA9TVsSAnZWagAAyBAP/jn8XeSnA6Z7qOIdShKG\nYdNyJrY9qEV46bjjqtUX39bbNf5OhajxEydZXp72l0PElkeu+NIfLyzV+uOy\nj5JFQjKprOco62aITnsVPhqHNtCmhkUviy7TOOwgmWc7RQBGC9QBgQKInyWP\nPZEV/WcJpbJX9DJcsYtlyY4UYcPrl57U+8ZKinhw5XVB4/MKkWftOYOE92KT\n/gE5fIka9r+FFB4vyC4k5yvE+LB4p6teYbhmqDiuSYsGTjG2m6QrxWM40oWz\nVcU8pw8EMjGLZbOmTWi+gKxbqjCfUcwldkq37KAv0EJJ5A3x4H4z4eNja25b\n2YF1BLzfwJj6rN1aHm+4EdQymvcSZjtPAmNSpQ6gL1fN+ln7IOd8Lazkj3pD\nttOMO5hW6rUMgH23m7HEy10s/CQwqcLOjivfLqCnSAWsKFe0CTHcRKCm3lsE\nQyMUcICz35Ah+C6h+DkopdtYSd9dCg4bZYkIRsJ3vbP0Xzzzbe6jxDdbqhBj\nMTBXdiwvVulaVDPWZQZPuL0WgGIwu7AGV1CwNBv26Z3ySQ9fliQneQeIAqMc\nG1bYxvnc0rn6+adk1DN+5dA8kESmGyTmbRN2MS5EcbEWYMp731kWy8jrS2T4\nCYy4Lm/7MWcneMymUwe+b5Z+pBnEvdk8zmlgEHjnPBee/5qVGyxwVHBBX5In\nvQwu\r\n=mjjS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCC9R0i2JFh8VMCaSI2SK7Bk3R+mmrLrp8V3HRU11tqgQIgWGFT6WDROYb+4Dt0MH/Wji8mLavf3qWrfQ2go19qAIw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.c5c9f329_1540129931606_0.6865388734235551"},"_hasShrinkwrap":false},"0.13.0-alpha.c80566f8":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.c80566f8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.c80566f8","dist":{"shasum":"12ac75e16b5077c624d54eb3d17a2c21c5002dc5","integrity":"sha512-aky8/h6cCZYWBodMTx2wh28lqpU986QO8L6a3gL0PCAsR6OA6X10IujFJPASM3KL2RPs1hcWCRDleRTzdTdt1w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.c80566f8.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzISwCRA9TVsSAnZWagAAnkMQAKUj7/wYiJp1j1fdTHNS\n8uLWN6jnvC41hFXWTOmw8/YSdZhz/kO9CfrTa9ThyfTTrM2pTHo0DOKp+sjo\nOvtuwTx6PmtewJoGqEYFLvBpxMMTi6mVdgt5b2DxtE18XCnw1jAoK/eF6FLp\nYTVSX9cE0852E6GL29WE2gNvHPzyPIlCJQmzsC02WkiuzQfH4RrOj0dbS/hr\nIO52Vwp8hYIVC1g83YIkjHDb6udwocfHHwwyE3HDSec5wHriJm8NjVGaggtI\nvJmY24mhX+Vk4u4ciBQnZoJPhw5xQduOVc7xXckzxwwtIx3FA1/clyedpXSw\nyuKS1orS9RUIbNzEmv1rOlOMZN1lVG5fSefPKa8R5YDTjIyvWN6cpSmA56Tv\nxiJeDzunSWnpqmQRXlOoc3KtSpegtsq4rqU1VRcgocti3rWYtHKUYCNuYksC\nlvWa2B5wRdeYbksk3dIxAYygkv0GAvkx4wDKdfWmZs6iaugfGDdcb3MmmZLG\nRNbtsectICVyK7U7XkejYekVx1nyVFRqtkUxEzGM4tJh39w8yaI2oMan5J7w\nAQyrG5hwOEqLekEnL9tuLE23AowqVk/fWfDqFKCPbpjZVLPRxUhDa7SMxIIL\nmediBKm6KDdF898lOcgU0qlMTK6XSi0vMoIgvdDVYUApnAECDq40GiaEWxTs\n2HFg\r\n=/Yzx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEOckpwpuuIYAd21DGPWUE/viBwatlzRCOyDkvD0HVrwIgInpyRkxR4T8mrl0Ndnat4oHKrONj+RakJbXWENxAAZ8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.c80566f8_1540129967566_0.3712534792891775"},"_hasShrinkwrap":false},"0.13.0-alpha.779c2664":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.779c2664","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.21.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.779c2664","dist":{"shasum":"5c94b81530709c6cee5da384c6e123924ba3fb83","integrity":"sha512-s7o4OftnqcjbOS99TSpFaw+Mj3cEO3DaySCw5jEPUmf7EMev2WgPxipsA621Xq8xxIjZ912EgTNPYi/UlnYF8g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.779c2664.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzZVlCRA9TVsSAnZWagAAW3UP/0tiXM4t37SLLggWXmPy\nktXJohYCtg5L7Ed991W9ENErV5Le4ptVFQCamLbtyiqTRcihYLaTaLRd5T6U\nGf5OYu+GvalDgSvhe0SwAm/3w5Wo8On8Et4tKmU1vDgC7SX24IAIZxgFAfAV\nEv00ogZG8AIuSBVeuXpw2q52CKHfen0s0Ejwz6AGNnqb8ik/f4SdCE338yR7\ncg+XE+z60XIrk6wDpa0HqMnsVefkn0EM+GJqOGZqrgOBpwTrKh+fdB5UY0pQ\n/U3n7mF06QRxUP0HAvuG2dfFIuKfd+GbAvd5deIuJJyFdLi5bqAO5cXcWCpH\n+J7okVe6qYoYWC1o5jCNQxXHWPT7p+UKmzhCQmeQB8HWjMHu3p5g9dCsfaWG\ngKX655RexTX/DX3BLUPJBhSGC9rFFbTEHr6ZS1AGutB5BeyIVYxnX89tniwS\n+VLHTIKVz0CejXjiWaxrfo9Hk2TRuA6WINwuhAlahTEd6E+egkwUjna4hGyq\n23WLCWPWulxVivgeSF2AKxL+WkT7SYjXnQde5UvsdArdBIq+IfY6yMVwC50W\nEjFKPsr2OQBIbrjFAm6jEND3W+78QEUH/ijmMN+pbIAO8yQkbsEzdq6WybLc\nd5e4j0zJtSi8TPzZdqBuf+g+6spArRAdF9dfMUXNaPV8VfPzW0RsWZHqI6TJ\npyBb\r\n=CVlS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCN3XnKVrrjMJ60NWLuP+/9O30EAAnHCiDbABD0ocbTYAIhAOXDShXSdP9s193QOhpuJBMLU+YB4JRKk4x30WgsAOs0"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.779c2664_1540199780602_0.432251246544193"},"_hasShrinkwrap":false},"0.13.0-alpha.40dca563":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.40dca563","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.40dca563","dist":{"shasum":"8022cca70bb6bd459382096a126d1f35179ccfe5","integrity":"sha512-fn/mycx7p33yFQt2jlqdPrldgWpLCt0QIHdm0QTjzZuX4u7cW32gYaU9LH2mmHTVEZPMZgxbf7YhUYjCveAWEQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.40dca563.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzZv/CRA9TVsSAnZWagAA724P/3Vat7MRCz8uyhFC82X2\n5mJWWYyGQEIpFaBtTj69Tr+SdgVQr3v9KwH6ZBdb9npLxnofy0AhhjAAzgnR\nDSc2BlClKzkY/aaVcmJLQ05HYNLx5q3SHzM4pFBHiIDB1Mv9acOOi5SAXQuI\nd3QFn54id6SVJbFA89ScMezZqGVABT+vdUjEas7t4h/XbmX2fGX4vaiBSb/t\nkAO9mqiLcOqQj5m+Er20+caahqVDZhiqN+0mZXhv00cOkmGZ9+6FsLAeF9hi\n/zlJw8wz4uO7HZ9EEN4YKRiEoljptahJFYGsj4fo2YsL1MjoDcb763HBVOyf\nvwNrxKvGWi7eDg6NNVD+JjpH+q/tKynZPRuQI8Q1DQaLAxXc0qwt3S4HXjNX\nVX/KcDnJ4nkW3gk6ZbfmFP0VHqW7u2iRsdc0SiRCGuEsiLdPt7I8AmD+cadx\nf6RE+NeYuEKeDQV3G4Zo6UWTOXLXgqmQoqn4mE3fi2JlXmET4uXXRPHuw62R\nAWtP4DDACJX0amcisJvKbsLADTsVtR7Jx/qAqltnr4reF1mc3/G9pYBnVuaE\nXXNfLUuHZoxSfaAJzR93/w/g93C141CPsZDRclhO1sw8F0TxU0kyOectRoqP\naLQvhkUtyUGcAQCsxua1NROwIoutrV0Qw49mCkAlIKevUW63MKlj/BK5nQ42\nmB1V\r\n=ugvN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIb9BqC1zwPpCqVtTl22BqNTg91xcBV91MSEMlb4unZwIgSBPnVU38WbMSU+3ndKZY0/BCK1+1A3ArrjKWHTlq7w4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.40dca563_1540201470474_0.5471136844937474"},"_hasShrinkwrap":false},"0.13.0-alpha.32c1e109":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.32c1e109","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.21.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.32c1e109","dist":{"shasum":"034a2c63130fe10dc30be2e03f251b487a26d1d6","integrity":"sha512-Lj6MQL8SONtYQ/I3SWDajHsyclUTrHPOFj2o9qMVlo0T5Zgrp6CzPUsaHQbrV/rW0nsh+fg7c+wfp6eyF86PXA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.32c1e109.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzaZHCRA9TVsSAnZWagAAwNoP/iiwODgTfRpSunPfpvlG\nN6nTnsEna3fYhQd3UE0pqOnif4aR5cnkkIHLlIUUfZ40at4wi5PfmWzyKRMk\nyAZuq2WYrpqyJRBsdWU/b8TDBBKKk8Dc8mcJP63vTB1TK0cBuevb/weegTDW\n3xHpjoyJjU5kUuBZATnvD88LY2dJDRkInDSfUzSsfJpakHqm++dcL7ekjeKa\nN9INH+WBM/yn9vSTIy9pbnI+picsrnB0oZDq3BZAE5axotA+/szc1x/Ew0nP\nKNQyspyCpDdj+Qqjy8Pdp/ldYwlINKnfySYl8PyJUMvIcGMF8H9vsmAH6bmk\nRLAMPO93Xzt4DmxRGvrMN/rjHgslsWq7/5/8gLFLtHop+ULGSDlQKPF2pxe1\n0AmWTDtejL2/nBT0N+EBD4xyQ4k10hliLsXrlz+N1NOk7dkcclNGi+dsXe7g\naorL3ohbeVqj8uCQ3Lg8iRJO3V3NNMdDOuMUf3d+4Tan7nYKDgfd0AUQZ353\nIvAyRtWiEW85e5zBz7Cd+o1t2EN+0cDEgfsNSpgZOEvn8ueQbg9AjET6tNes\npviviwcEkeBiyAYoh4TG+gBLnRwshSBlKzwndxQlGw4rL/BStLl63gc7RhuX\nddt8lJemsljMYuc52XtNdmOGHfB/huCsY9zwzxQ6PwvGqLM3YrvnoeaLJETp\nX/sy\r\n=64Od\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDupxQf2TaNcEiRwXcudYi6bMdzFBnPyVBWe5Ni/DgY+AiEAmi75imzJqKNOnbGaWfpCxpyjfrM0qXe5ak5ZkcF0FqI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.32c1e109_1540204103071_0.07024051038976697"},"_hasShrinkwrap":false},"0.13.0-alpha.5900f558":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.5900f558","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.5900f558","dist":{"shasum":"e8a106ac9aa5042913cc05fd42ca63cb1c4b8cc0","integrity":"sha512-xpowQV0gO4kyz4EkJYnCXKRtKbHIXEUeK2W9IDQvcWM4EHoHmcjJcvBPTLR/sRy9Gagy3SESHj0pkQi7PNXDoA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.5900f558.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzae1CRA9TVsSAnZWagAAeSIP/RO71NNcodZUoDttH0As\nbIJ9KxX4NbfuAChddynuH20Q21OBOFT4hcHxWf6yGlc3Q8gzgAA3V5Js4zSi\nRDKZZxchxACYbsbraT/zcDtsuQ+vQrbAXqISP8JbyP4J4PPHpFk6YbJJH+1O\nbZiAuptinqLy6hfw+88YPZD4KwpgktGVfNMftZF2YTFqoOUMuyQ+n4hcqjYC\nUEmysMJFrLF17OaPP0YYu6OfbNjyCkUoBcGcm4N31YpsuCzs+F4lA9gV2j8k\nA2mc7a+xidg55kYsvE+RsIihVfphwWYjm+5RRrho88+KajVVJBUwEohNiwar\naGmB0se830Zhgf1CqfmSIl5duTMnsT+FhlStZ+39UrM/FswE3MRKfVDFzyTQ\nAF0gWLuLIrvhgI3yGHFQWsVkCwLCLSs4I6FYxZHZyFnnWPVJFLPS55vRCFze\nP5HAC7c5d1ydV3HZuHQnYlLbvtX3C521mn/qq7wqQstFQ1UQmUTyStn/cT57\nU1FZ0xoYE9OYfSdi4I7oRAYQoBcQT+p+zG/0MbU7P5k9Kebancf6h4d7n/Lj\n859wXVjfGJePDhImhEqQ7Tyvk69LSdP2x4ym4VlwU26UMUkHdnLsL2wAinw+\nrl4SF4I4JSCi21YMYH/Plfx4oWndJmvJsMOCqPEDZ3LGaf6xa8f0Kk7+w8jO\noKmZ\r\n=eVs+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEnsCHEEFjkYq0aMY2uZG0icXupsWViZfh8lsEelVLRQIhAM3i7Ta0Erd1YKIbp7iteIJTWIMfOSoeD+9dTTrrspfb"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.5900f558_1540204469192_0.3174667516934009"},"_hasShrinkwrap":false},"0.13.0-alpha.215bbdd7":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.215bbdd7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.21.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.215bbdd7","dist":{"shasum":"b9b3fe30388436eea5dd9fe3e0b30d670fb31dad","integrity":"sha512-Lv7oWbJb56rj3kTTh0GP/+/beiXLyMMY1WPsM3BkdaLUUVTI+j3BoQ6ov0tZAc19+yGR+vNIjUakWgZZErK85w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.215bbdd7.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzhVICRA9TVsSAnZWagAAh9UP/RgB1hTJ/v3vaIQKk5v+\nqEn2Rk1LfgLMl2b3Rge7X0WC2o+/9Gt6Mw0tbOVskTk6ctU9z63nfVu0YOH+\na0ie7AodsUDrTAm4xyjuQOQTigfu8iBCR6iFoMQD/I7imMg5TddmY/gy9DaA\n0Di5sS0APcSjNgxcnztCvTyGIOLtYYdyn+i+gTxuoGm82Hc75CrucWLvl8jF\ncjFjR4MGjLcpcdvagRNmElrCJI8f6VMrepLPRWtLvLdxD6jNVuSjD5ZiidBf\n/0miLFXIBQ2uP6ZGoKttuxWiQwG1h2pElIEX7tx0gzKAQBth7mrfsfGqfTBa\nRGlr6ZKDXcCF1GO8808qOFIlRsyaSjw6qVIQf0FRGwyaXY9CH8ItCGDK3Sz1\n/h9Y90fN3p5Nwv6/a7fIiAFHFHKdjNd8tLdG6SzQbK0DDPRJP7wkcA/VZR0n\n5EfsNO3uNMPObKkH/ZYQHqo9SAFMecfcgU18ZzA9cWwmxdJFRer6H2Tlj/zn\nn8/ROzWFEBIuzuVl13mhbJUE+NqpIUhmwMPE3K3EQMgNQP8A/DmmMjJ06wZY\n3zDlmYuXU1YOZ08sKdkARJLw9cxvMq3qNvXey+1GmEo1RwrEbyzTeaB8Fh1R\nE3q9PVr2B7WPvQlxR6k0RKfmQtGwRQdmN+mzJZPEjJjPEtrLzS1L8gt/OuMj\nRKxu\r\n=7NGS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJZnbiWqzcDvhJJ9OBVOdWifRUl1ZV0ZMk6UCTdNV0MgIgMbYuDxtL8uU8/hUvaJyk499QtaSoWmPUk5N4ldhvMWg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.215bbdd7_1540232519104_0.9009687263121404"},"_hasShrinkwrap":false},"0.13.0-alpha.86ea85d2":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.86ea85d2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.86ea85d2","dist":{"shasum":"eba6d333c96063054018c2e823cbee1822739ed1","integrity":"sha512-IljGL2n5UnXPF9/VtxSZ79nXLqXA0yN0AhF2daMvGhEJcJQzA5Hpsq4V3v5Ay0Cwr4KyDyxiCSdX36u/cOYhqA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.86ea85d2.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzhlECRA9TVsSAnZWagAAizUP/3H/PrpGpM/hOq2I042r\n0BkNWvHF0gpODorabqinbwaCUr2+P0TS5juFTbRORYci/2Fs9Ze7opQ38iFN\nvGrUxCPH/hV4aaQXb6TBMQcEd01+X96p7paznk71LoXzzzdg/ct5GTmunU0F\nZjTja5AxtdLQbKtn0m05eH1BSND8qirI/yNOeletMo9TL5FFLPc0weryoBv9\n9B7HtFlJH9j3DJbvbU/+lpV6s+DyS++Z4yf8YVxnyMvEepJgBvXbU71mK+Zw\nMmT3sjM7xIzophCIIF79hcoISd+JA6MRTT/UT6NgNEyZCCCNRNm44QPqJwed\nMwJbTerOWdeg656lX0oDuG1T1F09DAZhHRYfOVqoINPh2QuUvMJ0d3wpT4tZ\nxiPEAUF+kjhs3q07iyI7aV6CrjHuZn212iUAmEp3UebvIZ0dgm8KikFN7m1G\nLIQe2UM9id/k3YC1TQ7zkDlujZiVxftR4VJfqseOcfj+cgD+O0za2rHvBjur\n5kmdA+B314OapsoM4tj8EHiBSnY9wQWgSBE529rd02oXWYU0CN6CBPBxXVbS\n7+9RZfu/6v7U9/+G2zp6IkpkMtay7HxCIGGITMQIUNAC3vi0kbEdXba/qa6u\nETmHPwqXSLXzAOJH/E7M5xFv5sWUzzUCudhGcHP+mVVd9tYBLmAOyXjUu2Ck\nzvZf\r\n=p+Nl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD13zdEgsm8CA+TErHv4ljkegkw9PSJHgZ0bEuYsX6LyAIgduK1Vav8g46X0WqgHCjzebtsl7BGxYTBDPyPkUxhz7M="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.86ea85d2_1540233539195_0.8058818042430613"},"_hasShrinkwrap":false},"0.13.0-alpha.7928031b":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.7928031b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.7928031b","dist":{"shasum":"aa5bd30e911130e5877f20172adf7314122e69d6","integrity":"sha512-AdplruUl9F9aaLVgs+xEG9ojf5BMgR+Rd0t88EwIojFM+uDcHxk4kIvKOQzvZbwZKVrCKzgWLI3kDkouLex8hQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.7928031b.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzhtYCRA9TVsSAnZWagAAL9UP/2EguvQajXqT+DsRDbYx\nNBdkgLzMxrE3oTIPAO4f1UN09bJoVJeqi94Q0MUQPTm6udbB/mBLGbOaZfBD\npt0m3++at9rLcxGrUpPhEyGOwveevU9eO4uw9b0bBAW+41/p3Z+lPK0FcT8b\nkGMiWMUUwknqI9IPp33MOZqMOvXpB3iq6jdiuiOi6SWpjxE6alFz8aqVOnNK\nFKyYUdY8Tfn7b82PykvaoXy/WCHkI8h55rPiMxdZmPwOtgRaCqxvbWdBQAy1\nSa+3RwSdsnqupUyldtmilYfBIhJ9lD+MiQGb35J5Zol3ERMYLMSvRhKmCANs\nHEK+qzg/btvhmjOImD4lRKf4iX4kmQVwJCwA1kebxo+v+fLWV2JwEqxVrfrA\n3/0phmKD4QLV7UswaeG4y/IuQmA+aAi5WI6UGDtSonjTMoCa6VyUGH4Nwz+E\nTJoO8pncIrGTGkQWNHku+qWgVEuT+kp3vJipt6JLWsUx/cCR+yyttfzoVSCl\n8auUiv/iMguVZfEI70Zu0PTjyxXc1YIU0p/CXzDbQWq+uMIJVRQlBZfDSEoh\nugDQAKAxH6BCi2SVnmXYbYIbboRJfKmx2+yzwR8v0QIfIgbWGayH4P7JfRvh\njfeXY64qsecxwlxcWbkNxe8LxpEgmxXQeSgeMY96kJQjg+aaVz2gmk+jrNal\n0V2m\r\n=OIpZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAQr3OU6tmqoV++3cdxZCT3vbF58t1VCGN+uQv2gxdogIhAOxMwAjC9vNvOwxwt1iQtwBnBefwXAcQLWM+cC8NP2lT"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.7928031b_1540234071829_0.6917849345475477"},"_hasShrinkwrap":false},"0.13.0-alpha.12d55318":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.12d55318","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.12d55318","dist":{"shasum":"9c3707a594b3faeb084281e0843d9144d3c830b9","integrity":"sha512-OTFJZs9kdSwNI4od/UYCOGCodyygJDUArm++MXb1WbWRNAugICajDQnmEGalUveyifUV4/YYJy3q23DAzsOIXw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.12d55318.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzi65CRA9TVsSAnZWagAALDQP/3YDX72sVkoW1iEb8h/r\nn2Anl3lbZfeqgmN2vFMTjnqlBHZhW+wErpq/sQ8w6ltj2JT22v9/YDYHermB\nIB1FduvRZm87GyvBNB2vGHg0gB45wGPHXy4pLHXy9Ug47Ey66osbxKPT2KpI\nB3P89332GYUKuQaU7jMjvsDWU/6LDf305ooUO1sodHZOO1PGqI0cdugA9K6n\neWd6sRI6/1ZTfsZovdYsDz6QHnmbxeA0Yb6W/kMeWmPTbQFiq3AhZC9ez0+m\n9ncJsktmz1dFDziI+HTyxtu6jqx9gQFwgD7wxmoHMBB5YZbhdrisIEmVfIdW\nHruMg8jaiSE3w+ueS93GVAoIBaaF0wNsgBk0dnN232CzAjRDOAZEqMw44hkp\nCDoHoR1f7jjQOApIZahPVNC1t7WmiiMHH8o63TkXpiu3U3yqF2b1nIw+SIaV\nxvOcTVEGte6lZ2hQg4n5XYFDxI6EnVBsarR8o5/IdJouIGn59XP+hO1SY8aV\nWAKGsjVqI8L5t+QMf40oTHBVOhoWcjowl4cPvBWuyHFBQsWSW9JqKhsQmMcJ\nRvnoi4u69rrGOMeX+Acm3s2qDFx8ajnbMwNMO9OhlAB7kpLYyU5GYJVG/peG\nK1oLgiuRHXiy2TluSciFnFCvGpvD41rFw02g+vE8eHfValPi/M45C1CdsHxF\nbe9C\r\n=eAgO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCscmXLRyh23bEt7aYVDJC0WlNB2Zqap6grad/AsahIOwIgD5SkHobuAgvzwSErv9GcJV+2hu2AEu5hvc3wEJL3eDE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.12d55318_1540239032246_0.013581986855255135"},"_hasShrinkwrap":false},"0.13.0-alpha.880a7d8b":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.880a7d8b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.880a7d8b","dist":{"shasum":"87a389b2ec56cf90879e08558e4bcf2eab3c7084","integrity":"sha512-OSmkb19/jt2jx1Nb4Aqf/y58i8lYdZfgy3ljcPFsPozOVn4WTDjwuZ62GXudLG9Mt1ScwHluCG840ZiZJ5tF+g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.880a7d8b.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzi/cCRA9TVsSAnZWagAAwAAP/1vbccF2lU5HvH+reLaq\nQhqlUjKmZMtnfzh9di6KPB9IhyUFcYM/2TrJ7mcGF07P/Su/6IG0/NsaLyV3\nrDa68Sf1G3FiI7oICsU6AJD/CrmIoW28X9nABGSelQjbz9Cle/pQaE3Adkq/\ndna4xgZ5sXjrbjPpQTt5TPJzUX6Ph2yqQskj9dlB52bodslqHbsxEhj3tW/P\n7DikAKc/Bk6243FCxYOlB2RUi6LklsBl5o6FGOZwac/9Bozxc98zlYvZnsa4\nAblODJkhwWH3bB2O67GjfTM1EHXoe24U9FiHke++DGLT++2977JvGI8vOYgX\nXPGbqfcYSHyH3FzAGsaGQm2mRameq2BDGeMFoVVr/ILtbIWGvFq+Qn1JvdLf\n9SvxqO3nGMCCanrc+SijWXDtb0NNNjZVcMDlJgu4PnszKyWOw2XaR7Qg+zxi\nHRV3HsDEZ/YUAiqQQPAHoHTnf2QQUWFl5jDut/2xGDGQxKKpG4uj+tacthqX\naaQbisUyJ/QFIBvgHX3//57rimbGU70QtW0lMzuNSeMBlQ+N28fNxfYg4vg9\nbH1N+Ymct14h53M95usAHl0jBTa5kKnJADGWjIaRCJD9QjteoWuULTtnS39M\nvneJIfu91APSHrA7RfkHILeYfEZHrwpmj332jZydnYWhROE+yVA+r8KmTc3E\ntXEn\r\n=uiyX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6u6pRNTn5NLh2NBSYI3paGrGqXJPxIhVoPhCQU2xcsAIhAKhnz2gJgnccHFn2XDzJNocbohHRxcupUTBsQxin/7AF"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.880a7d8b_1540239323624_0.8585070094106002"},"_hasShrinkwrap":false},"0.13.0-alpha.ecb12fd4":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.ecb12fd4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.ecb12fd4","dist":{"shasum":"e7d4be47029e3289d7b306d6b7d5ae508a90c0d3","integrity":"sha512-lcHSy23D1tN65bJvV1odNvbXX2OCZ83s3am0iVVLeVHtRT8e03fYY3oQMXadUdu6+bXI6BY5QDNEZyInLWpYCg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.ecb12fd4.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzjk/CRA9TVsSAnZWagAAG48P/1fdsRLgwE/5M1jKA0wo\ntoKdxbczrBOrY1FeU7CNvDeTtryEYSaDjQ14dB6/jQraPRgjCf79cOFhVK7u\noApJeGSWbt+TVkkg9jBDDbUai0SpUbBYHY8lKWdsf1hCg92+1my08XHcAgzK\nytSa957arnxjoTnBR9su5OmVNKcKtQaJ5UNfkO6ou8hk6f7N96VYC2oAuZ2w\n3ClUKDU+NuC42fKrE842S1/qUMuFNgf3XWzi1lbRgvKxPGVcB4kVepSCGymM\n4hJ0VpF9Mhr2Gcl1ZM6vHk3D8Whaw7+jBjR7DWvci9Tmfamg6XNK3ypolLIx\nKZNoMHPHs+TzqaCZTaDUHnmswq1QdGvamGmgXh2pojIXFk8d8y7FEmhPTGX6\nNr/7nsS/48faoxlSiHHTxOOI2YSg1hc/TU3p7R+AKDk2a4M/m0hmnTcze+II\nwxhcG73e0Dzwz1WwSfmZNIwrrz8LSrDAiwoGKtdQ54L4PEAYQlHtxB8l3eNU\n4qQPBI7z31Gh8hW0WgjSBCXrc0RCHIgWepk5qrlpLHZ+88fRO94GitrADMxP\nCQmV28W5lrUEawkPPH+zF5AshT/bA8OROfdRpY0T6iEhm6eyhGxcw6aQ7hTW\nfBlJVaVNCTxPYs/VDC97EazQp4+fcbF+WeIN4v3NV1t0aCisBsVS6AIN5n2I\neeJN\r\n=Wvyi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDeALl48LvV7WbYZr/6nxdvNaXar05+KwGAquDBegeR4wIgNJWPalh/wZ1jFW4p7H7Xh9a1E2pjYGjaIniHinNipGI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.ecb12fd4_1540241727274_0.4611169156247612"},"_hasShrinkwrap":false},"0.13.0-alpha.a478937c":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.a478937c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.a478937c","dist":{"shasum":"6c489562f95dc29d5cd8a663cc334b1369eb093c","integrity":"sha512-hggTlSWImrz+uSNWzH6Ew3L1Xw6wYlCey/izZf6Q0FAcGJdg8muSXhXIeZMgXiHn1anoyIvU6uYeXX3XpzK48Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.a478937c.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzkYhCRA9TVsSAnZWagAAjeAP/3BLf2Ax3k4qqQtvuCzV\n73s91yVW47uajoTJ3hSTffJWM72K8EU+z5kiJXxjgZYgf4H0gARjkNnKMytH\neVLBhKS5NAf8fuNEyZGBkYc0akd+JmlhgPE1KsQ/+yubm2ozFGEWZzjKiLxe\nEaVLEWg1tZAq8LpTFop0ZP40rrkpuFQidvOQOVn9Kp6LfjgfYJlhIUtq2qMz\nJeCgFlq4F1OKSFC4vWUzyssnz/5dGs0NSSSJd22XHCTB1aXkZQG1OJn2RW7c\nJs89M9uOA6z2HkgweeolaFBj5OTtzL8CRjotCokupb8LI/6pOXjijsUjdBi/\nA3RQcYYcmH74YiHAYNAcxKMbeQjGrJrfDcw6GLykFub1kiZgPtJzoMHkm21h\nWCmhYnCREUBT5oN0fMrQPUtjQN8kc4Aze3hci3VpEljb5vT3gFlSH6i/ASJl\nmHV72mtJ9PZdIvxOvoPfrC8m5LerJn8iKw9VQ9l+2xkIEO6TJnwv1drZSUfw\nCBOyXSaetZZcKZzEsRv4P4Jde7JOzQzuUsXgr7qEk0PtEutmGNxfIga0JG1x\nnxfpj6zGWtd6CkpzPPCabmjKuVA16LsUBo3sF7UAzkENqcQWQC2P8umBSUz+\nSefiOUhvxzStleKbkOdiVZAwBGabVNU7IZMJS99vWQhBfAorH9UrG3KeS7fg\nOc7y\r\n=KOxI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCx0sW5p/BEcSyHcqrByTJTb6UlkOBropSbzVnsbMSU3QIhAP4tg3DEDSrifdqq6tYvJrRgMswH9//8ETHuJMnqbfny"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.a478937c_1540245024578_0.35910736230837204"},"_hasShrinkwrap":false},"0.13.0-alpha.13238437":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.13238437","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.13238437","dist":{"shasum":"ee8b37d54806c2e409fd97d0cd89fc523ff075b6","integrity":"sha512-9OfGx2qxcsXgXp2q6BsjJJu6OkA9Co+hEnVua+s4tbrYKz+uPDFl5OMOzwDXYPH6gksoRVq8kHv90pS+QmNHoQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.13238437.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzkZQCRA9TVsSAnZWagAAlL0P/18SdFNDu+hefs4DU/ND\nF/A4i5H1TnHPT9zwIruEz0vfbwaQMkFqGtGtRN60PdyuBNOKjBQac2tZbYQ1\nBzWHKXQtq2EajMpVJP94HpCzsYPe91nWDSJ7O1Qnegl/U4GBvIR8Ba58Q+nO\nRY8lYq//VdY6qGvmfCsZP+2AJdxPvs/zP3fetGZdvCeHx1MgOBvm9D2gjepr\n3N4aYDiIm0jLODbcf5unNeEfZ1TxFHfGGGXDY+1xZ4RqvToSy8Q/u85rzgQq\nIlCR0wlh7XNe5JO1JkrKH99HcSXtWQZnciEzFIRj0fYlElTCEP1RJTdZNoVM\nlSZVx7EB2J+t5hLt5rTc5HZYdmVXPDI6ObHV3Vdk0EAIltJimTNYYSWaL6tx\nwwJKjj7RIIraSEaLKPcbQAYll7h2cFeKOeDCpLVSDmeCCBArw7dM4MpEWxhD\nXjdEM3S+iUUnStPbnozAL4B+7nSYyI0UjFjixMzdUv4oLu3V2yAkbhGi9Sz7\nq8pr0tpNuxZSE+Bd+UGLT9ZBnjyBaMd3aVEA3qmSz44v+xvrAIrKqVCvkKvx\nrydDNG8UDu9RA4reMgUxNGcOsnBYB5xKlAKQ1P7XehHqluXzAVBcHoUEJFZN\nBPNMTQW4KP1/O2yWRfVdgbYl9h4pA9K0d9CoYmb7HgQ3fv7JS310u0sqLsOa\nvzEj\r\n=wrm+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyTJydWBpakHOqeFUZUKNC/wUGZKV+83/cZSFEOgJeqAIhAN6AF5BXLWoFAWbAdKLDTRtLX3SoZgXQ/EptVfE6BqXH"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.13238437_1540245071364_0.794128360838805"},"_hasShrinkwrap":false},"0.13.0-alpha.fe224229":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.fe224229","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.fe224229","dist":{"shasum":"e9c61e86053d80be56feac0bdcf159f10c813a13","integrity":"sha512-Y0MS60airIY75LFG8wlDZLwMSy8f+5XgaT6/DrgZMi3TaDCiMMw1PDL1vPewidfJ52Cu+Z1/67agUeVUxiiCvw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.fe224229.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzkZzCRA9TVsSAnZWagAA5B0P/09v+yhD3JOdjeHFQ4+D\nlDWvF9zqmgqozzn5AWN1cUIWCJpHAibkZGQNaXlEyeeSoPGMfbMe1I0vuGrR\nU43Zm3C2PHKJDUMXlU38RaeG6dJC2U8W9fc5naKWzgaI7Kg+98U9ABOrXpRJ\nDPVopQ8RvXLn9CByPCFmB1PPFE8qwoNb3hfHR5L3IyWqXSoeDeK5NM+PMczF\nsZXbeD9dV2SpPRR+5FnffeINXDJ42DJWJ1KjXv8H8Qr1E4/RL5SefCyt648M\nb0K0+wQe4dn55h7AKLkU5MFZOPRs2hcgnzm5Tohv7CZnR9zL2SlZ//kZ6CUo\nP/mHCNHHIRsGLChgiX6kWeO2Vre6+7okyGRZSCDuBTZS+SxTqqgof1U5Mp3L\n1qm+nAvYZVjua1sZdhnGTsWPrWba4XTyxqU8AXQR6ev6GBuix7w5e3Bhj9hm\ndBBl7+eqEuA/acDICJqIG5ZNBKU4NKtKXlTAaIxTshimPjj+5ASO4p9Ic7Y1\nPPlZ8XaMegChAGGrFfXl1mc/q2uARts8USYZE+LArn1KIHqTnV8DQuDHjBfC\n96eev/cCOO4TWINXzI0L8Lu4r4slRqwVCMMumGIEqNf0yJQmifHXqg/nC7eY\nCwtrMFdLZvSIVz6pEvY3ttULXkt7bIVILPz8h2C9YHvq/NJ9mua8BJplD0tl\nrgal\r\n=NyK0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDY4GwCtYLries6KP5i3mmQhgr/WQfVWL3uzQU15xDlsgIhALuAQ6x8zY1KJqEI8Ug+7e20PbcDc6vPgfiGKVM6xBWp"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.fe224229_1540245106767_0.9194306201237623"},"_hasShrinkwrap":false},"0.13.0-alpha.15be85ed":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.15be85ed","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.15be85ed","dist":{"shasum":"3141320db4747696558c2c0842dada058f7f1104","integrity":"sha512-db/tzE2Sa1fdUKePBf/RTcySHJbYAFGSY75oHW/bd1+CFXuvzG842HwOSbu/v1Hyp/pcQIyg6v4pe4Cwo0rl9A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.15be85ed.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzyP8CRA9TVsSAnZWagAAxIMP+waLOQlh2i+1sDnwKvph\n52SYCneTnfpuBbJSmAapmH1OgfQvCyLnTsF1fLarCb4qe9c0szhy47a9b80z\nB6c7aIfvPX+94W4Ye3Kpo+x48DEexiJ/0/GN69dV27aWwo7bw4E7EfVjCRn9\nhXcLGlLBgSBCqlcHpW32BSMELBY+NBKX1gN6txpetz0lKLSoQW4x5IpMWdSw\nMk6PVA0fRpSJbAfgzL5oldnqO+tbPz68Z/Kd7dn+inCUFvzXqtIrBqyoka1b\nW5LEtxb2B6f/6LgpmomdNLp/q6G7A0CtRx50icwK3D/lORwZEn+v7vPTcthY\ngvTr1ujwxcb4lKZ2EwYzBNa3SlntCj+uN2wpBZDyraLEpbI1+sARQGMHhyaE\nlgI1hGcjr9fqt+rTeY59CYZL/JASYxGCOc7d5MGF745i6yhOjprgMLRxYNkZ\n+lH93fcH3oNZlMCnD++jqpdIT/kDrGw44JF2MxiNeySwI7B2oJdh2I8Bb7GO\nHVSaC5O0J6V5luBKEDjpHeHfgtQh4LiUu2oZ3O+1wBYw81/nqR1Dk7xHQ2oi\nOCGwIB1Sv9mb/h3fddv2Vjhn/t9nQfqmGMn3HQbRcqqoWPEQAw+wcivcdBIp\ny8FECMMS5vEhlAJWgTZFxZkysxM+kHXvMCcUdSwDQ9oMqIL+KZLhJxPce1QD\n1dYs\r\n=w/BN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWP9iplXg3VC33FvGXJGmgaek0hEpgHcEpaIAptrFOEwIhAJs7v4De4kqh585CcAfu1hrmKxAOeDFH53oRSxPjT1Fx"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.15be85ed_1540301820273_0.17412058762616645"},"_hasShrinkwrap":false},"0.13.0-alpha.dc6c7f04":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.dc6c7f04","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.dc6c7f04","dist":{"shasum":"e7adb7e1fb2ba43a0a201ef88f92808eabcbd529","integrity":"sha512-N5PQyyITZm/zHvi2uTtFi9noqBDMeNqaALD55rTAqxe9lfyg9vl/ATCFuY7pTMPtmoy9/78QM7nqMQGCONC0ug==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.dc6c7f04.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbz1XLCRA9TVsSAnZWagAATV0P/2w4R+NxDYqhxtBc0uS4\n/FZfHC5IY6j/wi69ZqRPzFVMaLbabxPLt1jslkalXvlmyOWGOof/x3hlfQwe\noL/XqyR/yWQ+CFbFWJO2OWJoYH2mkF6l6hyAC9Vuhdfwf8cwIpM8kzS1TTDd\n59l8hYBN1YXiP1Xf1iP3VLWjyj+uwTZObMzaUiSBgU/5Gqt7MzsByE57JpWT\nO0tqSLCuGPuJOwrib1vUSNEY0ePZm8Oj/awvItbJ2651R/7HYUrIy8Aw8iNb\n2+A3q04ApLt0+/erpI3jo5+wfGEhClnnd2Bie8cD90PknC+QDm6CiO6KGpCH\n1ALkHiKjrJQwfeO4Kr6zfVDHrLo7MQj1nKWlaS5G4KqFFn/D5XMVFm5DdH6x\nDMqRe3hTt2CE4ypCNvGDLYmLAk6CHGg12rObPPUhOtByOT3G+QuEp83mHm/z\nLUsYLZrCZpfrex4fb6Zq9JlnF7DUIuJPeb1MrM2+zyXX6q+cUO9DC290UJtH\nzKgpApdzpwrxgnykFYDpdRISmZ6gGMC37G/45dbDquZ3YMY5rVEZzWXv8coy\n4zOQVdFL9Ktq3j8zBGw7/g/9MKVXvwJipweIcRpJNaTBT7612NC17gt3qrME\ngGK0KOsE7HVafQ48aWns1lmuToATcVQArV4Zvqb0nVqQ8V8ObCWzsZIP9mpC\nzW/a\r\n=W2Wt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhvMXu2eBUZGaSMhHdckebKr3+Ar0TSAQWAuqh/OR03gIgOZZY8Y/gAlPnDxigoAUfn1DrnzHLvENE+7i2OS6e3RE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.dc6c7f04_1540314570560_0.23872119691384164"},"_hasShrinkwrap":false},"0.13.0-alpha.2edce5cb":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.2edce5cb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.2edce5cb","dist":{"shasum":"ec71a64c8950e88d9bda2fe66272198920f09ae3","integrity":"sha512-UMhgl7YAL0qtayu3KUCQKHu3KR0xje5ZOTygRDGJ6lBszVXBr0zsekF0K9jDzUc2o6uhSqw5u5Z+WoYItfuCPw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.2edce5cb.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbz2/yCRA9TVsSAnZWagAAbqsP/iR9U2ZzzBuhm0YrWtnW\n+m1mmeOxCptSVD69WlSk/jAIghNSUStcZja3gtXdhbxVSDCYFwHfK8dOgB+G\nSMf1CxTUUsBWkvT0MNj2ONAVCQkCk4pTE6NgtPZ4ulBT67e0XZj11apvhFiA\nhwqKp3B4FAllN9txzyOTTQm9SR74UTFU6iXBPEV6ic9OdEKrBMH6fEvYiYPe\nluUuNyi0xC5legkQL063H/Z874+9JDhKY1NjeG/75fLB/nDrsxpSfJnqcOmc\n2BCj5B9WgZtEDAyx+9rNfGWWOp2onVJgH1UxsmQf27cTQgtQ6MV2ldXwHdRC\nd9IEE4KJ+Hsu1Z5ZIamRmtlVEtg5ZpbUFLwLk/ad+uTit20nymLw9COlR2wK\nh64yVCu1boMJoj+EFbGJLuEsjmMcsP3gOo3pawI62wbsEAedwocbFqGA5Qbk\nfJqM38cqPUXuOrTReP90LwHnfAekn8NWH+OiCb/w9dVsUAsuWj/x01qvdgDM\ny38+14GW2nhOWrjTiz8pi6rg8IoIxU05UpOFB5/S2EQ9nv0tC3tMDVaoDTxU\nGCOlmuHLfdoJnxyJmYgv67+lEdqhnHPxyrgtrTXuzCQryw1tTurvo0yzazbO\nX+OXWq8sxFvEP2MEcSCa3d9M4/WxMIenfTLBMPM3gmaf3H3UkopMAZ5V74QR\nuEuE\r\n=f4s8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+IjMi/2tb9VfRLIX2PvninyB34QAHfdmSnBZSYdL8lgIgRylAjS/li/3zmX0lUpuiqUWlQF97i4Er0d/q63dTcIc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.2edce5cb_1540321266108_0.1520061144657796"},"_hasShrinkwrap":false},"0.13.0-alpha.658244db":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.658244db","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.658244db","dist":{"shasum":"447bbb4fd02ee3e0bbce89f2874c8903778f28b2","integrity":"sha512-Fn4lD7vwnNEdmnpYIa1E+YjPz4QflQ7051Qxh+fot8du8n/26883Ab3sIx15evtl9Cq1GfY9TKZMKLCq3uo+QQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.658244db.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0DG7CRA9TVsSAnZWagAAhyMQAJMrvFntOzsuM8ReQLIy\nY4bivxqLcbkNcal7+oIzZBjnddbdF1CX8dwJatQo1fSKb6KGbVldLPiDIyVZ\ne3P8OR6jzHj18oZvBd6HNt5sQ5OAsUx3RwbdYzr0B86om8rEk1V1Pkt8WwyB\nHdE6BIdzQXSjjU3vevkXgIzOqJUCIGDplPDri5lWNdWsTkHhnl0EON3+fZu/\nv14Oc++2stLSa1xcE7C4O6g7oL6d15sj4QSixD4zPERRfH/zmCfhnrx1GsTR\n6+TeQEE+tW8xxQr5fnzPs+BLmxNmVmXiVTeL8O0fRoOL5+6PQ68gv3YanZrW\nLvSJOoZ8wqxxN478YRFfVXS6tbD7MpWdBtstuKQq18iu1o4iHi2l6QLQFwg6\nmNURezlo0hZ8FPMMtr7/RB6/BM2C6I9BPCgDlzWlZ52YaLopqfCXuJx8xNrT\n5EX6a5JI7j+GNV0SDqqdiuIELisRjm0V4NZ8DnhXCoS9QgKUQ4qOhSvHa6RK\nMp0o8R6zj8rCrg6HyJDHK/pbfXCGIUA8SFrkTacILyhySQ1LOBbHNjbTVE0u\ndtlgvRt28bBnQBn6uSg4MwRpkWXUqMOgPq4nUWtrj8SwS1zVP8z1JkOZcWOY\nIs8wWorSt1rc3AHZADDUTycPKjnl5o2NuVvqBnPqOhIo31HcgXWQWxiZL71G\n5Hrr\r\n=oXuH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGVo0JQ+oqUbrvSpjlqHEaIb6u1jLtzaObO7RByoDHj2AiAFINFP2+NyAIUZjFPTOwCaizAx2rdatR5Lu91DciX4qw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.658244db_1540370874516_0.6399144427826773"},"_hasShrinkwrap":false},"0.13.0-alpha.26308f26":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.26308f26","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.26308f26","dist":{"shasum":"07bcd1205aca11c900285ac9eee01f37f6848b64","integrity":"sha512-DbgiS/KhgBmqtcG46w422H9vU29mQeJRHl+uHeHt4nn3yMhROmnbi3j3phezjfo+QIheHWdwbTU3jv7ibY6xvQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.26308f26.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0DIHCRA9TVsSAnZWagAAx90P/Rqui2jCje8actKbnpoE\nMNrTSfrxLZj9s+nnMGnD8jtlOYS7CGqUaqLX1P31W+59XEBAF2s2BjBFQpeg\nBeEhHeSHyJgvC8cilM06slgTHQYvN1M+5Lq5ROCIIT2MQz7NcJZLr4G445O+\nz/Hz/YMCZgGc2i2DoMM0Dl34K+u3IpeCsWV2yPBus+1I4NcdySNERxhhqCTp\nKrbx4t78x5mNAMuRq9r2dQ6EknRPkK+VgYu1rwBfS73HHjcgj6KvEsTVHRz/\nX86p/EgQsZ2UHaitGnkSarA/2NxAn05jOXivLCzmXDaIiw1mkVEj7ZLm5wmW\ncCkUzbR477DVVMzC53PLNJguifKTMIesDgBPppzxvjLqNfC0+VJlPiwN7bBH\nVQh7toKJ116HH4D0tFDpey6NZEBWgHUHy4WN+IoUH3CJwiiNibiPwn5ee+ja\niHpRkv5LJ/mO6zSDVdb3IZLRxxV6DmOYubnRJibz0lRlAonL8Wy2nb8z5kWM\ngInmY5Xe7sn0r7nyH9w05u3p03BS95eHc4DzGAX0P80eDsgSOZLNhZNO07E5\nybjIaVqDRwND90t4vgYcmomJLzK0v4WvsGTnOOIYWLr44L4y7hfbZOsLiGYS\nmjmHJdyOmj/t5j2u9/Q+7KJVkEIaH8+/ASeDRNoyi03Txq2F/cRNROXlEYDh\nEvsS\r\n=gMeT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF/q31IYXLSBFYlfIp2Ik/YpbRZYPn5m3qRA4ir/gWAzAiBRBUjhb3R1m5iyOctVKvPs6kQSqEBkCuJ6DeudVcGWuw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.26308f26_1540370942869_0.625192322900118"},"_hasShrinkwrap":false},"0.13.0-alpha.4920d0fc":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.4920d0fc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.4920d0fc","dist":{"shasum":"93eb2286502cb8eac73ef5b0384bd6bafb026c91","integrity":"sha512-sYwe9WAZ5h+u9EJN6sS2+VmNPSTof5WHYYkzWQDR1g8PLiq/FxM4XPX0ER408FzxtCPUbLjO/BTdVRE+cyuDpg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.4920d0fc.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0DLECRA9TVsSAnZWagAAorwQAKGk4g8aLxx+u3c9AZg8\nAH63PDLHslVog1e4Egi76zekIf3/yhJZVFO6idGuccQH71EBN2Gdd7nAgW/R\nVBVPZjwRf44PIyLX8jYcwJGoGnXkEMDchW/RVjqdkcrKJyHzJbFpYfBNXjlj\nWtn61DGDJ1YB86B/8zLH/BEpEfVKdYGQhTs8opxNZ5KEdnM4ft1Lp+eUN9Xm\nP7W2yNMv5KbC/mJDsfZnFNbckcVYKGm5IDVX21bc2vIUktoefmmvHvOgTnm5\nVDtgxK+VwBNosl2BrvKvbjziYd4VcAtBD3hVGZpOpfJd/ytpgUphrKlXXkD5\n9iqxbDtSjuN0ANcZ2sFkEn6mgvDJGAxDJMLQry01hNvdtb83jwsD+QovCgtU\n//481Prv34j4NKQO2AH+fQ6pvy+mUrRD8lF06GkKuCqZ3a6NSWIxYpxmZrAa\np6k9vtZs72ZZwQ7BJGsyxqkeOXdkflhgjepTgW6LWGJfnp4As1mzc/IVnD85\nnu+zAGCNJB81wCmkbIt4LHrxYHTwQPvicdhc4tH1BvDwOaohuM57t0v6LGVF\n4C8QgWuLuJKjknjoQLzEKyFCjfX8cgRY0tyH7Sz4e47CI0oqH5N5x8cJTduY\noPo2RArRiJg5iuTSyGVUQONLL1VTFC01eelAbbfWiQ1aaQo5Mxu5GZp5pAiU\nptkm\r\n=6Fvt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDJF//zE05YuFzcJuW5mtvd1y2WlpwWVAJy1mSjE9OVKAiAvAvi7Bvx8zGsMhwQQuKxTtWIpQ1PAxXPgGkaZv8HwjQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.4920d0fc_1540371140178_0.8947417870960068"},"_hasShrinkwrap":false},"0.13.0-alpha.7077c93b":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.7077c93b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.7077c93b","dist":{"shasum":"93cb94dff10e7ed0662015e60ad5e4e3d6240961","integrity":"sha512-qi1WjovIiUs1T9YBvw8VBZLLYiZbD/QtsJ8ZcBOEiAvUBq6AlwT3wOu0cANk4OUdJQMMkDUTB9rGIKJpHvZemg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.7077c93b.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0Di1CRA9TVsSAnZWagAAENUQAJK3F1O+4QOS252Ca5SQ\nP19n+TyhauxTWPh+uwbNWfLg8g+lv8Ba/mrqw4vpk2CIzXmH2aCadSIN2ePl\nlfvxgZSu8ZEfCNKAzSDrlkwwCRBOUDJhv/GmSff2aaiG2J/UGolSCJoKuUrN\n5PWn10OOEzfK2s5adDvbQZZcvv+8Jnarp7CZYS5CDUCgMciKcBjslTlwUXiE\n72gj1xB8S5LfWzrdJpRcxIVvHuI1QOXNnJYOf2P8ohfSmXVs6RzhR9kpA05I\ncglrQdUAfrwzvr7UJGo/1jNVYlv9qCEFQFq52n+TB2QiggKlnXrcsl1anRiM\nJ9epgs5zmUqdxKUHcMoOiNeZ919D5VsIuFQ+a4v7zwRUfyUZ37+QLsGZ/2U0\nP5zS2e8J7GLt8BihENz3qsj298wvT7a6NK4STSjKtjiZxzYjndsxObn8gTsG\nnN5vRkM9oB0NvRwMTwvimmYZhRR5UU71MqUBnYWAOrgSJK8puQlEGcECq1rz\nW8pvqlIbLeZKM7smjIPYdFn94JvPWH+M5ezKyyMGhv4sebI5nj6dPREBAx9N\nMH9yN8/vwhvQIa9fjRWAlan1h+Q4dcjSOf31mB3TpYtHA5Dam71l+mAFgu9q\nO8luhlEkepDqF5L4A7HsKigTJGIyNyzFVc1mswd1Wrf39HQel/UH9W3F3kP3\nbDpp\r\n=84c8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfklzFfDgzUibqg2hi1wkyFaaoqDrKzQLB0lP8TbGkOgIgEg2zS0whUx0OBLUeSXKOG2uUj6jSUbl1jJepwwI47Gs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.7077c93b_1540372661470_0.13275165867081884"},"_hasShrinkwrap":false},"0.13.0-alpha.c9f9ab19":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.c9f9ab19","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.c9f9ab19","dist":{"shasum":"e789c35bc65b7515604dc31b45eb27990add2782","integrity":"sha512-3nU6KfXUTROpkyGcO3zWTAQv+k2asOq9RcrFiYw/2nKCmWPP2AcHd01Y2QmFpEoS0JYUfKtUFoeNO5HIt9+eBA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.c9f9ab19.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0DkzCRA9TVsSAnZWagAApfYQAJ0Ha/DY+vqnulImA/QQ\n4JkeS5cUnBFQ23/vyJJVduNfkten5WNHnL+QdsiWlSjhAjVAYlv16aYRVAyy\n8UBdZz28aWk2gU1RNoZUAzerZP4mzTuJQrK/kCxvrZFySYtUUs3yd/Vv8BVl\nOaCOJQ43KikVmMji1SMfE9kEzgB3uwxeZyEwsdPgj/wB5LomLvHQHxvMS/Hg\nz7l8WZD3fKhfSgghVmsoZW1+UiPV5swgNhqGYwI477Mlkn68Xj+OMOE8B48P\nSGTsTmk4xl+6eSID7shmvYkIG5SJ3HUjlT97nZcTtw9mdXtRXDTF/9sciXKu\nYZ4cDxujdF0MT3P2OJfjX2xkDqeutH8KPjnf3Tj60+T1+5IEgpglL4mbu50Z\n8Hf8JCtWkO/Ir4syUTByUptf8d92cq8nTQ2/QaJHuvo9aH/+lrI1i66lUJFv\naudap7jl8aTV9AqaswRgv0tZ5YADMGpOeIUbVGi6exPZD5iXt9mc2W+UW8Xx\n5IMt8+VsDlmcl0fUMHI983oYZSH3v5/dC6pMj+1Agf+8+k85JEFuXdj5/xg2\nf4Yxs/QcIpV/LzhHVSYwLeaeQ9eRGQgNv4Evrp3e+U7IzhGg0rZ2M7JgAur8\nov7DO/l1gmqU1xNHH5Jcmi34laByGron7RjRv9Hyn//amRx5+gqMGZ3CATel\npIET\r\n=rGpC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtl9/q3DUQfD8JFZ1ud4bvP3uKE3gTKedzN77fQrtnPQIhAKZ0TxeIfZQo3TF6LyRlwXzX5nkumxmFb2nwXlna83+i"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.c9f9ab19_1540372786347_0.6078327994897383"},"_hasShrinkwrap":false},"0.13.0-alpha.6f5ee178":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.6f5ee178","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.1.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.6f5ee178","dist":{"shasum":"29d79173531fe555420a527b4527b148dd5a6887","integrity":"sha512-h55dJO8tgLe1tLtg9Gr6qbzbkqazqPgra1f9Fh7FNP2Vbd0jvB9lBbzWnEs3HNpBt1L++3MYtbdFcu1K/WXcbw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.6f5ee178.tgz","fileCount":22,"unpackedSize":17841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0DuACRA9TVsSAnZWagAAe3QP/RmyHDccMFagEg/wwg6K\nJn4St/ufS4I472NsElLBSIaY0DRUrT4csfd6eIoih1Bugo3pMcKRGMKn8QLZ\nOFHxVx8/lanMa2YdvEwIDWQHjz2zGMhDrnfkFcaUUYYjec9v2NNa+eL+KUb/\n5uL1+7SEJVO2W1jJkePwJl00wqXNf4lWTPhp77ULmP8lKLWg9g/5HDCFZMYb\nlOSJxuNIOu6mfvibUcdGuzZVGpFynyKGXU9Hy7/kZNTft/jaT5sZtXV2PZ1l\n7Mmp/nMFaOJ/5duPrQfoVuTy/CtOgbsF4/u83afv3FJD72Jro7BXG54WXcXp\nru37qyJIxIBwMiaizaYkOSWWGUmDQFm62lAc7KYDx16UlRaM2H4feWOcgTPx\ng/cSGl2UxX0YSPOHOfb0/UDFmB3TLPBg3UtV5JCewFcXiG8ld/xq2HcPGWaO\nUc0stWnoKus1yiPBMFdFFzuOQHK2xhBKWuvxT7frcXMKq1O7FyApdguFLg5f\nB3vCNmQlecy7kMHV9+wO2nVmjixWHr9TvNdEPqcPQVbiIlfOIdUqv5haHldz\nUU5YkLHB6N+OMHR/Cb0iRGThESv3Gfvk6nrGB/4s4FWfv3k4rFU+8Eb4EoKi\nrCguXFI7yAhi53B3Nfor05sQicHA3YKea9YJF5SA+6qVU5YDdz0lz3HY9wyq\nkVxF\r\n=bEkU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDG/lgsv7wmrEMy7p25gqQUvlR2i4VepxHmmBwY0NMq4AIhAKUGqEHQYFYCK6dh/dNaxYLnLGqMYieBBwZT+gqeH0ME"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.6f5ee178_1540373375243_0.08865968432408033"},"_hasShrinkwrap":false},"0.13.0-alpha.4b7fa3c0":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.4b7fa3c0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.4b7fa3c0","dist":{"shasum":"305ae588d04ea721194630eeb2e321ee5fa11ca2","integrity":"sha512-BkOjhjfja7gcHAe64UbBZvoW7x5GcFQtuawHSaDd+xCxG50q9eWOcKnChesNLWGMfySCsUUOapQ11IueJqEqlg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.4b7fa3c0.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0FKpCRA9TVsSAnZWagAAxS8QAI649EV5cy6CVCNm42VW\nDqr5e+nNVuA755YYE1dLj+JFnqLkPJG5LMp2S/LYWcRnBD/z3yDFpLiGSWdA\npoqVuS4EGe9tZI35ttRgYdW5zbP8bOaGpTmYXZ+4fojwIjFzNq5qDz3NAwk1\nBOexHkghgnJokGp0EM5af1OGDMxyO5w/ss2CmqCnqqjd8o+5OrvroNcE185T\nWd0dEnf/7UfawWl/jG38goerHW5T5EgJ9zg64kCYA1NNeoR/o7lqEhFPAyc5\nmeTjGOa0opkPVx+OPWydRCBYOZqthbX8fK4gFzaw7eww9RmWMhDO7fwkScLl\nZT9A1QjOsG9qIJz08BSoPgrwE2n38FasVtTH6f+E64kbmSV26tkciznuy8K1\nUvIumZZtKnwCkThjYt93ICejx8xzYalfF4m9hRa2R5CnFVycK/S2si9GGqqd\nBj3YTLTsOV/lIoIoZLcsda+AekccTem1FLxWcIuW5ich1ov//Q6I/ugCpnoK\nwHCJW8ny7A2IDS7V1A5o5EjxJDXmu9eiWWHLrYys58A4emN77pNKPP/EgVOG\nAnxvmsY+9SwAfVk1WSW1QYgkXFsonnAdGlJFaeV+7/ga49Uh3EE9a47MqDwt\nH2j6rNUeEBDT1a1jZoqZrtsEv+kUnkrinzXm9mkmBt32kuPxrBR6pUDCeCUF\nQ062\r\n=hMfN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3FPIBQrrLhWnsjaYyztsVlyHg9DlbS82GjvL4YBOxTwIgR4UC3YPNqeKnlXaSKOnu1oKJL/a5GGBb6hLbA44aWN4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.4b7fa3c0_1540379305163_0.9884542338104103"},"_hasShrinkwrap":false},"0.13.0-alpha.25f355ca":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.25f355ca","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.25f355ca","dist":{"shasum":"86c96850b6f9299ffc26ba1427d924f4d8b4b988","integrity":"sha512-Zrxyfc2iBvzQ9GO6gO19lnIHE7yl33wAnE5q16l/Ggqc1v3tcM/J3uia4TkVoOJ53QnqZpLhAGLGZ0QYe6D8lA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.25f355ca.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0FMxCRA9TVsSAnZWagAAtdsP/A6Fk4xAida4ztQZaKqw\nRMQsXy6Int0Olu3BQ+DARwp0wDaI8OkoNGJ000yzQI7jwNqSpi1YBW0Q+0ot\nyN/Rh3U6TipY5I9lqDCw5PFQnZwUSdZmiqZAeX7To/c3I2uLRH9SkIwfgMso\nhkacOqjDs1gkmmLkusdfApHJY5DkXVHqeyjDZU36laVkQTvoOhX3mZ1Q78J7\nbt9rUp+Rz0O2CJoy6vZsZhQpp1+h+OJ9TsMgbrHcaNpOmsQIxPjoCPZzaaxj\ng6qXM4zpEHJzo3gKvXDkXKK+ZtDlkXZZbm1cIQ0+q22L4KR1RF70JEmbh/tl\n3kFhOqwcKaaRZEZTLa+ynmVkcpTha53V4XaqIlXaFwTS0N4rP3spylK8jAbZ\ngqFYhqjsfHGgZNhMxZwSGXrUwrQER9F3Du+ZfBXYPrwad7dieMeK9LymC+FH\nIIMO9L6B0YOGUX7p7imwhj94x8PV7gdHHk8lqi/vdT2E/YVq/XGJB/uO+/zs\nIO/V9rcGQ1iA35x+mHasspz+Ze1Y0waUaVtJDW38It+uOGBCThUUwRNeQo6C\nklh6wTSp94CPlQLfq8SBKYPpxeC87RAMMG5O6rJ5XdkgK1dhnPsExn/6+SvF\nPpYFAi6rHZVgGM3U1+xEQqOFZTy2QFc24gYZrabitTk4bE8KgqZd8OYrM2Sj\nmAe9\r\n=zafG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiABUbpGQ1zQlEWGiCzi+VnGAEEhyC6zUQIElOZCNQ/AIhAOGI7QYdYqSQR+g9AMaEPpuDmkgV7apjmwHDWHDifMRI"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.25f355ca_1540379440829_0.4490238792501511"},"_hasShrinkwrap":false},"0.13.0-alpha.34d7ada0":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.34d7ada0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.34d7ada0","dist":{"shasum":"6895699be1e68690209297da3797a362fa8d54d9","integrity":"sha512-MJLU5J8E7gBRxLcIZ59v/lsCn5S64BUQkdszgYA2IM1K5vj4WcpEHBXcxxYlyzV82C4WmdaTgYWRxeLLkuzMbQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.34d7ada0.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0JZFCRA9TVsSAnZWagAAuUkQAI/Y5u7hMioqtCV18smf\n0ueGLR5uweXX8nOrE6KTA08o6nztFpfIedJA4G13yGVn/UXj7yjP65mQ+fqz\nix6OqmwBirTNNZfEJq+SQ1JzzM2pXTF/zd7FLFFyJHbdTZyrCUKKb7feFrU4\nEHXT5qwoDnQ7YUuOXQOsVjAiZ7qcOGMzNwimDUCLj0eFIM5AynMRhD8w7qxT\nycHd/loYx5/D/Yb+KebnvRkBk2qP6//3uiz4eRcgIQv0PvQ2EKfVlHrLNP5I\n8UBgJyurAJO1PLLIAE+zqN+7x9mLc0pXJytszykyfWLIXtYzyRZGcPtuyiC4\n1B0sH2QUfahW/7lnxUMWMMufyEfORi6H/e8GT2CDT48jfb92fynvcMXSXEC0\n76abFl5+Py0UidMPpvd3dRP9hRSK4ykyG6jYOGL2QvGqL4PCtB/hezHC2EyC\nCaAVq2PfX2npBS/9nmRCgNTk8a2KJalFNe3TKtxyBr5mcl2hyho+Fgnqfxk5\nnQJTi1UsdL1xYBnewHY78uTxHK2IZ8yHBs0FhP67p7jWqsYhyGBVYiM9cu5x\nFiqZKzQPyCzPwUDP9jz0FFgUIAhKL56LtjVnaDj01YKOXZy37m2Eazy86oft\nAz2lfqLLppw8CuFMzaAwyVzhKC4jrUOJzFBElUxGSsmsoQCsYjHSNdGV0Obt\nWx3d\r\n=D5z9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRZmhNPt50QIn6q56TXXltCgnSKgNay/tCRD2PMWwZDAIhAK86OOL5J/9fTPbVnZgJo5vvIuwF4Yc5F+ywdpKuKGCV"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.34d7ada0_1540396613142_0.9797049840293175"},"_hasShrinkwrap":false},"0.13.0-alpha.fa3dd811":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.fa3dd811","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.22.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.fa3dd811","dist":{"shasum":"7ae29111c2d843482324070c4df36aabafaa0d2c","integrity":"sha512-7VuRW45sBLhR9GfdlRUcJtym/8w4jtD1qjUSPESToyr/78r9AXxLdKNwG3fCDA/OAA6rtLyD5B1avhFctm3M0w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.fa3dd811.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0JbHCRA9TVsSAnZWagAA12gP/ireNrFFSryXdBbaKkaF\nq9P8iba3NJY0laYxsYDdQ01ecIDELBotWBF1uXYx7fH3CcgFsnzJtEALmDmu\n7XgFNcQQ7Vxgjjh4mKJolHH1eXWMLCT7qijWIa+tGi9lZq7a4wP03k4M5p4B\nYR09k8k6s5IdPON11G5uqEiim76x4PRNisQ8UgNejoFVncFFWX6/9EbtGIh1\nUCjhgyegTvgY0m4jczo/guCV0EetBoXgHJfFdMTs14UfTJKQ6V+02VhAJLIe\nVDR97+BVwRCiciH3sZPEnQtVIsvZL5SOTXpGz5ktU+8FSn/xB0+QAZPCm2fq\nSiCzqGQwEtLjuHAszfHD/1v7l3dzX8ywPsjnMcYCrSC74k/i3L/YvTS35Ysf\nIx0F5Lm4CnkxxX0ylUanYtncJdM+rdkWCvYRjd/8adknXqd9MF0Me92uV6zu\ntW4k6ZIPmPnXOX7E0qGkIGBgxL887NQ3Rd2yb2oMBcrD4xQv0Gx4G7J8q0tg\nMwLUacCAU0x7qpM9GtemvzVY/zQAhS8iVqkCcgx66za0c8IZcSAwLdFwCenU\ny/ZqISj8iqIUktcWtFELDyg5eoXqMLdn6+VcCkZN0wJPsxoRTzIGC29jufB2\nGtPAWez/RfjAG3LeidSQi/ntSetJQ9Ke5Gs4Tao+weZIY/FoGMaEOlLt/yZD\nH9UG\r\n=THKZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB1xRzW9jyy2qaImP4h8qmb93h5ekty/VUDQdk9allFpAiEAsebNmCLuDUIEiqfa8KLT1wQ2ziEFWzN0sa5cbDY5UGE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.fa3dd811_1540396743045_0.916362659965843"},"_hasShrinkwrap":false},"0.13.0-alpha.4d092902":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.4d092902","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.4d092902","dist":{"shasum":"b145db6824fe4d8018592c428e51f3789a8963d3","integrity":"sha512-yVyaxthr6vaxWNMORXNl6rseh/CGmU+UMzxW+itAhVgvs5FiNF8/d33AcWPRNNIfVSehY0LTJ3GUN6J3BktYnA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.4d092902.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0KISCRA9TVsSAnZWagAAC48P/2QldDiVLoI++rjzdBSj\nvSNBB5dd9o8bmbdkn9w3PU5zujj2KYKa2/Q51ejn6MZMVUKtp0oCg2Pxzii9\nqDpm9f6PDM9txq3a5/thT9TkkXzd40Bxkfq6FHwdoAbAy2ILjoGnkcrgUr3/\n163X0QbtdqjQOYZc2czirRjseFvxb/OKoBNB/pc0WT+CxIxNOQMuAoMJHxes\n1QCcCYI6822wt/xjEmCNIVP7EiKaM/eotpkyFcpy/GN1hscMznaCRbaAZhAK\nMML1ZD/aTt4/Aed+mc7A6AwxQiWnQG2VKnvY9CZtxnwXMcRJdydC5YDBLDEB\nE75LtVP/z/n/fSRaI3uhtaw99ZMBqjA4coVB3HzuzhBjdPAU9I3b9+naEpsg\ng9K8IEHJq8ywRvXh6D942iudiJUwr2k79MaaoBDDXOPz0kVgJHkT0gKVJ6/2\nKLVkGGYor8wDvTeX1D61tTp+yasX4cXYnxgrotsVqEkCeYAiwSHxAYDXKrSa\n8zY4k4yOEYOgs9uO+mE3T05InCjg5Y3+ArS6MzbNU01kBQnAxIzpVBAQ5Hci\nmaG7jFwgnvC7TAU0m1/7RxZzpq0XHd5ilaRrMcjJ67Gbh2wE8jiGFwrWbyuK\nuB7ODamB8a6+XOQ/z34GynJhbmT2qv+Jkuk8kcQPgBMXXMjQ/ai6/8JI0nKn\nqqvF\r\n=fYpo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAiSRzrHPqHCOgOxt6ZMIsfHVOL4DB23e5wYLNvXIKXQIhAPRDJDwiml0YBXUUrZxdNcy2rh0IDG/y3nKoboi1g/Qm"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.4d092902_1540399633775_0.33948554347128"},"_hasShrinkwrap":false},"0.13.0-alpha.30c6f3e8":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.30c6f3e8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.30c6f3e8","dist":{"shasum":"9fca74d0d942781a1237602287b234f7a750c5a4","integrity":"sha512-tg65KLwpJ1JJVYY7hk8EdcHcDlG8geQvAKwsziP7k0MNCTo0QCY8FNCV6qqx7bb1/fA6/lPPhT8kdt+PtXGWsg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.30c6f3e8.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0NJUCRA9TVsSAnZWagAAFWYP/0UExrsgnqYYyRCyIjF9\noDN4cYkvemg9F6OdzuK7FYh4sFHJFaz6RVntkl6U4XiBJ1+GsJkEBLnapeuc\n3LwjdvG4ncrxfzZEkErvZDMfLCs/uDwePeLpck2Uo754rHTnwQ22zFniCy2P\nj9rMFAbv/K8PL+QPh+p+oGXDreGNApxvV4Gl7ICfgf1kc8bgSoa7QMhUQCoF\nRKWmA40DrxRzCi1eDmU8rMxwYYzqssHU6sGowIzPMR8R/nBInvS+b/BJ6R7n\nhd2f/hyTw9DjEcsy5bdDKUPXX1fa05InQIsq7JFmVTKXuEtxrbi5Inmug+ry\n2Kk7GlSQYdGdyuxcyKhsafoE3lz7UPSa8QAaJaEMsANYXE9fNaK1xNnAHZps\nZbsRoWR/m2ngcgCX3YbVx3LZl47IPtbnbS0O3S6FXW7hTspoIFtK416j3nSm\n91jOgI+O0h3DAc1wLIvNXMH4l93Tj5WnHqSgo0fUbX/JVqXV4kh6nALwHCUz\nYyMI66BPL7uLxYuVkSi+GOPI6IYf/lhoBMFStBCBm58zCao6JybOZ9oTO+zi\nTcRoF42isd83Atu63AuFH51GepC8cAITZi8wjTNmHS/t7YG9yY7bZdY4DTwj\npPMNsC3IpQHvEcrC8oKzL7PTsujfsra3sBtzN+/gE8b3eIDU7RbBoPC4wF8J\nfz4k\r\n=aWg8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICLTU6jLstu33dToK0zGimO9/cM+H9o6K8dlAbP8h7pVAiEA/T3ldWnw2xiwNvRmzBqw8RqRVCz3v5Ty861ajVv3na8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.30c6f3e8_1540411987799_0.11001918041112768"},"_hasShrinkwrap":false},"0.13.0-alpha.6f0b9893":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.6f0b9893","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.6f0b9893","dist":{"shasum":"8317d073daca6c6e709708927493479a199bf4cd","integrity":"sha512-l7t3xwPIqL5/LN89KYOWcEDy+bRE3vOBKUHlPeRkATbX38VmlHPFV/TlIXN9wlu7W4Y8CEgujkG3wBJK4Gozsg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.6f0b9893.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0NJcCRA9TVsSAnZWagAANycP/2BmtVQAS0c5MVMyC1R6\nU4jE453iBgNnCIdLLXFLyc7ZUI/heez7SU58eGDq6txW8z1mMdlMQXMBrZJF\nfe4lZGgeN07P8YNIV0/TCSmmeQ0vME1eUO+HEYhCyB/+7IyRLzoEOUMi3kZ5\n+FGue1za5O5cKEzP9LOh9bnjR1p9z1dxjcXefI+1+KvbUYs+ymGbAtek0TgV\npgRKVwehJ71yjAvaqpT5AdyuG2BSIkg54iphzbeZOV+4FmRIw9ql9yUxuXxh\na6wt3PNhrNuE/DazjoE/dyo6WRSaRxiecqVaXll8RS6gLIFQdjNRABYSQsEL\nEjRLn0/LLbG06hpnH+T+FnKMs3LiouJymFvhxRJ76L4xoRjMm0vM1NqDFNHi\nEH9Dcpfh/T/PhUbmXy37qTJwqVfuZngl+4m4nYQSl5ZOcgNqWaAg7aEJPjI0\nRooE7jI73RpGEQ6EqJyI+elX88gF9ZGMdq6P678d098VIPtxvwXRb3KQVZPD\nOvZc+/R8TyTw1sqFYaM6i1pTg7tVj6BihksWc/0GVu1P1mCY9rNhEQa5lhx2\nB+WUn0aolh7XkAUeOglO9Y23R9jRBU4H8rY1UNW1pD/7rCRqVMlu6rdL2DwR\nAg6TSOnP8mi32pfQOj1AUjUF6EOxTdSm6IVZCdLVKIY3B+T0I0qb0V7aW+pY\nQ10k\r\n=21i6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCArTdlly1uhQacpvW2P41nTLpgaSiTrVIzcTWajXHJyAIhAN2AAdSn/u2KgA8jUpET8tIf5pwVlg2U/cGMTXf9XXx6"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.6f0b9893_1540411995902_0.8021971106374051"},"_hasShrinkwrap":false},"0.13.0-alpha.c37d6ad9":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.c37d6ad9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.c37d6ad9","dist":{"shasum":"12dff4ff2f6a9ef453a4ae728601a7891d343efc","integrity":"sha512-Ec2JLnpVYJj5Xy+/j000dfbo/PjOLGy8POExFP2dPJAgAGXT05cEnbTEOWQNTQJyMIhfFeRWVvsoRS4dCgkoKQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.c37d6ad9.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0Yn6CRA9TVsSAnZWagAAHUgP/2mBUpsBfL4xpTZD0Wim\nQqfPcxKr2zMMr1pReLDVxtJkeBA3/mdxgjUUnHU1hFmz1XX0znIssMsa5zEY\ntQOMSwgwl2a+VcGsOBe4XcIJoVgDNH29B6BLOEHIv0Fs2ikjZ/UrT4WDk+Xy\nDLPexk6CDsc8/MWVtaZwHlp4VuoMrG2X+6Pu0DyPl7jOcKFbMJown4otA6wt\n80Ny6a2duiFiv7m6tEroL5jUujP6gytSkEizWcu0mh9QNf74E/zYCCVpn/eM\no6GtK5tjK/JsTLKTf8DUavSur/uO4xknFeRecjinVhksAHQz4LiI8RQ6MKHV\nK/tlnDiV1vZVmsq0YSxnCrpoksmWIvIgnZ4n4WIwJgVgnnywIzUrKphjeiDo\nsPgWFIf4e4Zl+F3PjhUXwalBfY5jAPap81tr2t03A+K1kYgSth3Iqray2ZAC\nVwTsDhoJO3FFzTMU7iebfak9MGbb7AvpGF5OtR3o763W8pLa4c4CoO84xGj0\n3uUfmme1I3eGDZ9cDF7gssr/gOSsZgeiUefmzgpYFCZHRgDrBd8p9yzIvQ5G\nkcWFLQUFWV4+vp/IWUVQK34s3M6RwYA15nfhkIuMv9w256V/QghpRMSQy1BM\nd/YDUXal4DY84rUpUMlM7ebQaL6/Dfqcfvp0dzdJGNuP8aaSst6xGlQHDx2Z\ny4K2\r\n=AvnS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwbYe18u7u/2TLubMlP5P+lj3Q4tdVEgnK4PRGSgCE2AIgGDDZtBIv1VCR+BiXnKUHlWC++P0VA49fyiTspVsATjw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.c37d6ad9_1540459001878_0.7600460528738875"},"_hasShrinkwrap":false},"0.13.0-alpha.2c860cbd":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.2c860cbd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.2c860cbd","dist":{"shasum":"9a3b6e6e307ab581bb8aeecc3ebcb88fd5f7b79a","integrity":"sha512-d+BpINCHh11b/RuvuTFmMZNUpIsJbKBOxXqqaqq3t71lbMNmqZBUzF1yJ5YS4MuFJ0YyIO8A7D/i3cunJeICDQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.2c860cbd.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0YuGCRA9TVsSAnZWagAAVWUP/jrlh/FTkg99EIidveWb\nt63K7fWsc9F3HsHyEkpahPLVYvjyyVSlMlMMHz2ypSKSuKXn+VY5yfZFLoyy\n78QLkL+k56U5b2EvP7ykZq+ZqVDZczNdmLAAxbDF/m5p/smvYorTa81uCsGA\ngqi+mK7NBmQYTDkp/oxi8BKyxGTMpmBNQVbHhFdlXLl11FQcIFWpLSM0R6az\nQrQd0pC9XD4JJoHkGseMs8Q0GgnqYQesd6g6ejCG5b5KB034FwlmxWPAIpey\nMVK+fRXPU+Lz9y7PdsxtvSvXzR2ykwuGKkYw1c5/GCmsFnsM+Tpa4BMgaM53\nvNgl95LFGJmkjY5epWU+dNqCx9IXEk3h/Ch8n/wFiZi64J7QFySUPxUcePKv\ntuhoF3SmiFOC0L7Gr58kxNLBJ+56RxIeMhe3kuzdzYgkYOtuao93/p6V+VlP\nRtQYKahfNN9seNFc2j87vSrLYeTYdoQf6F1f1GT89i1X49kT9I4BZjftO3me\nZ84hTf1IloceKnyxUyCPTAac/Dya0F/z5H7t+L3hCD1jaPTzaR4mDsg/A+qY\nuVaRrf9FMsgqdrz84JZdDW5MTKjAZCnuYl6LNyZVBik3nP5BWWtHfAgWi7zx\ndLagIpRUAtl7kprJ0qkQwvO73tk+UEHDkfz7BMquQ02RY9npvXqWUDrgm+L2\n069u\r\n=z8VX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFcEUzIvL4cmklS/GQMhLSC8vNId4H6fOYKmcNsrR7d5AiAKuMpbBrbXvd6vmsI6xoENk42R11Gxa00WjuTKsMr1ag=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.2c860cbd_1540459398159_0.5960320327878561"},"_hasShrinkwrap":false},"0.13.0-alpha.58aa4191":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.58aa4191","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.58aa4191","dist":{"shasum":"f04b44079adbd2d33d9fd3317207c3f3e68910b2","integrity":"sha512-PlYgAtrvON5CZQTUgR+jIFCuMu9tEp1xptILWsljP7Wgt4W19CrAR3UEebTjUOO+DFMd7tUZn3OpcQv9WwNNXQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.58aa4191.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0Y9tCRA9TVsSAnZWagAAm6EP/iQFL/GbnYEvwE0M7Dc1\ncDY/lfZYx9ymdYNqMsLNCxsYcN8vBe+bp1HGbZeiTolSwDG15xv37PXSVqJw\npcedu8pWUkSRfehqKDiTOXpgF2KAmZ6XeiSy7MsHOeXO24E6FQIiTgDt34qz\n3EoocX77UAOy5ZD29MEX1HgKsZJC7KlQIrOik+cCb4NMpKtCT6y9Gh55FKjJ\nZ2BEFeowE4gSt1SnV2fd89aHtxiBGjx1uA8SruFWbLKeKiSKDShweFGmXz7q\n69NasP3NhcXnmqNXkPvn/3mOPFVbJilcpC2YtuC4XmTo4YA7pgZRpXdGIdcS\nimFJAxt2CC1gZ3d3n9H5giquoKxinQ7vDbFtM6pNX2PqBKqVXbnlKxmyyw6v\nyGx8am4m8qH3qtbhSW/dsFUACLvaI2btImAZtM83Gi2owPir4vRdtp8t8VWJ\nmNq+VkPrxwhitJ/2Qa8wvuHOS8PtUIqzMAk47kV4wVgkVGbjL9zY9KBZUaJa\nWrfuhQ6P6d4QwDLWypzOlpqo6x0H4Ylc2vpNAZhw2kQ1//Ub+1SUXbYavZjc\nL/z908Aqkbkh6xo+uibZpLNFQ/JlE8OVH8JyoOd4glvBR3uRtl10/hHTGr9T\nVXbOc60u5TpjHeLlmaiOOEmcb1RnEhzymvpWz2lPtAiY9NtSuZL57LL2H3Nu\njMQy\r\n=BSXq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAkGzOy5g+oYJVxEwRdB/P9kOw6oUVOuYopsCwoIaI5sAiEA/DWhmid9H9z6bGjzk2dOD9J+ljsHU994GLuR8pVdmVk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.58aa4191_1540460396943_0.8309232114297878"},"_hasShrinkwrap":false},"0.13.0-alpha.f9e01717":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.f9e01717","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.f9e01717","dist":{"shasum":"031c2b8dc833318c3eb0d96c99542964c967c1d6","integrity":"sha512-BdB6m8xbpF0QEWSwU+VqknTRDwgnDLqOnVuQ6tBjRiCB/Ut55gwBrlrhpfbJou3JMh+oF1IDsQbiodqfGTdpwQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.f9e01717.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0Ze1CRA9TVsSAnZWagAAhW8P/jkY62tiZKXxR9cKYUs4\n2ZkF9s4H+rUQn1LOQwlvFn1LLHwUljcLRJbRgqYWkCpYocUmvyFeyO/JmLPx\nH2ZVqiXML2HFLV2K5UrL3rBig9DWHKsE13iMGxskGep+EwOjTs8q1CqgfVeJ\nZBdZ1WyKH+C7rZxfOIXda5hJObfVZMJhoueDVDskdD3sDOmGFn6sOW6Sfi1K\npg9PPfGhdkixYUmgfjiINloDZATu8CRaKt/0FnuUjFJFlksedOA6oBKb3vAW\nJnMB1mBerSOgkD9UuOIhK8RYYjsPTrocVki0lypfX2T0q97WXsG4QlKDwz2H\ny4WSneOm24YZsIi133ck9qV73H2y2UTjtAgDF63Pj5G6XE2+G2ZZLH9VAyGE\ny16NggSwMaaM+482x52C2pZv/kiK+bohyAdON9DQaXzaOAB5au7vIzLCzl0B\ngk+joME0VGmyKfG1HCGd9nyxOcwTI0h2TxQ8SROStlAyEWKXncSysHAIzHLn\ncGbhJRWu5bbj3qiEmdLtXZeuJUwjwlDSD2Zf31PI0yZKYeR3/8BS9yD1kNej\neiUZnkE8WEnu68qHVE0NCkPe4Pj0uChlMaLErwgRrQpTdJ4VIeuYxLl60quT\nZ/hhKvNX2iLBG+vlOq/H2uzljChyu6RTxyVNrepFvE8DvlUt9+PkG0JNg9Ou\n2HeA\r\n=0/SL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEtNib2ulOdFmW5tvhnqLteo4ooT92QmrlN8FYVxBIYHAiEA+bPgD9f3+0+oYsXUt59MDhEsHsKy5khxMCBhOxVbLhw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.f9e01717_1540462516951_0.8383864518438171"},"_hasShrinkwrap":false},"0.13.0-alpha.21241530":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.21241530","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.21241530","dist":{"shasum":"7e57463b4fa0808b0ace2dbf1d1b682e1d118920","integrity":"sha512-FbTLKqbFrSixkXuHx8fqkmXSKTaLTfZ/dTjKN/QiGYwWuYXCoavWibjHBsc16ifCnjKQHMD+UvwZRcHuq8huVw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.21241530.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0ZgTCRA9TVsSAnZWagAAFLEQAJSzAqg/Uarsa3y34UNP\nxc00+ULPQMCsVPqUc7p6Xv35izDnDnJuTrwK3wgO990nSzxb/xH3o5pEFnGB\nrGi+OZa8VMwPaxiUDjlqFRYfy68C7VEoD1KGZC4ImdO4UwPz9BQymF/hcRk2\nu1JwpT9IZOQTpqFYQDoUxpo3PiMU6JmyErQARils3hwoUZGvNqwePTcfgk1U\nl0f2SD5smgK8AnWkTzrjQl2dKqnk+PhgSv2qBw7d29F4Rp+bXiwHvGAfEA0l\nR0SXREJATKkB81gxqyM2ilgiUZzSaQTm2KQmNk4XuMsJfH5QbxsfUq/0RFlG\nheEd2Ol3RxEBq9UA7tcU03IrMYjq3OyVZ7En+9wEtbj2RZGCD3X1hc9o3zL+\nBuGVgiiF1QTSh3VwEOZqij9LAuqFDBNLY6iqvFDcWXeMlddOsjY1SG2EUPPU\nUlAUaK7C6uR3oFS6djS0NS/iEZOuVH9vqaSjdgiPLGCzQVeB925lO/NI9/2F\npBIUanmBq4O6xF+XXjJrs/Crn44OGAq1ht/utLDBKjPkr7WDLLyi6Ae2s0Ls\nIBamXUUrR84rkALnT7XBkRbvZvOjzAorXw0OrAVSCIbBYug9wNWLKWgqvB74\nAuU2YF405cAL3gmUrmdbJ0clFWUEONm70czOMmc7w092NEmj3zhQ5CGR4N1k\nfwvm\r\n=so39\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDejLJ67KrzkFQYCCi0gdjWd6jetoqbG36TUJx/FWp8IQIgEfQVdVteCuF+CP5wFZNdZhwLZlmTl4fMJCs+OeoHV7E="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.21241530_1540462610963_0.027215469798743896"},"_hasShrinkwrap":false},"0.13.0-alpha.2ce671cc":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.2ce671cc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.2ce671cc","dist":{"shasum":"ad516c51d1effff907e800e112e9bb1d24f2770c","integrity":"sha512-b+Z1+1mWOy/clKFv9ufkOeecPT5YVjDPDjuwDUjSA9H8YC54sSTnRbnc/I8hYkpNckU5YNGtOAPgKuGqJ1/SWw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.2ce671cc.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0ZgoCRA9TVsSAnZWagAAB6MP/2P4pYLhDvL2KnEt7dko\neTt8d9WxsdHdRhxJkuyTwIIn5K6U52xs7YoKL9qAZxJxbxnu0AJMti+Iucp+\n6fJUKjVO8mkNFvkVClzUpoxRyUuDaMhpAiJJqhZgxWabjQsk+quffZmc2+Bj\nrwdZQ8oHjmQhgddSEhbDbzEZqooTtkDHJDZbcS6G2ihkpTG0J77sRpRA13Wu\nePrDo1MH7LE5fe+hbm9xo15fInHdNqGgZOH6UGFTVcmw6HzjdTxTbcJe2khq\nDAtKn1BhSZ5IoiaDKojq5x15exrMk2qvHCB+QKgk/HpnSNky+XnXKYfbKLfV\nQT4y0c5S+S8ltadjszg9+ed4Cltb67KzY9T2wVlST1mqadJM6U3HbN6M3X5d\nQWDtXT6D+CNM/zf/KUJFRA4vAOphQIZ9ypEOywYgbcbwWEAV/g0Rbq8MaAoP\nZ7fVo0xL1TJIjLYizMV+T2HvzV1gmv/VtHyXBSC7tjlMA2BYrarWxmL6EgLa\nfLut0SV/SHwNuyR13bFJx1OhnersQuy8myrZ7k02scz66UsaIQ7Of3qHPH9w\n1pJc1lXPQOapdjFOv91hLsfezmOPn3Cb+AiXwTgf+QrT+ZxhZcUYfVWW4J4K\njTlrwhvJsvTRQPmrnnX010axBvRBACnJIvqg/Dpj47GwQXDspQT8cDKM+tmS\nWe0L\r\n=OMcq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmaG/nc20YVL6Sc8F+DGz8/QLYr4YnwW7Bed26sQzp1gIgRpcVAWODQHX3TVs5ROFYrcQqA61X2AsG4Fg3Zefyn4M="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.2ce671cc_1540462632161_0.130247642323442"},"_hasShrinkwrap":false},"0.13.0-alpha.50e1e305":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.50e1e305","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.50e1e305","dist":{"shasum":"95e49462193d41b3bb07598e9ecd14432fcc7f9d","integrity":"sha512-zZUSw8Zcv7G39xDaxKJUhDWNRlKFtnQmX/uPXzBz36OsdNSs9ROsOFiwnuZokQuWP7J7Y7kByV/Di0hdxGWBLA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.50e1e305.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0ZskCRA9TVsSAnZWagAAxWwP/0TQ+1nYQwPWGEsMFs6M\nlHpS5yU/wP87hPoj3vCbpAQCjHZOsP+S1XODw20VgPlX7mzJy2po85T7ruRe\ncbeTdLGNyjy2u7qWjLLgX0GfBwL/xJC06VVXHwf6vjZ9ld0noHR3OpRq7u7C\n0cCLVkuXnnlIded1WGMDuoVQvvNPZiI6Za/H9ICkx1xIcQPg4IIo56MJ7LLq\nMfT4gGdExNgwFkBS2NxXPD6O0oJAoNyH1goSp2e97y4bp6p3jankED0HSoO0\nYQMBcSGpanDAh08OhhGlP4A2nTwkK8s7fw+mOCYRUO12AslTDWs/QA6HfUra\nsPcru78r9IJYLJOYqyfsr9BAWOSngSYsbf2wO/LnL+fvW4rab68EhlSy2aoE\nSWq7uxPPv5KHJa2i6HY/8iZ2DaNajdD8T+sxyKVxx6ImzXsT0n79Faa9X35A\n7I5YcKwrvMAiRlNlL5vyftkfUFlwpRlhP7Zgof1ONiqxXowHAfkTaTPMoJCP\nTYmV3yWiimxq+lNxhDOiVPxSjYD9Vf+vj2/O2YFPPrU6OPtGIYjBbpeOQ62m\n/yxnAhoG7d5cNxHRNyO4yOmUWczq3iUeh6HqsUQH6r6SOA0laZewTB/Bi+Z9\nJm7Yc+iwKZ2vP0jCnBmz9xX49DGQMkcr8g+aMEH1eEX6XXqBQVZjVa9keuHP\nFQDc\r\n=emlx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiLFg052YtUe5S9aO8R5y8F8YzP5AjHYF3Ip+kLfKR6wIgBDZQeAV7VQb2p8zdeA8xZWt6V4meI2ZTBlq17v/TemE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.50e1e305_1540463395467_0.012225623221199244"},"_hasShrinkwrap":false},"0.13.0-alpha.8e0abd35":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.8e0abd35","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.8e0abd35","dist":{"shasum":"bebe6a945698fd8da317435f2738f21a4cda61d0","integrity":"sha512-QBXfkhTDAwqB5NVfKQu70lntdSGN9bfvZlQLLaIRYe2aBcg/CF19NjuSEHEs9G2qjYXRT+mPKyAdCnq3fI2DqQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.8e0abd35.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0ZwcCRA9TVsSAnZWagAAYmUP/12XM9rxVb6LUMrAUHvy\nv7F01hBBz3myzpH4TzX9+J6LrFpxkqiNPgJBonKjDDtD//Hzc/l6N0upF6tH\n8hZwvcgZPjNRSo8H1JYkBo1zNeq6154oQZHPO9Z4pNSnJCTDwLAjVjdfzW7K\nvdgqHcAfGd9wRIDZ0XicTzNT79U/51Okn/TiXblvLynjNeYXXGhIoH6UtoZe\nFVbOVpyTO1UuD7ynINX3zEuKqSLIok2FSy7wNDEwwnn/DlC+oQ83zW1uAyUg\nILWstm9O1Rxe84R+g4PViM0V++DUMuY686vvweFg5sjUxzBGs2SMUsnQ9hOX\nUGCx3UvqxhWv5C1TaoQY3GmVk1ow8/UfbvCK/QFdj4z9/nzxiMNjFw3JdsuJ\n6OPxNmIXvy/K0Yy6XNST5BiXmr8GNxp7TCWEuMZnv7v4Gc7FlUZxRRXNDqSc\nl4qCSds4V5JL3TGyO6JU4lvkjnyPMCDLKFkyjJCgpX7og9NKYX0dHuL8elk3\n57h7L9Zs6osy67voF3CuqdAeq/e93OIqYWF5Vx+XhRVfeJVoTOj1hZtIC38a\ngZ2h+wFPprEF8psc+voHUhC/60lUVP30fkI/1lgWGW3tZrLIY9KzHLgCbrrZ\nfhXo4gCVdEgmN0pHz+Omv4gF27l/Qyr7aJEJZ+xR47UFKz9xkY+D/AWOs6NY\nlF2E\r\n=7ozL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC44gUb4DF4mH0YR9WdPcB7J+4UjebjIvdkkoycGdP+UwIhALDVVsHT0aNKsvcqvHKtHpllBCoq7i2VkTPR39Nbz3Mu"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.8e0abd35_1540463643598_0.07227514070929075"},"_hasShrinkwrap":false},"0.13.0-alpha.1ac82e62":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.1ac82e62","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.1ac82e62","dist":{"shasum":"e0e30b1b3e45a1fed064fa45a6fa7b85a5dd372b","integrity":"sha512-vXEeq/KDgKpRdAC+JkzYn0RWnXvMiejuIgQrfhKANbM20Pc0IU7H7Cf5t0hC2U16YH6roqte/izjfXJvSOEZdA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.1ac82e62.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0a0fCRA9TVsSAnZWagAAOZAP/j1Dcw7oNK/hKJeY3G4q\nR+1TaUGJFCdnoOF/rRyqpc/nL44uvJ2fuESM7C7H6+VshbnUb3TD5COia+o4\ns/CdGD0L4rVEBMKogS2YVf+SDcpMM6S/uiWTMVlvq4Q/58eJKqTYixKB8a6R\nJFHIFiIRXTkS7RodNrwv29RY1Q47tcJVxsKs3/bcL5tvVrgtNVDv2jbfSFxE\nytM5sCRZFVfj2IHNthp7XuSXe1Z5+90p/Hg7PQ1ZpyKgBSVvvdZm9mc+wBcX\nSK7bxmF4xpN/NQPry1/ZSxLONRZl4SKHWyqbPwTxdyyQ7Wg2zQVcjLMMDbjl\nV7gZ2+GVFsCqJu8S4uYG8+rKIJPM6HduMuRlQjCfQJiEiQb79mKh5wWEnjuZ\nPTVceqgrCa9IwZhxPlWy7MRwXcTq43VgrvADWpw3Q3KaNrcNtaSNp7gpXN60\nfqKtLez//mxKK5uZH7OtQsN3RGQ4SFlflXKgGeZHyHWtPg9WlfbXtjq0GMAR\nC5QU5iCggeGn7WOUnidAzRmeS80MHXfLybP7j4tNoDzo/VlhEV9nwEz6SZID\nCv2JgCeuWDdfDVuSSxugmXj5Pw25V/acKrgp/ugGLxku0LATdDvJyFauhJJA\ntOAYiBeW/55m8LqRoO+80hIiHrL8OhxA19Wosh+oEjtE4WNYl9n+BYATkYiL\nCZHT\r\n=xcd9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAKK85XBGIE36CnUwYRc1rYfnb8J73eM2p2ohEJc4HkoAiEAi9VNLeMsGPoE4eqSVn+Ro89AT9HPpIoUtWVTFYlZI1Y="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.1ac82e62_1540467998551_0.7410476021325689"},"_hasShrinkwrap":false},"0.13.0-alpha.8be2b1e6":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.8be2b1e6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.8be2b1e6","dist":{"shasum":"7845c6f197648b1aab170a26d246333cc3fe1d6d","integrity":"sha512-aCpCNQOV/IYOufGQMPbrlfEfCw288BiiLdV0WMJ6UaRwj3GW3aouKOJpOyReY8eSs2/XFFUKwNm3xG/3UHSB3w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.8be2b1e6.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0bIoCRA9TVsSAnZWagAAzwQP/2qrfsyN3ag5DJrfSVQS\n4I+gLKosItw0hRw3az0FFnt7AhiZAYiQoarFnKqF6JK94aihSAyw2PDKkbD4\n/zDvIJT1hcg3PS+QncYNacrMOtNeGPdNufgGc1Gi97CxJ5od4U4UghXgdGM7\nutcpqj1KVSmReGiAQ9n2ne1V4M3zgX6l7yfxxdEqt8EU63iNT5J7QRQLn/TQ\nSjLmW5f3/6R7LjmY8Ol2JlxYT9rdouuovSHOiQ7pwyVnUte202k3vBlyXbH0\n3ZsGcxu5k2j0yuq7ShJsVbbKhA+QEsfRpcmIwvAVOOPOdqcqwCQtHZx41MYH\nUI8F9oT9qKM6pVf6vXk2PTqRRWI3XEymQeoaABarX3kcCxh9zjmxX2otAoPV\ns8O09VHCTYXUeNafgg25VgKWT7fZCRkR7tY4K0W5UCrEi3A7uroF6OISBYnT\nv2ESV8eNEczxm+C/2egi/f5Z4JokFg78MgJ7UVD/OKJJVM4IyCEhHO9C8J9N\nRcl6ZntVuPWUBNpt3dBsY35aEKLTkqrSR2VYChgd5yFS6fNTqRlro14+DXFe\nChk7AOOKGR+eV3oA/GVxX6izKXpVfCzK4Wx+mhUqXXtMCrchvRABJol0GCxQ\n2dy86fOUszmSDs5MRp8cH0B9UeexM7djWAj/V3lgB8NYtin1qnAJ1AzHFZVL\ncK87\r\n=Eld0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGkHaeo1MMdHDjC9kwdOlRDAQRvBAJUN7xz94pp1rwKdAiEAyYmJ4SogV1xXYIQ84hJW5DBc3zgNMezKYEdmrLB8B8w="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.8be2b1e6_1540469287678_0.04639970003602101"},"_hasShrinkwrap":false},"0.13.0-alpha.3468ac24":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.3468ac24","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.3468ac24","dist":{"shasum":"b791f3dbb9372eae0fcdc14085825ae0fd94f661","integrity":"sha512-pdXPxZx6ElDntgDWvDzL3AQaZ8oQTGxLj+UrDGHO4rSGItPybKIar0CWmB+oU8RunAYGG30YqBNa4Arn4Lt6ng==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.3468ac24.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0bPNCRA9TVsSAnZWagAAp2MP/RR4nqxZRki50JXh0p7u\n/oHfTRAJCJuzkt/PAnA6yK6MMd+0lXdPE815SBHsaEtv4BYRtYtYXzag2qWr\nu46Np1HAU/spDiJqkX5nLnzHHCI9BD06QOBSoRtVOYSxxj2ZCl7BPo1c5HOR\nIB+ROkM2Rc3WbPjeEcnxbF4nuA0qhA/9SII9KzoG6YmIEAS6HE2dR63AS4z2\nyBklSJvoddWirhgJzxG1ajG1RDGg/tI7TIznD65yx36A6U4IRRqOTM5kktUf\nPeCLNesSxSX8nXUa8TBXCEq+NvB1nIT+/ElfDqams8YZxzIBOg5cSMtRrWCA\ngp+5+1iUlSAr+RMSQZIEUWXX7YpFZHMPY4fZ6/uTitE0KfjvSUu8Jm2M599+\nISjv5RgYPyGjXXxzgl3MIoFdUdnxNB7Iimhii25irZeCnYYuoZSQaQ8FvGzQ\nKbkATMG16xbPBrCJYLMlKOsB5o+EQBTBWJ3EX6o7BbxZz5idJbtE4J3adXdS\ntskwBdT6TKyj95xd4qeY1xbDDI7fUti2OqfNtezDVWBvKUjCAbHi9S5j3TgM\ncHIjfyrnodaNIhimjnCPlarhTXWdy/ZMCwXCo2VIUEeSrrm7kbL2yJ7jHLa/\nyr/7z5dEeg5T9XT6NgUw78mjMJBB6shmpXeo5VibhY9Cc5hlFO9ppemtGxyh\nzQdO\r\n=gZXQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGM2ajOtJM4eQrEL4kchVSIw6UaWoUumrFC+vZGBnFOZAiEAhubp83SfOmGrbxb93nDQvKCk50QmAypO6PPphdjgLG4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.3468ac24_1540469708972_0.3511536521378571"},"_hasShrinkwrap":false},"0.13.0-alpha.04fc7cc7":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.04fc7cc7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.04fc7cc7","dist":{"shasum":"1c1b176fbe50fee6930cbf0d82c816f43857743f","integrity":"sha512-15T7ewtHRc+gbvSFGQqf61ZvLjw164Z64JZHqq6zAGM3Zr7EzilQBdNJJVhCKUbj5IqICNLNGv0PbcxZwqQ6nA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.04fc7cc7.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0cWyCRA9TVsSAnZWagAAqgYQAJ63y6kXr5f+WSvtaVDj\nO+crHXVpDDoEM4izYGACy/rRh8nMe+x33Z7nguZbgnhHuSiYKW3GpKYM2fLM\nB17R+E3kFmp0J29RfFOTWcxGuntjq3T224C/qgq4RUD6XlDwAHcAlnXrWn8P\npLEArKbuPmAmwfqfEr7+T120DqdAcjhXPAgJ7nTrTH85L55mOoWS+26yabqX\nKS8H7k/C7/umhn6ah0VzUWs6nPNXOkZbJkH4wq9LqGYHbummbMSqVJ+2gopJ\naaLnqXVp2g/DV586vf7TiteVcp2LoBkd0SR8AC6jJuutHFk+B+VEw9bmAc2S\n7wYcw6I5vPO+4Phl386GEUktl3euOtvxv3opOB+z5Gvj+YR10v43hzXHLQrC\nScqg/TkIO1mvavcfBxrn01lYxgoIoGw8Ez0AYrqpg8GGuptjVJwZYfSu7s3e\nAKzdnN3Qe/wfHD091nuw/vx3oDpT6xtO/nWED63cjiIb1NB1Gm0lZzrQKPDQ\nwxgyOUgQcms9POcpB59mK1tItvtvmkIEWjlBII8CZ8UrK7Y7X4/aTelfoMTm\nqpe6Qlf9vRYAZr2uGWG+TQT03qIj7Fs/bXi2INc/feP6W7BhDDkqA2RrzdJl\n+Kcag4jjDzbNN8QHe5JzSbLjgo03VZ+LboqWtrvoWhOIcQYM05Wfwi2irfYW\nu+XE\r\n=so5b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAS5HaxsHtOmHhM3fsQqYGeIrSq/N/lPUBqXA3aztMkKAiBYrNLD5FYRzP44PI6ftzi3Pf11OLOXJ4Oa8gbyFiqQcg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.04fc7cc7_1540474289760_0.9624300936551127"},"_hasShrinkwrap":false},"0.13.0-alpha.4f9e6f08":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.4f9e6f08","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.4f9e6f08","dist":{"shasum":"7273d028cdb6868bc1c4518ec3495128de83273a","integrity":"sha512-92vgDSV+sVgkXU6Zc68Au+Tmm4dwQxxzc85HZ4QO/Rpp6oORl/wucCRvDukrVLzPErJoPGRPkA5Fa30qFJczag==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.4f9e6f08.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0cpnCRA9TVsSAnZWagAAB4gP/2my4XBtBIbNdV01hEVg\nEDabHaMJFNB2oqpGR0fiGNGZHDEkQ9LyUExLJIo745yRKG3j2CDanI+DDhZo\nm6Xt0gB6zTsgGdVQUIvhdLHzS3TIh7iQCErq1+M6eJuTLMclOk8hD1gXvuQ/\nc3i6zhu/C90t5ZkRGn75W2Z5KFaMXUcjrZoLY8unq8j7MYAcL8huQV3SRX/T\nLxFkGCdefz/rVShR+AgoU0/5wpCOEy5lWsFTzt6jpJmKhLXgakVek8grQDqX\nTk9hbdBYbYsK/1THKOB4fIXwCNGueiSNkgWczH7yRmXQ9mwumUR/LhNCjSQV\nhY3hTIkokUBQPRDudwUqYIR7C/gJzFK+iPK1hTH1oaOOSSP6aAN5iHNMl/hf\nKPR6Xi73nXtsrZPBAltc89FEVflpjPOfThKySayP38ChcpAEvLlebrGNH2PT\n/LeBmu15Q5lYn8JSSPacW2xTbz+0PvCno9Fk0kCMnXEP5Itj7YHIervRnsjs\n8MGIxTtWXv7u0k98BGkrjjA0Tv23Yf+6dC1YnvltoYFteh8GYVrmL+P1tuHG\n9Jn5JYKjDCz2mAJjqU4SybU3ftNxpuRuHtFjuhiYtTxB/3HJgW4WP/HemGw9\nk2mkG+8TgZNizFCZiW9PgENVubTkCRyIt/7/h5CO+EWyxtkkN9GNYGBHkVgU\nEbqR\r\n=PrKt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA1yP6YC7YLomnp1czDR2+LEHtVSmcPx0wgJ5GZH2THiAiA9BFMJlr8BzYSKT6nFFdr3etuSG8iM9aN3G0RHCjVWog=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.4f9e6f08_1540475495061_0.8260934007401295"},"_hasShrinkwrap":false},"0.13.0-alpha.18bdad2e":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.18bdad2e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.18bdad2e","dist":{"shasum":"a5b2ea4f89254ecf5afde14a527d162fda64ac6b","integrity":"sha512-bsTprRLEzLTawVVWCARTilR2MJS7Xxg/8EUXvjuY+ABHCbcuiA/nkIMLBnNXP1oTS4PnxZxooentVp3Qnz/xtg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.18bdad2e.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0crmCRA9TVsSAnZWagAA/mIP/2S+1F0b7QJrwIuQtg96\nlTxCo28stg5vagaEEpXHWxJQHoTWDLvB57YMvUv0meFJ35TMlgP7jmk8gX/5\nPHK6FIlDpBkn/b87Np2GPIqc06XSzjt5tJn909ELctYAbGR2bFXv/AR0x/cR\nNED0asU7bx+NYNUQkFHjh6M32mu1SBYo50dd0Ea9bUvV9fmCGWgWapujRNyD\nojLDGYMN8tWJ5EE1RigDR4BR3754IYtCJd9Mlzy6HwBpCRRUkveRCH82k2h4\nPoZr8AqRpyGYIoIBr9sc4KJEQuulbhIOX96xLDcWOgdG8xPXO5fvR7HkdMKP\nwTLBHS4Y9nfQi4TC50Te5x+T3ZjeMTxUbfG1thzES0AeDXNHhHQJcH2XyYhF\n69fb0ka9fn3A3sB3+aYOu9a7shOSrp3gfJCCxN/4ZkI+/0149j2u2aVITMO2\n8KT4Ffd4BgMdYiYYoP6kve9Ub9v7fxpavkTiWn3ZpTy7mFwISeRNL90xg9Wk\nDYOb1Te+wgvEJQkOBnTibuyf5SIlJ6bpDGxVuMFJChqEZpQWqswdG3YGcxFQ\n9sol+kZewoGJrUtaDhAIsspY8uGDZ1ErhWd31UrdDkNrTR7revK05rpaNANu\nc+Y9sQfw4V8VZ5ZZMLNfTovV7LPyoi/xm8iQVW4NgH4PArrWbeg7twrR7DNB\nyakf\r\n=94gw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSLPuMqFtmvPOAdTsaqFdhOOl53yhgyn+YsYyXISgyOAIgVoHAh/+O7UZfKUmyjyVQszJkobf3mLr40l7At4girLo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.18bdad2e_1540475621761_0.16645383648379153"},"_hasShrinkwrap":false},"0.13.0-alpha.eacbee5c":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.eacbee5c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.eacbee5c","dist":{"shasum":"455620cd2dc1b7d0ee6f82fde5f982ad18efd2d7","integrity":"sha512-T/mJ16yBk9j/WK7Ok1EW4HL21bH+PcrQJW3yq/QRd9+WT/TBEWCpxg6kLGoHz9QSGHVpF9bmimHJt0pQ6Z7X4A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.eacbee5c.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0eaBCRA9TVsSAnZWagAAJ04QAJI+0en7X5RHJPbTYm5m\nsY+rQdcNq5Hk8fPfyQAv26SkDFPoa73ApoJ1O3yyNtrLLpWXivkUKOOE9emP\n2Ek8ZQRrD7qB3EWUue9iYhEysQNsxtsK563fFCduw3vLjvle5HnVNLDrMkGk\n1hA36U4tSiutoOOFdMhdvK48QH07mUCfE8feJeIpf52hGAQJYB0yFgTu9cHq\npGkPtx3pAYy4FKx1xegAY8zZA+3RPDybleU2du/RAjw1MijH0/ha6ZirWx9S\njiIvOzjr9aFJP8FPVbzRPk3p9kDjsd1tKyNvrTR8pNMD2H+xKybdf89XMW+F\nOKsMjYME7FkIAYEwBSBP5PCWDJmBtSJavDeSXTZx9C469VmMy2gAKnZnrfSb\n+Ufi7qHGk25yvKFm7R4I1yk3H/GQsHqrmILRE5EcKb06DYqeARGFRWm7DkA4\niqBz2klorWpDpekKmxYOsP+t6EwxjzuofqtsBUFMJQid8oNDk7HwXaXSG4dW\nKwtPYZmMTPC15L+GOGm7afUMvu/I/8uA1FkGkC9BfCIZP7v9njCrNeHx5c3z\n9msW3mEVuiHzXr62QmeDg+M7S15A6QdEo4/IA6yDr6ZdY3Q644FpCPLsvHYz\nUjBzjfFzd8MRC4jKLE5QbydQa/32MX3Jaazddyf6TpI12MLdht/quDpoYipt\nc6d6\r\n=lY6H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBpZSDlYp1KMoUSh7/ZYV1o7y3cxthIUeAnwu6u2XT5AIhAN1WdUH6wO2Jpb8slXctyDp67SRbgWOxJArLzAjHoHxj"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.eacbee5c_1540482689030_0.8584500867903149"},"_hasShrinkwrap":false},"0.13.0-alpha.f8c8892a":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.f8c8892a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.f8c8892a","dist":{"shasum":"043ab447d0ea7002acbc07c3db4b8ecb6d0bf7c8","integrity":"sha512-Mnv+hkp/Rf2pxQ8KR0sweaWYUn9jGA4B45tUdzvN1IfmKm3QSIwUCz2o521Ka1hrxIaZrj0QgP7b9jxo3pVgtw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.f8c8892a.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0eriCRA9TVsSAnZWagAAKAIQAKK3IOBqu0ET0fjxextb\nT1cfAu4KB5DJ9C207J8ahH5nnh1DeaXDOZ/vKq5VIM0JOpQktLjsAGuc6MEQ\nRqcM3MJVWm/He0Tftf14VJfj7geKwq702tRzilHZDIlD7qHU2M1GAKBCJlQ5\nDPr/X6t5x44WFBDghyF12vGIqSlKBGtxiEkq2pg951pOWc8gqTUl75tLXUqG\nLKsXtPW7WkwG8FmdLKHwR2DzQvWaulngcrAjkorkxkLtOocW2/cRu0WRQXzf\nsfksKm5fz5zTlQjcLinJ+u+n5NoNCGUjeVJ7+2zbLwzNE23Ou5kTTxFHvbVv\n1tsRDbFWqpRBnicprINfXMvWfY9IhjhAyue8wFo5rTeKwwL7+wgkD7lqf+KF\nx9wDMKjJeey7uOqQIen/9LGH8aXcEzfsvbfqQogXttGbt4IcLxIljbAdMpWz\n8cg0KUH9wyWL8rjbF/JBHWRbXhzphUIklQXfAB4UJvLG+ydt4tBCzKaFJx1v\nwD7OTDfIbCVI/dty/tqHd8rWwXvnZHMR6brXVkBG/uYlOp88465o+0O7U9RR\ncRl8GJU6Skst9tHB/R5n5/e0oZqF13qIFgwDv0Mn8wwuLTJbzB+bJnUFOtNM\nbXHydMPZ3xb948wvlCT/5ILVXJVrASPoohIKUJ7zsaJjYCyDeiLQqlYyuYUu\nz2S6\r\n=t0nd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHfE45gwI8h/T6hw7HarOYOQgZcpO/3opNYkMjz/i4eyAiAdvT2LE6wmCSRw/WURL4jcKl/lhp9w/b5p+JJx7BtBLQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.f8c8892a_1540483809496_0.2605376750826034"},"_hasShrinkwrap":false},"0.13.0-alpha.f0398853":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.f0398853","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.f0398853","dist":{"shasum":"328f6b21bb89af15bbc153302586efec7400db0b","integrity":"sha512-jaVUbatpaPLa353Ko1gKWulVyi56EfRzfqsEMVQemmE0YnLfNoNw9kvr6xWag18fzgqyL8kOnznYUhLR5gVlXQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.f0398853.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0ti4CRA9TVsSAnZWagAAjBUP/jJV6PlEnSm4dFzMs7Xv\n0R5US8JsF3opvkWjVq8fFamMotxJNQt398ILl301dlU4JhNd/mU6VSLc5b3K\n9U0oGNlbih80TByiha3YrgQz9jaloHC7rmuLj/WM8mgB7q8l9iUrqVWB98Ad\njAgFDWPtEdAVJLFeJVWKztv9+fzfJVa51uEcCwd1GJHxMLgW9hWAzj9GnHVy\nPNn+ml/dBJkljFKera6Z6Gxq+0uH7hgOWimSZjVxt2fsusIhPMHKaniqHybw\nNUlmTw3k7Fe7pfTBbQQJCKurwZyHkAg4G3rMhvcu+6Gy6F3KEzoBhWO0sA8O\nH6o8vpfZVz3XzHX7mXd3iG+rkz54jIw+Gou/ccxwHFPdmMX7xSKJbA9vnutV\n4rh+usSOmSQqWMhqfpc+gPFXAgH7AS4wQLxpLwhy+NJFrV9SYccBPSR8eIjG\nG+D58//kC5u6KoTRwdX13XVsqBASwITNn0ywNJjXrl//SoTeZlK2LsVWramL\nwq/ig0SrACFdPvBmjY5ovBqTMcTaLsgBIAQ5FxWslaQs3U4NREU+vqhki0a9\ndQ9uuWTlA8M9tKiwibQk35Bi9nYtTKRr8RmI4fXyr0LHv/hI2aJzB16DRsL/\niKcfEF0iPj4pilGg1qSSaoMYXblZM3kClGKGNcaNwsUg9anlKqHl2BV4RZdq\n1D6/\r\n=rVgp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEfVUIf2C8liK5bHEpQeIv6sWyeBTPZLi/ecnoGw6fsiAiAsshhNP+Yif6FzuPSHeycIWbe3hts1ti/iIRgMO8h67A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.f0398853_1540544695852_0.620038877198618"},"_hasShrinkwrap":false},"0.13.0-alpha.f3384d84":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.f3384d84","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.f3384d84","dist":{"shasum":"eead72a71c72263b8a603773e4f862099e169577","integrity":"sha512-hDqlqPp6JOMLtdQdPZBvOwENPw8jAjUfe5n/7mDpzCrRFsBtAhpqX44ERZ07jfBC6Z3tEkfyROTe/KQaT7yNPQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.f3384d84.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0tjSCRA9TVsSAnZWagAAZHAP/22h7mi86O88sRXULxws\noorQWCFPzsccHlaDGDDpCnwXagikZvyr/7gdesInBs5XTj9DPFjmSfhPKhDA\nBho1+M96MOs6aA7aMHblinwDn2YTqdAKLmEB9YTGNd3fjtPefvALGnIMiPJ2\n9LZt+lgh0Mm8d9gEE1PO02g+g/nz32etNI1L2rkanEVjsEgHyDq8vcnJMJcx\nS5T0/5NxohZzlZy/Yyqps1n3DiK6xe6IqKSQn9r8OjhogkWNWjDt+otL00i9\n0SdHOIClhO2/9+fVhshLmZ28rJTOMeeCiOOuPx2Evh6o1RlJTNSK4jvPYG/5\ntAq5HkWxMtw/SFNv0H44qYm5syDWi07HWH5C+XUqrd8OizZuVDEOPlNyBkiz\nkK3QOMlV1UB7YaLd1yRg4eoHsLOPfS4ijmnPqc2Ds7iRpBX9Z+Iw7JFGOTjI\nf4mbSaiIjx42V93E0pYP1DVMMI5Jz5Wx8rEIG832HydMWebtBRvRLEvwqhUZ\ns+52JOlqcD9vqyQCObETA/IFZmgeaP7Bw89UihR1frWCptaJTwzuceyb9OtJ\n+T6FNkTqHOoGEIuc19OQvRpEQNcUoHaDk+qlv5v76z6jUS5IcBXaDT3HKeQe\nWnNtDcUwfv+McB+UkMaGTuEe61m+IuuNavwwTSSF4+2f3cvUkwMK3ltbPmA6\nH+he\r\n=A3r9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDuqTgzo9bxyGx9XNXSS0XFZoIh6SeXV/rmVxIr2JaEUAiEAloS7EqTPH0z+UDVS7cR0YXOGEjUk5QmpoYM52XTRQ+s="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.f3384d84_1540544721720_0.04258622140739199"},"_hasShrinkwrap":false},"0.13.0-alpha.7a22cb2a":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.7a22cb2a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.7a22cb2a","dist":{"shasum":"4e20e89758316c370791e304ea47dc09b345d50d","integrity":"sha512-LsWyz7darmySa7wrOuVO52SrreYUsFLmIJH2ILxTG4RuX3D0pwU8I6J9PNUiKMAAxaSwpa8XmSKnntrOafl7Bg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.7a22cb2a.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0tmvCRA9TVsSAnZWagAAq04P/1WdTSD3UC+gAox7gGfu\n6lpqPz7jMp2U9lBAYgGhP8ceCTqYmkrYvhHg+BMi9LCAOs6om45IAhcyxCFQ\nLZubE6pFgVohSKa0eA1b0fgUQ+91w2pGymACQFYqjBpaMFt+dg6zFOFZq2/r\nrzr7CyoXYYUCdax0/tC7Z2iRLYLPjiKGbNKoZDfw3xN7qRjkJUN4n0TOHYva\nbPAFJMIaJD4ExKM68aOEm0ONfKO6AATjnnPZoa5m4ANLJ1roeQ31Qwy9Z8AK\nG+TxYw7wk34TojpPldD4teh2NRnv4e4gS/gCv9fSl2Lx1Awfg9rFO9yoXHv9\n7pz8p1bytQdgxBrVz+Q/uaOX94lfh0Z8ssfddMW1coYRnch89z4zkORqLmTA\nN9IQ25hgIaxPGmgsqgJplD+vroL8G/pcG41zB9bLy4UF3YfOjTncs4CzbPP/\nvFAGoryov97ElsYm18+EetwKo58LH0KmkJft4Mlh9w13y2bf7bbGMqlanhK1\n/wQR+11UXbs62AXf2VNbTsN+OvIhzqOO2faf9ZpTPdxzP6+/MIQrPvUajXWW\nVptCEA1olrflKpNSybrbgBLPJfbRfqUAMH22EFwm1AD4pBY8V2bf94gIJlVU\ndyuAubhziLYejo7atriX9Vx4EOl8nsNoL2mKpPP0mcqujkb5rK6EtP6shdz0\ngo1w\r\n=8ZNe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqXN1wKDgjEQWRF6FlrfzfkT3PK52E5U7KQaOJEmLVHgIga/apqOtEFN5nVwjDWTMHhwfQpaeRb1c4hN5jbUJQxlc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.7a22cb2a_1540544942713_0.5473078692648377"},"_hasShrinkwrap":false},"0.13.0-alpha.e3b86daa":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.e3b86daa","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.e3b86daa","dist":{"shasum":"9ed2f006e889f5dfa89fd0a552dfc292cedc70ed","integrity":"sha512-FOiqfa/pWCyWlVBIRSwAUaB/GWWo/4i67hQj/DDL9WllFbMYMYuh15FlCdsvs+7NfUS0xWwn2LwhDGJjxKnTtw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.e3b86daa.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0wbWCRA9TVsSAnZWagAAEOcP/2XRUKUxJ/ilRt3nt2ZL\ni7YVL0QTnBLTYS72FDmfsEWuHf+4oCgzAeGjk6g/mxqaQ0c71UcnSb+tCIAB\npBR6YWC+QDOZqaXyJk++VgHoiO+M3E1zCsyJyYVflX/9xdj3R2vKss8hHteH\nFH5tJd9m1oZdggVVhywWF+8CEUIw5NpTxdTzVNugdmKVhGDTZOb4oRTaFBa6\nsscBbpv9GdqMTqVZnNux1fY4BVFtrnwwPH+1QSPquy6H0h6Uv6plUuF9Rwru\nhOuvO1/+kn3y2JsAJ3v/AIbAIyezDaby7Ww1Ipl1ZWnuyxIUVN+syyUF7Pwa\nHvIAlNoGR9MHQZELlD8YnUPFmI1DmWUqhBPRItYhiZiQrC5VVIS6X7ryuloE\n7NMZrc58wSP6e1QOlr89b9r4Tz6r6kohkNmDCp3xtzpKgwtDpEasjQd/vcGb\n78/t77NtmJ8a5zrgMX1hqskkHrKq+SgFadS7j3xYAKAmatzIt5AZXEPi7YC9\nk8uU7eIerBxLWbQdTN11Gthviz+Erc8vceIsBNJaHh4KQu0y04u3N7Kg6jqx\n+dTSWeNDbgeZQjqC68r9NOkq38BW/XOmEE7lDGIQt6uPgXZyoMMYesONjq+f\nmMeL2kCXTkFVxpCha4/VPn7Jxe7FSsrdsLdKMubsHNvq+m5OXyXwgxJ7fg1w\noDtb\r\n=FkHF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD352tzAfqwM9K67EBZCtoTHVxXvIr3JdvSqmk/sO+bGQIgKzelh3E8HvQR47ok1soGr/K542sACFbYW4DEcel1ULE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.e3b86daa_1540556501491_0.13387415743046271"},"_hasShrinkwrap":false},"0.13.0-alpha.34c9c8c7":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.34c9c8c7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.34c9c8c7","dist":{"shasum":"cee76a77fd8fd069a748155423e69ffaf6c0e51d","integrity":"sha512-4/I1OwQqy3QJjFspmpABQlVhJL4iUtxazutfBNyvFC3fuVnP1KVAHrPrQDiTTpT8xGUkEu9OMZFX5qYm2mXEbg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.34c9c8c7.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0w4aCRA9TVsSAnZWagAAJ7cP/Al7kmoyRzV+h7lQSgb2\nt8AsrXqhsW6A/4n1Y1CrNwFhCjkQCMREPNvYgpdaWZpOfpZO1V8lsBewu1kX\nHyDPM0u4WUnKCt/J83DaqB4RD6o9CeoIDolwm4XAqdlCKXVniGlmIrsFmyLK\nhi07mP5Smnw+wfRnH1GlBzo7Adlaeco1UgUBjWMCYPa/KAJ2N6choGjwDBR9\nzVQhVgkgzSmMbUsq9HuGhqJMdDkNsBwDBiFJKBDE0vF8E/kGgH+aoVV1vL6h\ncf0y8BNLTFSzbUmWFsGO36e+3wEylkJ8+InLMhTj/tUoUoKoFWD2LO+jfgxd\n3FBVxC9LqzdqeQGbRIt5ay40RpJYZcSpgYXx4ZQLS0GRRNL4HdVakNfVPPT5\n2XEbPWsk0vnkr/+T6+mpe+vbMRFsDY56rBFYhuat5eSWVLaS7AsFYipaiZYo\nmR0E9L2Nin528lTPtvoVQYHtI2IhwRk7NT9cbz0VEtAUEWwJgMbYccuBi1P4\n8hyy4ksBvxZlSuSeDm+cze+EqsJGtVX+BtZJ5o+8R6cDOMIDPxx1VqVmcMJf\nW1GEgNyfHQNwkIH9UuVBbRIyFNOrof2y2GoCMvU9yNRldpQnXcPnf+SrxO8+\nTjxnDz9LNotWXiQ+f6R5CfI9WyHZHMBEzycJlgVQ9XWNHvbxpDC2RRscAKyf\nS31D\r\n=6xsS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICPZ26Z9lBwXT3qlpX6hn1lM9AysgsJWQy2QjMb8zuxuAiA5VqDtX/YhJbKP9PVbBdpIWlaxR2djvUqYayJJh13hqg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.34c9c8c7_1540558361434_0.5210354388410734"},"_hasShrinkwrap":false},"0.13.0-alpha.b99853ae":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.b99853ae","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.b99853ae","dist":{"shasum":"d9daba7817270b710900a85a77a06aa389b215df","integrity":"sha512-EvsukFUPF9HFPFeVBPDZMVLCOD/vjSzM2/EAyQPAAWMHzxpeO2j5MA1Rl4Sw+cDnlWD7do7WMQ7IdFYC3d74Fg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.b99853ae.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0xR6CRA9TVsSAnZWagAAkPMP+QGUjeQxgRGbekkUyDwP\ncMlHLpk24V8PQ1DYbnmeM2ZtpYmkqYFAOd3tnkOFaQbAhGKl4dQtgzJ7tXL1\n8C8zizcqe7bw+pLyAAiycEpFMbix8542zW/v+fSpb3voZWpAx0ORsxToj7Qx\nvIS1rRNwbV//7AV7xriSvKvPjISpJRyqFQFddHrww8v+06c0JNAoVpEW8LrC\njCVIIMPG8Z9eAxTJHp9tAUK5N1SW4Uir+CxAV1i9lJljTSCPIPNkU5BUwWXg\nLBhaV+H82vn45wYCPxc6qRgiQIvV1bOZZwSunjY1f77eNy7uFYw5Bc3wD40f\ngbUFNKaHaDXam9Z+TONnbUwBiePBQPyBc4Z2T0n1Oo35dYKfihp/nL07nHqS\nkrLBj4vvrh0rt1gfwjt12cI/6gZFO+jp8AUquR3yc+jwJXDenBLD2kx9ii6U\nRRuq9KGyTQHSosD+GCVBxxKUeCQn24Iz7GzjJdqbM3/nLcAMAT6uZL2X88FA\nPFoF0Ri7WpDw7nAjPMSywXHk7O6p3dj3hV+QalYCEEw6/OpLIsq6s6o0vR8F\nZK8CoTVDCou0KFxKZNCCwON4oNPrq6ZLuo1Cf6/B6A+DcmTOVTsS4umCREus\nQ3f30hIEBTKpnVcJf6LuVl/jun5bHhlxwVhDOzEZYudpI41lHSjw/gBIYRuV\nl4Td\r\n=ap14\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDr6dNJeZSEdQMkelCGMjy4N4dchhXAt6/CQ8esLyQ2YQIgKm50Rvbtoi8cskmSyBgPUoVw8H1rcGo4hF/17nIBXOE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.b99853ae_1540559993855_0.0033013440211033807"},"_hasShrinkwrap":false},"0.13.0-alpha.a6dc2cdf":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.a6dc2cdf","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.a6dc2cdf","dist":{"shasum":"9686825237b3f86b3e1667398c059d1bbc1d02cd","integrity":"sha512-AZ/1l4Fd1vxOmk4BuQSp0L50GOGwohSgUwI/4K3TkO1KN1YhuFm+QKG8q7ZsMYrhsaGjsUGmBEvw7SQV9aE/XQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.a6dc2cdf.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0xisCRA9TVsSAnZWagAArG8QAJro7+u77WR4RlbJCnAg\nWrl+bY83nEFlNqxwl+Fpt/um97noyxyY7+3vgH9litZB+ZZfVa9DvLZiIDvg\nqixjmJtyMoPJmx5ASNelbUQ9k6twD1geVJZBLKPdrsobQePUi6ocEkN4oQ7c\nwfRp6ZaIosvqiA5/r1nVsEIggxpNhDNeFVUlU4s776ZNsIu+gXjch/yCmlO7\nLSbVKc+0TTyXw7mGJy/jNTvP+jSWgCl4hNM9dmPcQqRRM4cELpk/q0TSh+Ib\nK/QmEtyr+dT7AdA1tPOmYPbFFz1TM34UoZOLF422FNpRv/TizVEQ1rZhlS+G\n/jo1pFbVp8rTkJTtpJk5G5JCeUWTh7OKVMB6BhjbV94AEiZ+/l0fPW5vCma1\nVz8hIPnJbGB/ym3aOaTSpZYXbJwYFlylXTZlQG3tozR+P6BcSRZgTnVetPVP\nOtZdlutbaop1eBr2R8fXEDNs0EW6iW/DUQFPb2Jpa0vRXwspFwpwsRPPswvU\n0NghRLzJru+cByJIVLbdekG7w6vyNvjaBxs8ij53rgEIRPrBTZrT4+CMXBPM\nEDF/Jrm6Y58+PVQGPix++9l/sDzcYtWRLhPdpOBoqeXgqvS4aRKH36q1Rj2O\nrdV0ZqFXPR+nWP4d+uqVtOdSotITW5nWU/FHXgZYAPG2PHLkkCSNIiz75X/S\nfyUv\r\n=xEbm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHZyo/b+D0wtqu/jkBSKrOHv36i+GZbDeVkKVPLkIUA8AiBPmo2l4N1QpGBxPUkb66lrgJoovhoufUkWY+76jnKfmg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.a6dc2cdf_1540561067835_0.08947250548783181"},"_hasShrinkwrap":false},"0.13.0-alpha.fe7f3e8e":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.fe7f3e8e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.fe7f3e8e","dist":{"shasum":"6a0ef8e841493de5051c1b97455179df5741cede","integrity":"sha512-5oG19KA8ApRSJ6pPUlYI5tj+g43B9Hgb2e6Se0QjRz1qBbQsM4i0Sy0ida0Gp4zyy1QkS9j2qgvfHZ+scIBhPw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.fe7f3e8e.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0yKsCRA9TVsSAnZWagAAS60QAJH0tUCthSqrml+8pvl4\nixd/Ut/3JZXWGvniC3Sxgl/pl/I89rFoqRS3NmcF7gj56svevffWVLGllBZ3\nxAOkqUh4PToKQBVWW2ynMVheQ96So84IXX3BsLis15SMH12ulI61Byz3IkhN\ncNHzeiX5tl/U+FT52z8HwpWNtC8YC+iIsgvN1hTgEBzsgeegV0tL3simKq1N\nTMYzzPViZ72kQevI09dKVOKpigNM987QQaMFNniAP2Fezsx1NhPIEIoMtogl\nWnvZ06mKCmVtYpcknwFmP0gjxDDm1Fp0YhmsgKvrv23ql5M9end1+8bHUd4V\nvt7ywiNf+xwm3K9q2CpNH4VcZU3mk/tNv8jMTZVZ9WslCoD78H59s+4tax60\nJaAHFs9KIf59gpH9ygVcoe6tBE2GNSA/s0SJkyE2GvKHCLetAxDjseSOjUtM\nru0Ru5CCYlN7wXleiwthfScMbzj6Gay3kvJbI6+iCYPpC6j69NSWd7k+tqqG\nnsYMjHaVH5uXeqST2cRIgtOw8lU1RbD2moetd7NiSVf/cCyxadz+QH0Dwz4c\nTAxe3FAKLSYQhyUZ32kJTc7AEO0gauIf/iQnmY+P1d+sKuwfZtraCcN3RkH8\n3yJ8jQsd67nzLwCyHx5gV7OiucmrKZcm8aQf3MhbV9tjD4aRxKI+SnWFivY7\nFX/x\r\n=CPRq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE8lX2WiE3xCIrr/fSIi3xcANuTF5Dyn0dVY7TYNHi7mAiEA4hvlID8t3FvJwH4EAeIxOcYICBXEvNvv50WXNqG6b5Q="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.fe7f3e8e_1540563627419_0.021638606276401795"},"_hasShrinkwrap":false},"0.13.0-alpha.064aaaac":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.064aaaac","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.064aaaac","dist":{"shasum":"416164a6e97c9de111e539a3a78d293532f36311","integrity":"sha512-lIyMNL0SkA8Tq41V3WQ31BW7P1zKvwW+pO4wyoVCKlMfRndZfg/zZ+Ep1clHpvtEfHgd4n6ogI+zmpGCKnECng==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.064aaaac.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0znRCRA9TVsSAnZWagAAT70P/143gKC8GhecgeTT5WTl\nUIHGCupS9eIWJlaDBQhaqu28sg4xIxBuitZTCKP75BksnMmWDtjowI3YDQxn\naJQevkXckInSo63fErakeBJRTFXaSLjvZzCJiVrdLQJV/QYG7FE6a8Ggl0MM\n9QLv1d+GKOHeZ236hu/0M6oIqHfq8tAbQ20sJ7FmMhkr6Ao9+bNR+W85Hfup\n+4d1MuGq7N8O3GXVYdOyDsN8sMEr+a/PahjE87ocsPtWUa5Rvkk69R8o5Oem\nUJpte/V9SKJfWgOWnwSMGFLMraAguifqjdCKRjkPSe/GuT2sWmh49B1s8CR9\nbO29lotYcQuERcECsJOChsrZDhdJ+pwYlayIVh678J8qbrVIlhQCcTFvnvR7\nw62AG2hlpRLfMKfDV9m2cBxbR3UTUx5k5fYWN3FvHFp0S7yVUA2sIOdO5ga6\ni6kqcmbKEfOB8tBFYVFz4guFyjHBPUf2U56XfblCGMfQ6LJLDjTeFL3+DpvG\nEpEYC03JOMye3wJQI4QlMkA5+Vjdrzq8bBtKeAJUrYoyekxd9O2on6lne4eT\nBsUz9nj6PJlUjqYtDoHfwmt6h0WHAD1XjbyVeOgPQYulGUMzP8R8bKMh3o+6\nV8fuwZN/WUYK9Y9H7gUsVvUkkO0/bPgCZUmZJDkDt8iqx84vcVWRlVGNTjXm\nxpA0\r\n=/c2T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDLz89jWXjOsoGWThYlkttp18ubGyJQW/BKZYVIbZWZVAiEA/AOlkGp8crFKly0abfy/eH8hMmTocTYTyjtIUzPX3gM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.064aaaac_1540569552796_0.09030372675553067"},"_hasShrinkwrap":false},"0.13.0-alpha.17b3de0c":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.17b3de0c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.17b3de0c","dist":{"shasum":"5fb1c5fa6439eb8e1d65e26d1d25a57051f9b738","integrity":"sha512-3Xm2npqtFKhiAdRNveb/qYIdwWA23HJQToqNJu2k4wCiswTpg48+tMR6z3RBBgW3pn0qRqzJj/RZidsqfemrSQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.17b3de0c.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb04VvCRA9TVsSAnZWagAAGv8P/jUqm9Wwpht78o0Ji2F6\nDIfW3c3fibrb6QQ4HdwpU0xJLi68bAGJ5eU3v+JM9frU69PQTT0uyCnBVlGg\nK4aDtcXIzbTAf3iw0DAa7H6Oy65doCxT0foiKCVD3w8mMMkS1aVwsXf+BzVv\nSe/s0I5c8u+ZsQw0cYQpozr4RBAtyMkqvVZAQqkl6jtn+71vLfjatmN638nc\nveNzL5S3WBcjC5bf3RfHV1DsMcDLV0UJVNl0oyc9ueRNSR8x86jK0YbhVzuq\nPnzr0eExFK/yuY9MXFZ/WgsGToo+TFYqjoxPZP8ha57uNtAJVcFIuN/NxFb0\nnT/HSglCLDsDz8gYwdChP1oew/YLM48Detu0W6S5pOms2uX0IL+thFfVeHpV\nmZvLWDZXmYZEUjWYP50wWL5kjblfaPYV8gnXIImydayeZr3NaLTKow+Xt918\nlxK3f5yiFOPaq0ODBtrt55l4Op2N66+voIc65H2FKefo/qXZ0X6eDAcznbWN\nx/LzvnX+GqE8ijMeZLUFiMdd+uXpSUtnhLn1YK7yBfc3CgqcutkGzTp0egdP\nQmfgDPtA2HmB96uOf1UAHYAnbyditm+75AMcuUanVUF71/ZwdOccpB8uTZFS\nOUZff9ieQAB51+6H8aWlKSxPCgoob8PxgTuMHeTvmbDpaBEqPRRPNJCTGExz\nisjC\r\n=eWMC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3pT5Lr6lP7vIWXvSiafo3nRA1n7b3rF9JQEAtBO2bjQIgaz/vQyC9TU+LdiDj6My0CokKZYgvQ4lM4QX2VyV3C6A="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.17b3de0c_1540588910351_0.1888321832104578"},"_hasShrinkwrap":false},"0.13.0-alpha.180a136b":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.180a136b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.180a136b","dist":{"shasum":"25b30fc139a95ecbe5e3bd322dec68619c626e9f","integrity":"sha512-bF9b7sA3arZrqb1eP0/AJHl0cAXIOPgZzxGDfVFjA7Ob4Lumi4FRMWwkmx58bxOa+rXlpaMiFTtLyprD2kAkoA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.180a136b.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb08WHCRA9TVsSAnZWagAAtdAP/2lgB++ygYMy7jKCIqWg\n9SUi1Vhr1KhU3RMrlOXhQ9avWeLgeDjk+s5pXRhn13eloVUXQideJUPhlei0\n60XphDBItXbFiteORKKniKHGdpPJF0WhqKddDQp6/VwZM2HG8swB53AkxYTJ\n12SrsE8MUlcxlS0o9vzilHuMBxmjYl+cOTg85kQWegcbtoDg7XaUHzuWJ57V\naixkRe2U2PINFWkHqyPXfpI3O5Euh/njM4MOiu2PnsAWuM+mTsBxUCk66dxl\nOyZMW35rdeEMFZcpnomK1aN6GydTgHyiLcAABdkJfsuVzN87vtGjeqc/L5xq\n1BS19XtnowBOKc64UA5XeVt5hSAkaPcfioFAwACPvRIaX/8JBjsS8/UaUwd/\nHbHZYir1Trjs6JctKpVlpDYa8zPPdB0pKvLMdy4a00P1idtWk5Ouq9rsyZv6\nGBIavg4BXcOqoRMylwMJ7z8n9aRzpXvNFjv5wtBPDmANTSb4miKN8dvsFRcV\nttT4ZnOjeEWskl5dTFwCMWNu5gQ8w9IPcG+uaGeFdS1K6iF8lSSfxWsffxh4\nNrIkFGbbtAAPKHGPmDNeZm+srfMImz1dNeRZE8SKgqultD/9Ppn8KID4odcf\nXEdVOgqqMiWsXbFFxfHfnbLKKbo5Oll6785idrEpgniD/W4CToG48R27vXuy\n8ch+\r\n=ORvu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnatq8hrsamVNlE+i8Ta7CLAktR+5a9PQ8H/aiFdrELgIhAMoBS3YiJp9AFb2UsZwvav7A1ch0uQQ+X8F8GnSeHIsH"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.180a136b_1540605318570_0.30698141487156416"},"_hasShrinkwrap":false},"0.13.0-alpha.ff7cf3bf":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.ff7cf3bf","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.ff7cf3bf","dist":{"shasum":"c78d8a76fa58788c4818ebb5de1af3dcddbdfb99","integrity":"sha512-quahhwHI5ejjFTEWl2Z/+wioKhrexczkrp3LCe3b+X8U3+2PXsNHpqKEsUa+na9vCdIH1c3ml4QxQNAiu+RaXA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.ff7cf3bf.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1Bg0CRA9TVsSAnZWagAATsEP/RExxV5c2ClYslYiH8N5\nZyT6lc4yH9pQW8qEoUf1ZSAtbiWiBK0Qg95xvJzgpZDpEfCsNV3XSWBurYtn\nGb2JTuuwXePqucO2IbIBeb9CKZeqZPV+UyV7mE2QDoivYpPvBgDF+cUAQTw2\nZGueznS58zbrJnidNpj1LbOA7lGNH5xCDcenHmKDQP+lwxwhkyux7l7/KReT\ndU5iJ0P2lzVCBLrKKRZ+AS7joNLP8h5AB2ZS2BqL1cGfnuSZpXTIK6IMztiV\nKYy4Y1kU3xUYrMfgd6lgqAvRPgJ9n9kE1CO8b2tMhYvQhGlfs4X3UGI7eiPr\n5zNUvkohuhTjoWVcXe48AKAuFuXIh5yzfv8c2HW+Xh5hnT7b+PdOxu1QZE/P\n7/J+KJobUNyUX2PU+voz52sSV0iREqi7MEgO6gAuxIFt60zFxDP8evCrChHo\npoJ6oDlFOTG/PoR1Aq/hEUKmzaPSqAbMs1TihnNYEwYBxz5/aGivvn7TfLuH\nf1Y56Rv9/nQhvNh6d7+u8hUi6eve9RCz8n4JlGxyT7DGRzoQd3li8P2Wnwoo\nhaPQh41frsGCkf6BgF29OYsF3fmbaLYwFLRRDLC6DJgFkQDI3ojj8OHYBYdX\nLQ930nbx2yy+xzQlc9/1Js4P6I8gi2HJeTnPoL/jU4oT5/WBhdqQWGlwnghz\n2eAd\r\n=oH1Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDRhGTpyTilI2XD3dhCH0CSHZGgHklDkZ2XjWZfIvSG4AiAfIbk8bxoZbERyGfLjJSmef3cBT65XUfnRLC/fXxWskA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.ff7cf3bf_1540626483641_0.44287619006324186"},"_hasShrinkwrap":false},"0.13.0-alpha.5df8f2b8":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.5df8f2b8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.5df8f2b8","dist":{"shasum":"1cf4c86ef664d456a0b9b7e678d644d4f857e052","integrity":"sha512-WWbQ2QLYe+XYqLtCyh8vM9R4YdxYa6qq1yu8wpKCCItuOrReJoKZ782rrGvcnjMmCMeH/E0cJ9N6qcnzAAXDiA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.5df8f2b8.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1C9uCRA9TVsSAnZWagAATAYP/jTFNkzUeKWMldrFUuV/\nmBHPPJQXMfYn1g/6D+uTivUmOgquuZMyMYRHRKihXLQyEh/0w0fdYYhTBbVG\nkzZzBYasHIWPuJQ0n0n03W1IGRbSoNojmn5g9i9YVp9MABUTDG5LDwuMsbyP\nVU5L7w1nW5V+NuLH3UQttkACoVwqUyFtpJHH/tI04PMmJ6f2kEHSy2mYkP6h\nP+0N3zGilNvwXAi/BJWsFbJf0drs3CL+ZsEhbM3YaqT0GzYJ+JCXCRMIR5em\nuCwbE1OrvbL/IykQjBkVpEBcG7l+f9iOupLwL1I7kNLmhMB8ESiL4QbEIkDC\nOP9zGqPPMJ5VTFY23zcpcyiZGcViJ6N83PyFfR4SHDl9x44x5ofiqBDb3YSc\nQgpVo2SlEaZ3gre1YUdle+ktoR5XSX2B//8k0otzPujbadp2Us0paBaBFXnL\n9M9axGStjn/pT59HKLLEWfcbydfsbuv7pvqO5AJKBWSQ1KULMqRrOH+bwuBf\nLcRM/zgznODQbnZObItqO9h5uWEFGdxQeSylHZBmwbcqFvqhsJTwMbjO+5t/\n4LxE4A7tZQYvn/SWHYJxqaj22UkRM+iTuT97o5lUFlL/XuR0laLUb7tmCYzH\nZgwXL9QC3NrdONLF22e7djv6OUmr3NS56PRVcchX/djayHakSl+XpKp4/r+6\nEOmN\r\n=K+bK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHs8bDU/jVcHQYJFJLs1pFch7JJ4FeeUL/Tt849gjRtjAiBL3D/rTGDPeA0YHodsYWvn/Ut5F8kPsH/yerXL1L15uA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.5df8f2b8_1540632429220_0.5106732760941557"},"_hasShrinkwrap":false},"0.13.0-alpha.7812c9f0":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.7812c9f0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.7812c9f0","dist":{"shasum":"d4dd70d048759ce8bef2a6365541eb5549cd9f7f","integrity":"sha512-0tcskicVKAAAgS5SAjFvKZRvQHxWi2kxaE7WqMc5VnAPOpkH76KFE5yiFN0JzQkW0l3+S6VtD4tobAuBDVv8yQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.7812c9f0.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1C9zCRA9TVsSAnZWagAAtzoP/RGU0NW1CwRsuHVT2g7z\n0sXHKPwuJbOSwVwZAsVkx4bZR1erAikViCgJYREwXR35+mIKsV2x/2Xng1BV\nvQdcLX6FGfMCVtt2vBrNfwS4uV62KDiDkBlmtG/tQehVd6bQY9g+Moim3PPj\nM0s5wCIVCm6+NUM8BjIA1AOzb8EwH62WuvtvRxYJOjAHl4NtvaY9FMgZzhP4\nES+qwTItBTO4u6r1xxSwqip33f+GIF6IGhZxd9egFuGj9caDB0odXEihWzpN\nMp8FIYfpKVdCEJweNgdVGByG93xoibFna957Ve7qNsazkYMbmu9n1gBKBf8U\n6L/EtGHD6Htvk6o/g2w9kTqqhLaKsOjdf0NBJkfmXiazMuPksp9Id4yRLg0p\nNZdkvCXqD2ftCtsBt58zsU8rAtVLNj+uN5AuJb7Np6W2/MKc4BHeYYFth9MR\nxXqI7T4c7E33EdkSC/IKyBhu/LrmejPSUiNGSAU9KEL3FxNdVBnC6GsiWWkV\nvF9bRz3c2DXdzK6s7zjXM72daNdT81wGML0+L2cqAZL7mJ/9aHe+zqrC/9OB\nQoHxNT0iDLqxclJKwyhu9BoZgLKfREry1sJk1iqW+EqiwiXdAHSitFMlHZhT\n2DP4bg9RIiJqwbHvYUyyT9l2YCgB2zqzJyaOs3VGaMEe8aGgKJWKw9XG/S2b\nNGqW\r\n=9NS5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA09bOEu6DzZg29Opvsy4v1uA2Z6MLH2Eu+L1C6vFTTyAiEA/mNqzNPA4X1goj2rFV2rNwcIC1d0EuJZXAKC14BVHdU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.7812c9f0_1540632433986_0.06827552818202953"},"_hasShrinkwrap":false},"0.13.0-alpha.1c25bcc3":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.1c25bcc3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.1c25bcc3","dist":{"shasum":"c06d22e0580a3c5710eafbdb5d74870e5b51ec77","integrity":"sha512-ZoTzLMu/Gy9WRQA1K3Dgf2b2hFF/tDBgBgkaoEtqV8Xtru9IEHc0k5XjTrc4p87kw0bU0KAvTTlx7IPCe8Hblw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.1c25bcc3.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1DZ3CRA9TVsSAnZWagAA3XoP/j1Fd2QXwHTUNvwZzN0A\nr+dqveKKN6vXTUXL8vxTvc3/j8trRUs0IkWmZGIi8wPqbBacwrP270aQfYvO\nJAnSQG1ftbiACtyUZM8hCsiC5LveexF+ea08dgTT+gceq5/o3/fXQCiUhNQa\n/Kv+UkbcOq5CCo91RTJl5rbseVeLwpMdSckRWPutgkK/MT+6KO4JP3cOsay2\n7F9w40ZE/0oKuEt0J3iBlH8dQXDfeVtDCWt9TyLiA6BBzJjj743meyvIAx2R\n6OjqajxxDTlAzvk9lEgK9I/drmw90/5u1Mal9fJtBszRP47ghH5Hf8N2zBV7\nFTWLYxzdo3iAVa9ymGT2o4ZtIYenJkm5L6uM5PQojSX9Q0m/V0dI+rKinZXg\ngNVT4U95XxZc7PNy4Vmwd0z0nk2edkmGN8cBt4IlOcvYoW5YJbA4AUURd0p0\n7lF/bg0FWVi+zmEkz57pyjExKV6SgOXiojo+4IkEhnod6s1HvWDB/7rf2pVy\nmtY1JvVIw1IQo/6AKx7sLaF8l0oXhC3HP1ooafJ13hAi1auX/vinHE3c/0sj\nc6ktjdrCt5DYWCXVcmbb86e8MNoJ039fsVZWU8GttUVQG2puABev2q4EbgCG\nkXF5iiSijKt6SAxdrpbqNZbNRt+rA2xXWGeUg3/2Ha1BoZLxOGWkSD1rnpML\nE+Ou\r\n=vGFd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBTK+O441izZ48f2AsIouw/OSYgC+Fl8vlCMRmbNC7j0AiEAwHRxpgRz0mUPTVzXe3tX79sINZ2Vm0u2hDXVKdZcJ2w="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.1c25bcc3_1540634230957_0.9390728177248491"},"_hasShrinkwrap":false},"0.13.0-alpha.f7a1fe33":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.f7a1fe33","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.f7a1fe33","dist":{"shasum":"295656479cb63a4237c8f936bfa0c418453e81d9","integrity":"sha512-RCTe1Bm4JsspFr+rnig3YpOYJ0l5RSiOKSWFMHvRp/PXJ7ZHjnqTKOmKVGLFVxc0deyqPUAcrVa72qqBzW+xGg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.f7a1fe33.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1DbhCRA9TVsSAnZWagAAQC4P/2KKIy2BWpWIFXJ4Ftg7\ng22zSFLv+Eg3VWiR9hYgVwYWSgRjvMZm4bt1W8Y4n38IX7yjj+PERiNWkRfj\nkcAouTzLD7oW7IeRTLgNuVL3VKEnGlkt3RMHASXy0vPhWaFBK5Dp9IVpAPbj\nYSJ/ZHQXDkUXX/0mpimGwOrg97dDpQbBSXrvqZPNWKaoRkviv0gb5o3Ccnkl\nae9kSUFpKWZuEUJA7iR4t3+i8fF2pHxR57ar9XrD/Vd8K6SWUqTDim1RzRqS\nC4Tbo5Mq9KbR0bNu4fevO/Gws6j5hNwEvl/oqkHWPt8QgsILBHSNdhJH+ji9\nkvpN1SULL45Pwz+dY+IwTFrdlNbaEbxgpKwq94gi+eOxIAtltlLb4cdt9nRp\nkoiGPbrFr911cWPc/1BGRxAIztu1c4KK+RiI0qpd5X2/RmQMHTUJq5BxNYX3\nR5bTWtwYLOTFyZKjus3BwXyckbobMoq/N2SuvulbGAIXxNaT7UDUr3aTn4GS\nN8TO64PKEWygp4XNeg8F/eX2WCYaqun1YNs+zB5uOue9UYG1LmF3apnvvedl\nFOCggRGvUfbYDY7f8G1u9UsMzFkpbngZ7rRwbgWG2xzfSQaRhDL+RF/1O0in\nLs3edbJGoCZgNdVljV5PWFyaxlUmsE7JzHtvp521typS3Q5cqSzxhyZciJ4b\ngX6X\r\n=gdd/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC51pwLPeKhtVT8jf4sYbhNVFHI8++rvoCe2+AUQhwt6AIhAMmDu9C5Osf8EMwRG0boyzkIQvOP99o8sktVU3HEknBN"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.f7a1fe33_1540634336890_0.03817074926269104"},"_hasShrinkwrap":false},"0.13.0-alpha.2b4b25ac":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.2b4b25ac","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.2b4b25ac","dist":{"shasum":"a967b30ff2a458967cd5320834e2b736ba86bd81","integrity":"sha512-4Bk2aXVnCg/zn+R9tebvk4osZYLjFXSeXm7ZDPYVnrBMrl0uePhR+ZwBQpHbOOF1xLM1ODc7IlSTmhoC8CJDDA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.2b4b25ac.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1KDXCRA9TVsSAnZWagAAk9cP/18BvQTAdo7w2u2CtvBM\n6SkKzw0+lsxtXvu6A3kjnJ9nV0u8GKbgkPrDoeiRHYPdKkpBjkJ9HROl7cfG\nUArr9xKkDa3saXcOZdgxPMRUvGXnySHTVDqSLFhJro1r8fybtuWSZYDM8aCl\nTGyn3GNTxfH64y2SO5MRD7G+B+NbftsJdVPgUH0aGfooACC04YxUOzPsTyY+\nmfHhW9hVQoE2U6U1834oD2gA+6Nw0jnolKGj1hpEtTU+wp8ejjGc2uOEQIHk\nTRQ4fKoR3lQCgHI628EVvPm2+OIrRq0EaltZmDTSrOJUwzWGxGYgqZH4gB4m\njLzGV2k3Vv6OF4AQie7Iv9+vO8gtAVNsy3h6LWTqVcAssbixmC9YaJoYbDug\n9e7GSdNm9qpsr/oYJIS0N95Lz3yL0kC3vsst14UF4e+ZLrkEtl0dfW6in0Xo\nDANsskceE7m6bUlOUsvLxwyx8nHkXZnt0KgfnmO5z+hc5obyrqldhYIBy4kr\n9NEHSBZS7TIN3/UAeY/mZtkJDxl75L5mQBP1hnh89h0dJEhvoidEGzzt1y16\nBv5qur4lGE+gheen1PDDW+6SKKcMOXOF3bOyF2TU36IcKL+P5+dj8T6zDqdZ\nSbK1+gNdzr6V3HUoW9f5GnKmt5PG2Vn/OnIMaOpzKIs/UezFC9SW16liqLgI\nCoZp\r\n=MR4g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDjgPFX8wwHCmwY5Xnq9RooSmOrLGsXbmbUfRVfPTDokAiAxtLsiNbgq9ZJoLw2LZTiL10HkozjiuFlIsMDqHuWMfQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.2b4b25ac_1540661462952_0.22461151383227862"},"_hasShrinkwrap":false},"0.13.0-alpha.dae974ff":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.dae974ff","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.dae974ff","dist":{"shasum":"9d8d2ccc16de6b4d37eeb820c57203a5d681ca7b","integrity":"sha512-FhOTD4AHkVDeiJBZWjamC3ciyAqZCik89tDF7IdYlkge5T7cXD2U4QJ+e+4iVWNSKRZNZmaTSoDG3F+jddISmA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.dae974ff.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1KGTCRA9TVsSAnZWagAAvb0QAJlNZj9MV0rVr6mD1bwW\nhTfLYhPZtqmt1UKc0U/uj42loekfp8lK4K8iQi9XuFzKpmpl2hx+YCYfttC8\nS45bGqn82/NoViV0ooVI8fvSK+sYWTFfphK7FAsOLda/Afn1Y2l9ROaMjci1\nIuvBptiA+wLq4tTVvZrJImBUtZbaGQB6ZsykmcIP0YeRfDyymAQ9M4URy3Su\ntc/xYqxVH7rSBMf64uP7Ayey9e5lD44sUb7UtsxUgY2i+HfVX9XTeHgnZm3r\nr28FZIncvWCfnHpKGaRtmaQvj+BRq40VMTxu/gPFSGxwrB52mPSw5qXVG1kb\nfGQgkody0Y3keA79091IuEh3cVkFJl4yzlwqiO/Mp0nJYZxnodhbTY3PUxL6\nc0m6riZAGTfdFOXPSfEJkyqu1j7ixQmbMSYO3JgzGLYbAnnEvZB5uDBfsb6Q\nEBq/TYbK6uLzyQ5aT3vQg5Fxr/wwS4xYE2gXMFGbDvrn84JX+PU7lSFQL88d\nquLC4+ATJLp9rFAEPS+3G2tyfHnBP3S/7uBKtBdK21tc6H6uJrOmptSLSkiH\n0lyAf8X2EZFpL6YwRNIT0pCGD+lJ+hPMbU4qfrOuC7IUhtvwQtITYKb7WgqJ\nxohgKrt2BVxRo+88uDtJrLmbV+/tT+gC1z0/Qn7GrpjNVgOGP0lojZvpKfQo\nTMUG\r\n=EUkj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB9fbjhXTofUsqEWi1fu3On0S9jWejeZQgom28xmsuezAiAsldajuaQTS59s5QkxBsJpwwSuUibjgjRe39GnVWe/bg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.dae974ff_1540661650669_0.4497549355389754"},"_hasShrinkwrap":false},"0.13.0-alpha.db7db7b5":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.db7db7b5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.db7db7b5","dist":{"shasum":"b46578acadb37c83f0998d0a183a66279331668a","integrity":"sha512-Xg1dGsSVCK7GEg5/RTGcUNvvO4HdJ1EjuD/gVhYM7RbUce8WtzHn2/D6swmCtMjHg/7rLr/Q2m27WsgcIGAn+g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.db7db7b5.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1KxyCRA9TVsSAnZWagAAQkQQAJySVmWpV2efzujTbsL6\nBM3q+wdZiaOgBLigmsl66gk/HtGBP8ZMZq9CNac6v550+mEcIXyGaRfdC9cZ\nXiN+DnERHIJ9yHRDEPAET5zU55cyRr+rWA3W+Pxyhlr5bOBx3bKy3Rkd8qlQ\nyXwg7X3y/QWJMyLXKTzDlgmb+J23xZR+vhNxos1QjxBqrDF9+znsuDjjGFIv\nG8KuX7FUGfvhUVjmQ0ofixnbRUpnTa/yAIith1LNpvXA/3nSt6idK+FgV6yN\nMFaa6UgUZn1tmIjIqnZ/afKdH+ym9VRhYWkMS/LStUhDnOktPfhJlSV/umOs\nC6MFqRtcThnvbHMBN2Dfx/zPr4hYBcDc8U90XVFQlbGRrAauILZmY+b340qo\n135ra34h3znDHn4TgFFk//DL25m3+6rZJFZpoZeRsP/ZxKP6BuHfj+d6xWPv\nogRiv8EK/N2MiEHY3pP/dttGmF9hHbN4d/hwUaRrEcpRFDcsCwMEyFsFmMZO\nNXOhz9jL76uGp5TMRbCO44GAWGQ/RlUDuUyRdk1lYyh6WVY2cbcEIi156L75\n7/gPRE9Qm39hhc9wZj1XBs2bvnbbksU3d1HKFNctGCQbKZQmHFlvsKEisVOM\nfq4Y/bWuF8j1ZzK1AwXfI8fgopL+Fq3evaBADNrCJq5NLtjpcIKU1QBJZ/zy\nYa4q\r\n=EUnM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDix4/dNbYOUCxHVgLcNxZRwclq01asX+btFt7YhkdV6QIhAP8xkXbB7s81T+J6ucmE6qK8WFyvHLdYEjY+/N9o9G1I"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.db7db7b5_1540664434097_0.9471901045321003"},"_hasShrinkwrap":false},"0.13.0-alpha.1036df2c":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.1036df2c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.1036df2c","dist":{"shasum":"5f504e8916c9ced5bfc6e8e5ea45d6cd4d81fb4f","integrity":"sha512-pbMPHD9Ywsn7fjFud2nrzNNUIjYIyrwfYrrE9to7v4+QjKzypC7suwsbBEr9brOJFrqLUPpJ+e2U7WdKAkJkRA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.1036df2c.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1K2+CRA9TVsSAnZWagAAANsP/2cVpqeg4bTVyNrtfep0\nS/9UrPGexTztQGFuE1OwlpNlNa5iTaVmqFS0EHJVnQtVs/s8nChW7Bx/Wzc4\nvc5jc50wySzBP/67NcPYKet15nKzelnmmFCaozMQNj9bb5jivsqvvtem//VN\nkhEwwLldrzW3RQam510YiwY4OS74oL+h1eqcada7+dM59cDaFtq8vMkv/uUj\nM0Tb+622DkV7Je2VSmdiInKqQCWOmAvcJTFRkBttqXO/+867sFOqiUpNAFHr\ntCbxLqbxa6fMxrPO9HWDxq75x1xD59D1uvrsmG4D0N3JOHo9tVsB8TSmWc/H\nedf9Pb9z1JExTuSGEFGNG3/FI+ezj3ppBbrkVzxFqL190QFhtHnNg1t1bsQb\nEt6gODAvt1kDw0O8F9+0hPIzZBo/H7bbavW6dyIEspBbQF7rdFxqQnwgunhD\nOJO+3ATwEFqMIG8ZXPOeX0CTEPP9jKgyqZA56Pqyv3NIKcX3e1sXATfM+ghf\nUu59HqQiqi17zYGNcYB/wWJLUo4YjVSlIesZjYCo2UJUcvkQh2tnyVIltkRU\nAgtz/McX9F+ebeibTMxuabvfLgMf6IDF/1JdL0jeF515mHkITvVAzk9aC2gM\nDsf4VkXvQHi8eti4HiMSahNFFxwiQxVipHGhcePnabkeUbWmUYjOWf6Oz8VS\nVz3x\r\n=JrCG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCorcx7S1woThT4wkilF9r6fMOjgeSVjMnNJM+lDlU82gIhALnqvrok98gWcfF6716rerYVAdaupukjFXn7ZjsoaSVV"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.1036df2c_1540664766035_0.6516094623786719"},"_hasShrinkwrap":false},"0.13.0-alpha.a5a7962f":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.a5a7962f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.a5a7962f","dist":{"shasum":"7f795ff2c0d0b13243c18847c8aaa4b230aef467","integrity":"sha512-GUh5ApG04KfMUYxbmV+mr90UmwhEGZb7IG2yXoereDbjBiTEb2z8nABqTxLT/222iiACsNHj+XYeOijrkn9A1g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.a5a7962f.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1LWrCRA9TVsSAnZWagAA3SkQAKEEfsVoY+20XeUGFE56\n0MFgi5n+jKl88RL8eEzsz9AgFdrQs4zANutOM+6SwApYzxh09jwAd8aGBodW\nTXCIbSaxScMQCeCoQjh8kpb0sQZAkdx4pCYcNRbG6kfukPyo0nyBPsa/bcqj\nuudKv2yGXlOatAsOAwWfOB10AObI7fYzdqxdrZ9al0KgPfWbZ6vUA6f/as/e\nt5cRFIRKmIOHDusIVAF8LShkd+p8pkPOpNQMnp5kQpMkkAiH9jFsTfnjW5Jo\nvxzTlXnF7AITB/KspE8lEFQGotMDbGa1VVonyKUabkxPrYjRcTwHS9WDmTo4\nBGJTvf7nZlMDvVG8zs9Zqn4+4M7DISTjNwu+b7+9GbtgmbGRr0dG8IizOTTb\ngGkM3tUamsemNqocdSjWVSoeVHkp92OQJ3ahsWOJuzGdtz0CDA73SW7cxGt5\nKXbH0ye3LXeIzFzxkdHfC3sB1cH1cuUSlGkPQh1O2Y5O0YNeCo611Y+x94p0\nwDrqFAWAIkTf1OUw6iwTwJ38fzqSyfdhwc6OMGcKvkykwREV7RsBWFggVE9/\nzGwAKFZ53KMgaJlHO+2AYwFxKAtGqPbH+e6BtRukSIkA91KRs0MA9E25iswb\n7YTA3Pl1bu9cJ8D+nRjHi0AOebDrvX/Ja7zY3Br7WU90OjKP3Qts0S3xj1yd\npiAm\r\n=YXKJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEeLDkrWZBafsL1pKkVyXfXt4WWayDUTdzH09SX88oYyAiAmHDvjjpMtkq6xdW8QZfnNQWLoU7CvetH4CQ8mzHGLEQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.a5a7962f_1540666794585_0.4372656583370169"},"_hasShrinkwrap":false},"0.13.0-alpha.8dba4aeb":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.8dba4aeb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.8dba4aeb","dist":{"shasum":"4260b36fc537e05160a9e07583fb4a1283aa1286","integrity":"sha512-tT9nsVnHJf4yg6+vssS8BYiDei8f1O2aLzNmgUVwP/rTxFnc08qUTf3sv0Oe5tfKvKis+j7WzZcDRD1xrifpNw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.8dba4aeb.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1Lg7CRA9TVsSAnZWagAA30EP/3vXi1hImeLaD2x68hBv\n8Gt7E0GKXM0LzU6YEsIx1JxS2f5V/3H4HvmUQlR+QEUiak3DbPh3TizSLmHG\nBRWUrVucROwk7JxYdIxyXUgtmlZ/hQ9PAtMImCyxDLRomOMN0B4WpmtpGCpF\nCO7nwGuQrdtV6YV/K9DeVQW+wcwbkJwpYgc1A6D1cwPaFmMvPblD48+z4owC\nFGnOWp/7UHoYvcdoQow2icwEOQQs1Zxhs/epCfECuq2xKTjUMXFpvlXMLqKe\nJ8fhPmQCvBu0eySp6K1/SyB/vftQBp0mQ5xdVWg8qI4Sp74UCSNcYwLWJHb3\nJe+UeEWxkkIfF0T5ylxfJmzYgFJcddtaYVWNf8N6G3JBeepFEYVilOUCngpq\n6w0MscYemb2hplR7gaOTA//Tfm3WQwajMeajyYIJaG4Wvk56S118lGZgVW6c\nITi+v4o9Bp1j0hgpUlqlImCFA+FoaKRx82fIVz0jMQBJ/trXlkKHMivgu9hA\nYkuFSJzP8GihIPESoz+nYt3Tdibaosrs1lp/6MdVzHisQeTwfTnOoblmh90y\nh8HDnIQxDFBqiwJC2DZmlrPGD7ezsgfhQf2Utu3pRg2ZxmVWZitRfDAY4d6Q\nfY0BqeLh5mGaIGEFJJj6KoF4LIHytXmyh6wLgwNbaMpOJvDnzm1Qu4g74DQv\nrsQA\r\n=oDhH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjD+2pQwqeKbFMcs3QKp5dODw2ed5WrrZIv3x/rDDbNQIgTnlGv5u4SPDZ1xolR7Du+wHWCaDXI7ksem0YTplPecE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.8dba4aeb_1540667450564_0.4973953895485088"},"_hasShrinkwrap":false},"0.13.0-alpha.75065061":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.75065061","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.75065061","dist":{"shasum":"ea76c48ff4024c1cd6f38686cc688d657f27374f","integrity":"sha512-c4kXxDY1tYvsygBQiJCxUpkyozcwt/lrVwD3Ct1gpGQLEOOcMEKD5C0wHJ1km51v2f3l4KkBF69stcnKH/lOwg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.75065061.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1LjaCRA9TVsSAnZWagAA+UsP/14Wl1+xMl/dv+qnQOui\navynqvl+kz67SyJxu/uzEoaFYfLGCpwKS6TdAgJ6Hv13Un68swVZPnJ3ZKHt\nJ7ToEkWc5HBG1JLKKph9Cr2hYpNyjl9+In9xJl7JY0v9obK7hlkxyeeKBJq5\nvM8P4TnsPCQNw+2ccD66tkki3WIcvIUJ/GxETR5zlj0dQpARlCKIZ0qwoZKZ\nYGfsd4Xflm8I2ySBk7A8OPWDaj4gp0rjfY1dmAsUX3fScnUBpBfxI7MU+Scw\nPq0kfLxwiWZONlVWHFwPAX9BEIMAX3Gy8KFdAd1qJehF71uzelPuEjAOgf6t\nqjbbPPd+R8RX4c5fDFeFkFHNihu1jlp4We915DEmDG4F97sBTxo/4y7QlNg0\nhnUFvAlDUdW+8ARdeZX/qILgApgev3fREW4bvfpXdL9426Dapxo2UiGOc7xv\nbnKw1ho/VmM3NObzHFmJYz35YDHl7j8OnzYKFNV7AzZWk/LxyW4abL/E86rV\ncOYFlwC0ZRP/2U3v8XWFwTHtjIWIN78O5TquRtT721VKKRIGQ2cgZ0V5jLe6\nNBwm1ASqNETgmnhVUrB6QHuHPlefV7v7DlTscIYOhSBFzYI79Mheuq/fxYMe\n7de7PS0kqdXYBwOMHqFeE3GeDIH+qvtKZoPItPEF7jwHw2bj/NgQVtZqBtAQ\nNEer\r\n=yvLQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBKO13VLZWsseeVGp/1cCtErSGbiHaM3Xe31gSoPTrQGAiB/bHUayoasQ8eCP8bxsGNwhPm6r1T2c3nmGHa4chWtCw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.75065061_1540667609263_0.943911950213677"},"_hasShrinkwrap":false},"0.13.0-alpha.053963c9":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.053963c9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.053963c9","dist":{"shasum":"543425dc72f28409b007d12f7e4675fd10037d0a","integrity":"sha512-rxlcRnll7p0JzCOOsIYk1KYqzw4booq34qhETvgbE+HCIXwEw0wCJu8cMsrrZz5DeNokmuXzbPzX6q7oAlKpjA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.053963c9.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1N9OCRA9TVsSAnZWagAARuUP/2LGKeOssofrpaihnWzN\nishgLOI40xkIhLHGYDDbocRdGu9+y5cN7Qne46Z3IhZ4jH3A7zttI1BwxqSd\n6bkxVIc+VAy20sWB2GBO2lB//PXuoaoxxhgiCploRr84d5E4PHLKzlDRHSes\nYd+j/zsrL+Yi/lPooeirTvvm63vbHJ8WGEdYlnVVrtLBarQxSBhd2PdHTGnp\nJOUxBKWpV68siXpAmKwlRXJtQ53MBdWxF9ykbNJCDQa5Odr2Vr/fxELYLY75\nlya2OV7RA0Fpg2fSmITVMRE9Gu7sp2F2WHIEYu8imAbfCq3+t6biAcw+XauL\nZJHFLHL/hEQ3wQ7H0tupGO43ru5OfSAyYneVg9S9CTILHyrf89/txwjHhyiU\nVbkf6us1W/EhtKX5dbDNEv8PkF5lvx6sGZ87t3nxRcSjhQJF3bMkgbqIxF+3\ngovhWHWjgiPsVjYBOI6KwSfACJP3D7rY2s2fdbnDY9tg8voJhOraShjv2uL0\noJDW6urBcJ51ikXtIFNMleNQpMZpkdNBCkahFb+xxhhd+11K5JwXXJ8zXfQH\nddr+jer/Ho8NtgslKIp/NZD9A0344GIuyVbQitnk6q1IuFlQrm3A3XghDI26\nlS2sXAnGgC2R9yRt6qmiae3qO8Guzrs5CYnO3HqTrNWLTxw3OBakkPIK23/C\nw2Ax\r\n=tGa9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICqRiDCfcKMHmEByeT9i0oHSM6k5vVXAJCpquxzU+GpZAiEApbj3RnNjZK3R0fvsK3/O7mW0lL9/mSVQ1yKJL3YzDnk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.053963c9_1540677453335_0.31128114127571016"},"_hasShrinkwrap":false},"0.13.0-alpha.a8fa20a9":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.a8fa20a9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.a8fa20a9","dist":{"shasum":"5a26bf8f4a22b2efa97117bc2f8c6ec9d8e2de5e","integrity":"sha512-JX7oxqNbsxN0a75wUPbfmP7/z2bgBzaSKFEITp59awe4bvP5Bc0jKRAd4OJBVTMZOBgKW45R7Te4UV5duDH09Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.a8fa20a9.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1bH0CRA9TVsSAnZWagAAFjUP/0A6x9UjIOlngUlwn3zK\nK2MiRD0odLhHAWhGbIMGmiO8QUZCjZHhF9VcKid/3krPnbm7+VTJGSTreogM\nCR3+2kNqCQiFLysEvpHpyrFsydpdbfJqaNwjCriadqQ5cTvpGyfV7ltjjlRw\n6LVtCZ10n7fJjZJDlb+UeW3diFSnsPtjb3/n0VOU5zYcDmTbX6Ds3sCSa2ls\neDb93X5K/qofL1Xa/SxgqBomLAuc2TcJSBRVeRgAimHaiUsLOKKNqVxwODMO\n8Pc6pEyMxi6oL9223ICZLvU5VAYj0X0MnjB5KsDApQ31GsMZ+bNzzp7fAzDO\nP0zXk41cHpctjt544VNfTOy82J3aYuUTw04GBk90B+cwnspjWJwAQ29EWZgR\nN+tbSaRpBhQFmk4iWKNeWEEOTqCUqfBtvhFdaGCeJW/kShzsp5xBLwkMaAze\n1XuRBaFpQG4G6YJZOgl6T88HCUDnlSEPRMZ5OwgdfsdQ0VnCeCc1D5DIwLuL\n1CaykBqWiv4d4Xv4JKORfnx1zX1ZiZ6VM1FRv4ZHtB9iFUXgGgZ3s6LOEtRO\nAvHOxrcxkjlQrpTeUSm+uWLpw3OSeWQUNg8R0kC0nSTsyuBWevuq6QPBEzv3\n2EQs/4/SHsuXf9nfD6nQSNNbTptzU3E8v2IiOvmeMbW8uNXOq8kk8MSqnlS/\nb9qx\r\n=17zc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFTIYxtBz8iIQJXf30UqTfxvHZXSwL7im1ZDkjnmFHifAiAorJpt5T6v9u+TAPqU7iM02vKJXtEha+gs4CwIzOpn0Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.a8fa20a9_1540731379540_0.9844677715137002"},"_hasShrinkwrap":false},"0.13.0-alpha.96742667":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.96742667","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.96742667","dist":{"shasum":"61940d9bcc7f63eab63f733dca01cd46a2de8ce0","integrity":"sha512-pLFE98lJ/x7WE/AsDNxzY3pshZKu2Cz5qQugvO552QJfCjI2y6VpNqZat5RbpZCRsc+tTll9QOz6Nu1FXqfEWw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.96742667.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1dwaCRA9TVsSAnZWagAAODoP/1NRBtCBdVqrhPi2m7XD\np8akAyqpTj/CC7A2/dm3gyaBe8+5Esltv8OFU64tevW1irApOHH9yoxx1RGf\nkvByHEgS34Fhc2eyM5NImHswYxh+kkfb3wRxNG8f4Xjuvv/uRBUyL/aLi5eH\n+CFdWvk7aj0LS001GbOaqK0WvVPTLnXX1I7ZLBDp+Plo3TejPiRMv+RCZWf5\np5uZKJNbw2x5yWn7tU0TaORGa9RnsfYxQtBgD7BfvKXNgNTcpVOfOYNVoHCO\n3+rpL1EdPA/egZs5uLLy2Qgwxko9bhSn/PGkgitiF7ZjDRQmeHzF76xkAj6p\nNvjQEwIFLM9Tv4PZqVjx3hoZbuc6Klvw65/IyulKRWxWfCVIk0sHf7c/WxSh\n+va5JPn5tU1eJ1Bb53D2z1ejKq1bk6CLMlcJ5Lu3bTYUXrwJtS/cnXuV58a4\nMdWpSK5UA7uMPHRg31jqaioH6sgJIDKgfPpWX6raz7frO881dGw11rIrFyOK\nCCBjFcax/3J9VCzUo/HmMzvv1pYTwPEhp4d5k6QPeYKjQKpQnMFxy8VEnqEj\nedmspNvmH6wpk18txc9uDWuMT45T6VGjMPuxd5J5Jj3WTCTGSleQ10rfTRvP\nMWt1PbkJGIHVE1lqKYOktRjnjaQvodYJN8lcOa/4UQo+GJClHK0EV7x1wL4f\nxAgI\r\n=0urU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8WgYBMeFvc4ag3a+LjPXlTkerrRa2+nTyi7z6CCw9/AIhAKtZ0C+jL7/hDu2WZ6ik5A+dFXrRXv5nC2GdUmmKYxfg"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.96742667_1540742169587_0.5945641247272226"},"_hasShrinkwrap":false},"0.13.0-alpha.41be2362":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.41be2362","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.41be2362","dist":{"shasum":"c261998f54556df212d74069a8e2abd26bb105fa","integrity":"sha512-yf72hPwTDHjbvTXkGWJP66tn0M0aT5lUq2pt83hK6+PpUvZxS7Sp/1wHiMeIr9LkZHkweJsh/lOL9sNAzksbxw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.41be2362.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1uEvCRA9TVsSAnZWagAAwUcQAJT6TjGuI8MZwnQtXDgF\ngQlyjp03FM3qHxREBv0UWguv9naHRZyyWA4v2/U80qbHEO5TICAZ1vxQpitZ\no+/2fqCc4ZelO2uPuATf4TIt2VmJOwSw7nuh8vMu2evjeUmcxvIm3yg8jZ4n\nlmE5/lWrO7m8aAkEL+YB7vaJGunUu6JH5bgI9I/oypT12UBFcAOghhezmW47\nrUxkgps/CCUd4mX7zs4TXmRnDKMifu917FxM+c7ZJ8QsrehIQdHCLCLZc1KF\n7KexDxy4oaXPU8CazgUHbvbfKY6jOrw9QvpV6HWqft1h4CTubfvt3bubOfbZ\nHXD6bRFW60DTcJBQoddqN7p9qkrQVb5u0P3UEQ38azZx7+pu/IDJcfuIcXWZ\nRpJP8RZST90dZHVE+f+I56W6QqgdhoyJN3LzBxPtOv2XcFski4MSvEqAXFFL\nwJG4DaU6MZgRTOXJ4EwDtamzNf5xoAXfCTBhbdGezP3rLIkArUTLnCSek514\n4RoBvGpuH3xRiFiOFCshj6WOM1C8FzVbS7vFU7toWdyMeziUOavUpDXVleGh\n3vLkqt4gXQk9zXek3vdgONJ8gYcDcxPFL/nXCAPfH4apfe3cvB0uRdHCXRQy\nmoQzvTYBfLpVPz5wdvzxBA0cTDVsZzUUJTxUZywhipnJHJWkURKsDKWU97aU\nlTSl\r\n=/NBU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLmsvva8Hk07cpMK3YAUeeYadRqJpfuPpOYefiA83MfgIgFpHEH6nbcXNgcniH8TL8bJMENkaXBAvNR9Kd4NT1CTM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.41be2362_1540809007264_0.1817021657582989"},"_hasShrinkwrap":false},"0.13.0-alpha.9a8a0654":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.9a8a0654","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.9a8a0654","dist":{"shasum":"574b08fd5f21e1d2da9fb1dd0cba9c8944a50cc8","integrity":"sha512-WN+/iQYCyZ3Nh/Y52ObjII1BCk/moQuWDEvs2wY5LqhhssuRS+wdtB2sNPisafPrDsWYYGnBdudZGTcO9ZzOWg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.9a8a0654.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1uIwCRA9TVsSAnZWagAAz4wQAJKMTn3oSTYhBf7RNTtl\n9oLcvPCqZLbeuCRoHvuuvNj9LNI4c6U4JDVIITP5A8Tyq4kdr0vyWLsvpCg1\nJfXCPrnc32h7GWOfkXxg9BLsDNBAN4xe589W3aBPltFf+lulZv12irUDxvRX\nnsuIBZfP3tf5lC8LTX+vuxw1TmXdMm64Hh5KcrfOoqou/6+w+5ZfQj77vhO5\niu6QEZ2B67NJ5u8O89PzMhdTo6brCW1CnN0XaALS24Xs3DjZlnpiI1hzfzpb\nc7WtqJVL17138G8gKluHhIPXp6N7T5jbH3I3t4jsbtwzaKsJIbnoZlHWin1J\np5LZPKiMhtQyu2mcZc0OuJNA4ExqPmrdWHCwkNShKZ9eKXpPNHbc9vdELsH8\nsfz3/pVBi1WB85CbFlU3WPBI1MSi4C7I4d0LU5dv/PnLabv3kvNmGrRQa31P\nlzFjoXUZCSly9JwsMnWclIWDWjIdujoZx0Y0de0r/KyG/D3NIdNxVSip1oXj\n0Dk1+DedpTnUdBtybb5kJ1V5S5kmXyQvrtvqqljD7bwF4zpZtTUK1UHg8xbu\nBc7dhgOtwVJATRcYJx85Irm/CkFI6hIllbgrCf/N+LuDb+VNni2x88tGicET\noeOezyiU0ecSYRfZOr95AROwop2z6FSjRQghNZKfwwT5dFN4b9x3nQP+0wR6\nist8\r\n=mcT1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCaPuftvHkVXg/VogONmTgs1LhpZiIdxNlLpy89qRcJxgIhAPtjUdCmEj1dvcQV2pdFMGE/+Sxc3cedg6haydsOgehE"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.9a8a0654_1540809263805_0.47594029051069"},"_hasShrinkwrap":false},"0.13.0-alpha.f6ccc34c":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.f6ccc34c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.f6ccc34c","dist":{"shasum":"2849aef05a587cc0a435da427ebe8adfb623af8e","integrity":"sha512-K5MrWLomDGyL5sUgbntFXBj0XLBTtDKFxgcuWsBaWkTx5yB4Az8FhaqltYKgK7lzlnUhqAuSbeD8g+gMtNtclA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.f6ccc34c.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1uNWCRA9TVsSAnZWagAAUfsP/ihbwL89QC2boluNbAW5\nELU4F3OlvFjPvZMIaO0dUF9QWVydKgWXtn+bzDglPyFWXjYnjTJQ6zB9E6Vb\nVhBckXvzQecGhDVGRIeMuwI5XxLU1okCaZ8zUjpiHJ146Cy5+XBzXtL3uXCZ\ngHwBtOqdbq4b32Wc7z8Zo3SrPsjBx8pFxYsBTGlFxukcZSkG/NMZfr1L/ucV\n0vB5xv9tIFJc7e5H+1G4F6NCpMVK0iBChpi/XPmqT+DsrwY1QD6/gmnzYelz\nr39ADnQAxw+K2pO1VIc+rYcszv29HUpSLJMcheCYwemNG3IGPF5Y56rgliSj\ngi0aSXmK2WhgkVZOaieYSKxS6vFp2T2pkiJUzJqEiLGi/72nZI2ncw6Z/JGe\nP/cq838e3le8GoavwBM7HEkNS+w37Wj1v98TLejW29cK6d6uezB0Wrq1nogx\nAdWxPED4kAf8ZVZ1+SahPy4SPNaq26Guhpg/guyR59VhDgMFGo3GIanSoltC\nNV7q/OwCTUdD82eeW8aCRHdFvp5tZVoxCRdma4hktKsI81UEBO3hzbGCYvuS\nQAknQjfhpMuYi39OQso3A43vGxJ1ujn/wUIYcULsACu2RiegJPr4BzbHbx/P\n3OuNG3hBXiZTHC7G/XmcHz5PMfDc63VDdIDmGUhx6aASzQAmDOL3GZGvPeTX\n6IoT\r\n=sxws\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7uc48yREmXmUjUUn9NtdvFcvq9zc/XrXEpm8PSNTDmAIhAPwhaGHnvYL5QKtmg3Pqpt0HQB4zakLSUmzn7mgN908m"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.f6ccc34c_1540809557906_0.2765791863552576"},"_hasShrinkwrap":false},"0.13.0-alpha.42376d8c":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.42376d8c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.42376d8c","dist":{"shasum":"036369c4a67ef0005e428daaa0a28dab7fe8f1d7","integrity":"sha512-gcevmgJsHmmOQGXQKpL9sUqA8FejHaufky/1cpGzfDS9KV57vVuiz3SEo6zofN31pHCroBXg9ecImep7s28ShA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.42376d8c.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1uQcCRA9TVsSAnZWagAAjUcQAJor9q9CICSvcRxH5TfX\nrQDcH09Pck/iS3Ak+QdcxJ+uUOQ4la61h92WwGg9tCFi+cf3Wr0b6IuUpnyo\nr9Np7vrKcUl5G8+DP6o71+SZsJ+xeYS/fz3TEuK7nCvcEr31H8CjLGZU0CDe\nVZf+pNw9UR4VNR3juP+8u1rNuiDDI5+xP5it8rDeNtb8xNG564IsuNR57QGz\nwZQHLulGYUUnPxHq7H6uPcvyuEfMDUlAkZ63Ssao5FdKv3fKIyPjSd7Gryuu\ny6Ri+yK5mGoUKj7f6EmYnK1PPq34VPQ4wAv8xeN7bjpTVpOyHu9tGZ5wLnjc\nugwSVGHAwOji2dAJm3U0okf9dBM2rNOAqjKpbHn1D2ayazFan8AP4luJ882N\ntwPyZldQyr1gAO2CyHoFeuduwntszdDZxnQPp02j6TUOHudZryRG3S4Nknt2\nh0BHiCQICj5RCEUPCps0gAwpuf6RDo0gaT92tnh6IsH1vNM7Kyx/b9ul8q/v\ntAk5Lqwjj3qJvZ9wNtvlkyFGpaF1XRCCaKgQCpRT0PeCFJmB7VKxwftRhalT\ngsAia4zujM07XYCYtug0YeojZpdj/Ou57s4yWXEJi7w2vSK4iNKnDQ7w2rs8\nDJaspA1mhDAJ9ksHM/nMENQVvLMxq8DK9JfOFt6pAscNsL+nQ03rwA3LxEcr\nEnma\r\n=t7oa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE1Xc6V8G1W7xaPdK779LBS35c+4Cyb5JCSZ2jUfdrkDAiAgfL8i5dxs1nXsQmJ38IJY920n4SrCQR21hUQOo4CTpg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.42376d8c_1540809755961_0.8989585163083453"},"_hasShrinkwrap":false},"0.13.0-alpha.68753636":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.68753636","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.68753636","dist":{"shasum":"37ffa9805bf3cbf4ba3934e0243299b5bb3cef15","integrity":"sha512-9m+pqsjAGAqhLD/OImUD2/eKMZanjaRWO2zxmevYAaBKdVpbJK9zCCl89W4sDdF8xEru+IL6EmwfrS9cY9uqCQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.68753636.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1yrXCRA9TVsSAnZWagAAlEUP/jkdRSiKFwy7m4euQ64d\n1tUnWGDj/Y/j51/ShHf4LZ0IMnRh/tZUVeCozpqwy4Bh+4sLYUFkxFz8MRDX\nEPk6+Y7K79jXQ01Z6hbPTF9OOvJ+mroobQr7V/GjBsXjQI1IhqH7Rf7NtrFi\nPFDasJ6PkoshpIabXnF0w0DRTruf4h1bXrL52ECg4V8ncEHFgEtygUbXIZgC\nCdWDWsnxGQ3EzqeFStsmJ/OpnRxNnP6o4/Gy4frBkTOgAOwG9VAgsBXrMSXP\nbA//I2k8qxpjRxExNfHDTfYlPsoMLqVxxmVTwvNKh0UBQf3QRhesb+ovBCHT\nZbhAt3hnoMOrbN6HPq5xSGmW0pnlZusz2HJvJBz88jm1KowOG7DnVisFG0ZD\nR/J2xPNg02W3hYNVsk70OCAF9sZxbzN7Fw9R3I+4QKneOaJkiA6zEneTrArr\nwatGTey/iWLijuBVyFtBP1EU6s02PeEbhgDwaKrVqEB2Wpbry/2yultmfvVQ\nQuOUHrx0PQiX8aCwPYbypLadoyAe6Xr+Pi/Zr+hhfPLbtODmmOQeZ7BpoxUP\n5lpKZhFshBnMN6lyVZUsYsRjA/Km5BzrbzxwqIfvsHmEI6Aptepgr0u+X8R8\n7I3Up65NiBB87lhoJu8WW7FHqIZQRidBxQU6Pf/QReWsnf/gQWp4ANjZJ4JW\ny+j6\r\n=hBId\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAIPrf6M+K9ShWEgOOgfmg6pHDZWJn1RaepRleDQG8WpAiB9nM6gcjMCd85aWEtZr+ts4LAyiSLuKxa8x8L2FWhXlw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.68753636_1540827862828_0.622750814475743"},"_hasShrinkwrap":false},"0.13.0-alpha.e54c047f":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.e54c047f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.e54c047f","dist":{"shasum":"eaab93829e87966075b03c84794836a3517511de","integrity":"sha512-60HClJ3fDISTFvzOZpxQBv9YFwHH1aHAyj3k47Fr8J0j7T5NxUOyjWRIdKkHlPxEFd8FWZ4D6X+nm/zVBpg2bQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.e54c047f.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb10NJCRA9TVsSAnZWagAAJ8QP/AyIUOa5U7cSiJMyyywL\nf2pCcK5dq4M65NAe53vOCiyCF7BFx1k3fHm/2miFY8jz515NrkVA4KdDWi1v\nY9kRlDPXYo1XilHjc6+afzO3BAQx2BCEOpZEWBi0E2j+olbE3YZNnZuDVLQb\nWpHvHXo8AwrhSEK/1Vzl004x4pAnq8TtTsW9YjlJKTCwm0xToqfTiJnbrW0F\n8t/a0PMlCjyTUXYar4WZXBi0NjEH3c0tPdX66IB5FpKDYsY0VnsVckXA+Mzh\ncwvHccbGd8EXbfXnq+Vnl+J/0YuDDmZgN4Lb3/etQkvP6NYBqvEScAyRzdmO\nDVM5GXY82uP4hxQKR5x4XTWUPXDyRx5UYLgXBzIbju1vSNWmQLnKxsswm6OO\nuu/nWRFW+s6rawKfLUk8oogOvOy+z5gSkJaoFW7wS5kSTMLsIdFqJbBvpw4e\nWQwpIrnShzg8lSHhK31pikq+evtq3rDS12o75OdIvaMj5+Feverhec4PF3sX\nE5INHcNj+9KB6R5F1dojtz9v94gKUb3MvGeUCPB5r/5ESb22aFVAj+z77Thf\nWJgOZXff2Li+wZiUl+oK40Ho/VIpJsfrUESbHXsV+ttmRHEMKbvIKos1hWCM\nH0MvxXSrjyQDzRa/XHU2uSozFnQZznXJwCzNncXyMit3OoA6As29oN/k67cZ\niMCH\r\n=7y7A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDy6i0f77roGYEE914v5JRZxJtqYFv2BvcFyvscshcXOAIgeSibf6m7Q01GeUU+6qsU95XIZrgWskqgaZm2NvtKI/4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.e54c047f_1540834120093_0.19994988842736183"},"_hasShrinkwrap":false},"0.13.0-alpha.4bf4aa96":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.4bf4aa96","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.4bf4aa96","dist":{"shasum":"bb9939ed44e75c28aa83427e76862aedeb20ca67","integrity":"sha512-U0wYsyBPm58Ndq5CFULeHCe/TKdmMRiaolBKbPzNs9t1JOPm4twvtv63ZK3HcjpFQO5MVEPoSNovd4Wm/1jcuA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.4bf4aa96.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb10pZCRA9TVsSAnZWagAACroQAJ1KNYjmpznVQBFxRsCQ\ncUiUVK9TrEGSNLAsccZhH30mMsljmGVyqAZnyW2jq6M5x5rAQwkAMKdIokFT\njoBZRHsayHQUeC9lZuIORe+3xNTobsgNpuxTzaoDosVFD0D+NEuBEjed5ZFg\nx+lpacoaJDKvW/+qIQkfS7lDwGiZlGC9+wrSQTZ1AnSMi3jTN02XzHD/+YR7\nczoPs1nic/y+aK0LBeTuHf1+0rXxMj/6y0iquHao5K8qNGJj3m2stgrcgL7H\nCxEyAWQCndanQsPv1ZX8YNVquJMCQBoIpyau29QDmGKkInDsiU6QoWU2OJq5\nEx408ic0iqUVdpoC0DcadydowtotnSGGp8kC9p1poksQ6CzuK72AB+VQte0/\nA7LF68jKcNUUMHVf/kp8rSd2qvIl1EiwndxJvIJyATCcxcTs3EWLh+KKgtwy\n8Vr9iUDbb2irPtVxq7lx7c/q9AVXnScA4/AcjTITwJXL4covuVHVgim3Ke8T\n3npcVK6mWp7/CKcy40I7kzFH4pmVK6fzjKTeEozKLgSz1im2ZCrSypQeOG44\n1VZOq0vO/uFvtGnopLGju1feBM7PMETEq0MqKwQY8K1qlOUCYL3XefSSEYvJ\nrN3SU6h9OXzjNszvTSFp+N8u3YUnxfVj9rIC4F3QWZE01fSbJ6xO4w8o94CL\n7oeC\r\n=rQwT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDXzwKkmh8ANpvhFvsjCY8s1LAu5DPBqA/dUg139vvwwAiEA+VEbUYeJL6vwo5t56bYgR/QarRzd+ovWYfWLLPaaMkg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.4bf4aa96_1540835928195_0.3882068646440122"},"_hasShrinkwrap":false},"0.13.0-alpha.13cefbdd":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.13cefbdd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.13cefbdd","dist":{"shasum":"8338969d3ded61830cfca5565391c97985d23f67","integrity":"sha512-ntNjbqifzI78HXFU1yzZPMxsJB1Z7zVQmRS9wFH0mlO0vWUDow02HiWn4k5BuoKdtb3eKmVKi7/qAhfEy9x3wA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.13cefbdd.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb12EPCRA9TVsSAnZWagAAFTYQAI01ANZNb5uZ/zAMINMq\nLO42WPTZlqjj2UATfoysQScVe5KgIQGl0pTt/edskfItT9rmSa5hn01PG11I\nqo1UaMmLy9YgKxLtKMa59o4/kyQPvEgOqSTQBlgXx72f6EkCvxfkXMLhXoRn\n90P+m6VAlTlrd3HUhe80UIHMi0mlm14/l4PEQT5iETgEkYFQGn8UqkXc31XJ\nzUr58tJulVXQFOE3uCtKWrPjd1+xVRgFQNAz1wI8TtlZEde9KcFXQHT25saW\nymCyPpupZdjLDINrH5akLoa8c+UyfsTnTXfhgUB3ygb6seKKXGJwqLIr3NEK\nTwjepSysNHCfAdprVcjLtIrPHm5Ja8Gf+0Rpo2gQ9Tk3aYfV5+bhElIZlFDm\nGT6suFSN5IvrkalDfrgQLgZuCrKn0Y2HcmgwQAELvuvpzM3bsMAEXLxHct2Z\n1YV2k8dk9d/KsfMhPlUMNCvuwUcIlOoMNpdnAWk0P5yDq+DNd3KXxz/Aqm5I\nHcWP9snUGJWI9wLw8vdW3wvyvBpO90VcMjBzLdW3OVo5AFMS8fQKsZWTw+Rn\nJAIcjxWgvbbadf/+hDysFOJkGEsNm5UNBZcPJXULPOLmtBx1GZXHN4v9mOgd\nv25fhREdJYqQRPw7zs5rn+CDqz5P04Ire2H79qgxitIaajfnBEraGCT9IxZN\nt0lI\r\n=FXG1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEtTm3CeS5UUZ2L+gBlDRxFU8xPDLDVJd4AlrAoYoF61AiEA88It97MzXO/8mwC+MZvKu6RJu9a32muIywxevubqxbI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.13cefbdd_1540841742549_0.62924671187029"},"_hasShrinkwrap":false},"0.13.0-alpha.c4a47fc3":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.c4a47fc3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.c4a47fc3","dist":{"shasum":"baee2309cbc7d5ab56f67ec8478be48f2722f192","integrity":"sha512-gaznmU9dopAf8Bvd4FmRMLIwzLtgGdiAxKDTq+PBYinqKC/b0BJT2Lyvqc3Zm6dPYrdPJqy5n79YPCBSEqoZNg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.c4a47fc3.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb129XCRA9TVsSAnZWagAA2pcP/2TqFOtd6aI7UdyhV0Td\ntb1WcyqOtQJLNyVBOtOpqhedOibQbox1vZk/2DaPLr1Y0Jv3r2CF+7S8n4uY\nvoD35eXA1uEukVDCieU6DAaNqs7GmqC19QFkLt1J5UDkx0x/REgO6mworn6h\nP41X5Vc6/nvpA/6RsobGo7OY33ONegI+5zmql9fzCfluZqgnvZK4RTes7oIg\nPSr4EYOCOMpzP6d5uggUS2i1K8fOZYADdeDeuPsTDH0drBCpMyPsgjs1O2NC\n0+n2Q3qP5ZVzMmrnsNA2v7lMbyIeN/q4UtUMMzJxfdQT2W4TxiRpGE0ha9XE\nFy4hWFi73XOHrVxiHxpGhlBi5TdC0O0Ejr7WSBtJ+/qG644RkRnbKEOkbVK2\nTaSxKMEySB5Rd+LJfP8s6RS1GxBgCZukHl3EodjipjmS43V/X2VW4dxeV6q+\nfBh8i5lSHGmPS5Mm2Fn6hknAit5lusZcZbaT2kkgHwG1fm5drEehwWjNLNK1\nqWjkRA0QLamTPtfGcEkbTYuHBS9tD6J1s22JPl8pHWBPuz15jyzOEOBP03q7\niFzA8nJggYE7kYo1FrAdvU9FRLXeZsRREkZRZQM7ApaKtAz/OhIQcx6yXkRt\nRwgeYjIhSxzbht+VE+fJObjiH2hAi3bNOGLahrHvXGFeOMtvRA9gLTsJ3JHl\neT4B\r\n=HGtc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDfpDO/Bhf1ekjJMphMS+m7r0lCP8QtnHLi6hZSBXgOCAiBbcXzrhQ6+6LMcB5FOsG0Iye9WXQg5dEmhM4NOJwx47w=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.c4a47fc3_1540845398362_0.8668696629630797"},"_hasShrinkwrap":false},"0.13.0-alpha.5bbf4d4f":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.5bbf4d4f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.5bbf4d4f","dist":{"shasum":"88b13ff3acd11759119be4e3983d94a25c5fcbf1","integrity":"sha512-/gN5NoCz9QMsPXzHCdVfBeoaclpsT9NeCgUgyr/+CnyIt3rgKag2npIEPOZGhxqpTVu6RcHav7jl/UkJ8a/WuQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.5bbf4d4f.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb14J1CRA9TVsSAnZWagAAbBkP/RmG2SbLHD5Ih+Q72bVf\nwj9YRAKYPvueztR4a7LdWbyIYtoKc76oFob1YoQSKdeHxbt4qMK+77JNCQro\nXs42euNkjJG2Og2ZRr5mUU5nXmLU7Amh8yORXYBHHL2GAtiMwYBKSMXwySRA\n+X+lorVxbY/Ob/HRIj0qeCDpnJXKap65pWmT8IjDryv5yClKww5r3g0KhgsI\n7ICzatEPt+n2bcU65zNraYlD42qun1ycXJUJpPo9GIH8UKyRVk7Ujv3xnN+l\n4CflXEXKFAwdRx9MMUbVATZJlOYGUbFbjNVCrvPuo3L+mu+I3eixLAh62LvG\n4rTvzPtxr1ngZD+ztSDcRLso5H0DZg5JNyIrhrWZBf4YtybrjV70eL4a2Le1\n1cex7xP0uCXa6WwANIC4zi5om+P5G1rxubjNFH1mq6lNsaM4XOi0K+F9UitJ\nb0OlqB2luCYTWXtKF0fG6MDqe9ARvQK2SJOqUvk7FTTmBv3ODZidzmlxdFea\nkGyhUICxhfMLnxnEsERFpQCI2SkUGrSxUYCHJ3wbUiiCRmlw/5gEia7eA287\nurImtf1sjtl7v/lCoQijXC9vWV6vGYPKCCTSKJWrZqfD6lStT6EwivUbsfD/\nB4knAQu3B2T2Hlpd5RpSw5Tikg/YjoK2V9gtkxDXO5En8wc7gg9eiEgXU3UQ\nd8Ty\r\n=zEJp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWI71PetxDJM48/D3xA1w4rr1yCPoWd5VW/0bcXN0SOgIgBUw4KIQZS2eYbaJMUEpAkZsvx5ZDN+zcBUHvpshFOwQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.5bbf4d4f_1540850292786_0.9014124002191186"},"_hasShrinkwrap":false},"0.13.0-alpha.bff9b6a4":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.bff9b6a4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.bff9b6a4","dist":{"shasum":"2e903a260cd9ea79e41db51c566802f600269483","integrity":"sha512-LuOH0TeEulc2B2wK1+hrLlHKzWwsH3CseHtPw74jhjHNIRZRq43/eeQTBlvGPUt6bS+c/Kk/yvOpLeenRsAKzA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.bff9b6a4.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2AoZCRA9TVsSAnZWagAA/U4QAKCDY39AIjLrif5boqJd\nGBVrfX+6+Y5h914IBD0H90NZprS71JUoqVXvl+WtXt1/EMIi4OQheDKDoME8\nTAkRJrKy7N1e53si4gwessPE49vvnUWDREfqFS7VJoPRGwbnl+VlHcqIw7BW\nSYlfHw9R0aDbej31VEmUgJLn1TJCqYwgJPM7xGCOLBjFcQnD8Fc3DTMI74Ej\nAWlEOI/ZapPY6KCgA7L4bvzwVu0LPL5jaUJVUrI/QLqhGt6iwRrbXya9PnLc\nT6980nExSzBBPj90i2NC1LxEUCibjLgP67XVddFFt3t7xuugkwPo3ytcdnw4\n7iCH9UiHJF6lnBziwWmy81EsNaDlvTf9xbr3Mq8I5un0AaYxJdlVa60vUi6q\nGG57f/KljKD1hDry0Ge4II9KFTNaMmCW5HCzFXJDoly67R1/4z4mk4aSOYEF\ngKC7QhBL84RQucp2r3Q828+WFzNyfphuuahf+o0GIedPfekxnh2G7m3Cc+Wq\nkZv/bptavbFL3Xw4j9334732xshfsE07bXa8ly7s6jkAdW0wyadfylVIoX37\nWABEE51sxyeyp8HnT/fzAPisfZVRaSzTqDgInycOHAPBWlQxuraWFNWNfsGp\nF4efPsywU4C4zi5iAl5vA/aFupR4FNL0N+8bfHhIE7PSSusPIKp/RTdEC6Wp\ntEtg\r\n=APV/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8iaXDC9AkJnJMnoZASzyImnL3J/XtQEMlGaSN74k3tAIgDezTfCKM5fDiWY7vUl3Rs6HOrbIKuZYxixlpnb0BWrE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.bff9b6a4_1540885016491_0.4935861020105401"},"_hasShrinkwrap":false},"0.13.0-alpha.4466f6e3":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.4466f6e3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.4466f6e3","dist":{"shasum":"080b85545bb888242b9d599637fbd5596fb77ea7","integrity":"sha512-D4gZCJxPHdRJJa27YqHxvxbkuUbYRdQ7Jh9b8vM7KMk8x7wULWjvztKL8AZSgANEBkXntRhkPHhIZaB2cYjZmA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.4466f6e3.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2AoeCRA9TVsSAnZWagAARegP/2BEYjYmpxavOMXte6be\nO3EK7R+PIiHfpGFsmVIR/ZyRDFfF31LtF3VCM7rqVxLc/AxQP1K15lxhVNT3\n5X4u57vwGHvZrrkcwSMUAdt0rYsmPg9xM9gipeezJcRJuWOBWkmK/D+4gK7b\nvJnZkxFHwTz4WJmt/Pnb/aLFm4E5ycwqVblNGTb67QLqok1HKszz6t2hKoCK\nb5cYYmKUG5JNJu54FM8G6HBL9pgbxVpIu/I7xwFTCwr/24xLrxqNnPJ6M9Iv\nGPBCUhDHzTs/rcwZAWNAmP7JS4apWw92H6/ES8lkZmESJ29+tPSzH6dk2TT0\nzhpC+70scBqUIdK0t0zk7QaMNktNPOxv708EB1GEwsln5h/TU/sxPkYlGHDm\notMYWvgka8IbOwSkEdj/ZNm3guxE9+Qpl5eBZASnXVA+eXacfWAy5eiS8Eiy\n0YBffpiw/OoQyB5YSoGaXRTGhUMHSsK6RAtg4BsSU+DgX13wyBhzjd2ZksFl\nTklaxW51KEBeWnJdoi6JSNjKsI2wdsna8WQIQ1eq+JBem3f7aNTP6et+MQCv\nXol3u6kQI5OL9SOSIY+bdOEdp8u1Hgrk4Eiv+DpkpTzns7ykXmdOzl49tw3A\nj7AQa07UmGPbVvYZxocpAmzyZvo4IrbXcFK1oc2HaPxLMmZgnUJO+eoPKgcB\nZP+S\r\n=ZAmJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVuqULcxcpZkF3E67GrHXezjdR1pl4GoNd4rjHXL+U9wIhAJ/arerSyJ0jBhrDtMD/5z5Px0L/7VPELe3HQZklBmQY"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.4466f6e3_1540885021390_0.3193788108830853"},"_hasShrinkwrap":false},"0.13.0-alpha.576fc71f":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.576fc71f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.576fc71f","dist":{"shasum":"bb68c5728bfdeeca546c337b11a8ebdaf52673f2","integrity":"sha512-WN0LzXS1LhGx4ENEsIq7XI5qw61GzVlBvlN8nkUGkoIvFm+RsrJU/59tV0qjxsI02AkqtFVySG3LHju1gDyvvA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.576fc71f.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2Ao1CRA9TVsSAnZWagAAEuQP/iKhOEHAQ739VrzqZ9Ov\nnkHhI2qf6hNaZjwcWfzJ2tF9v1iWrbUjVlSNw+3or8QSn9so+t7uoNPmgE6g\nG/Uf3o9yOqqzYVPb4pxZ8LEBUMMEa3TsYaJ8QpaGgbkZJSyxG3PRUBTmJ9Rt\nMqcqAOQKndEqLkiLsjZQpfFb1usyuqdCROTr3h2XEE9eUAi0dT8/D/EpwKa0\nKr2/LyBBcQtcyr8Y3AtQAHQ07llPjOfOVo1Qjz/Y4hXH5JXYPuBOf2vB673B\notrkL24NaVyA30q8JlFJxzkx5f56ndgUYJbxQM7FsuEKl7r0O58xwLqnCz7N\nvB0mbRAEC7UXBEMzvOHVwhufqeej+omcA+XoBpbcBZ7SuQlL0BsH/Iz3jTMY\nF9MFw0XIRY0XEFXT7scfDWtlqPzH74mkFAZkxfg0RRxXqakaRtTYaUedBIOD\nNQRcVMFM2B7slyAVpSy7P+pcOVFo4OC7Qzxbbs9gTTM4Xr7FNENf5B918EYo\nzg/5oYqTT5qcvwfK1vOqlLoRfuwpwlQYLpeS74M6Ue41uERwYXrxXyQZ8TDZ\nrJ/QIVlW8B3tiF7LjN0I0jFBKWokPcgdfaexgFXK5nGgdaNZBBjJYEd/45aR\nZa2Zayd9FiTLWffY734ZrLmHzwr69eHaUoyZvEcBGP9bkrd4GTmFD/32Udcq\nLZ8l\r\n=eE2a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA/ZPlB4UXZ7omNc9VxLd+WqhJbulC3MoK7uI4gM5JERAiEA7imz4YZVv8CcB2VAyrG33k64aeLy8pSpqgXQVMSOedA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.576fc71f_1540885044431_0.32361334965519806"},"_hasShrinkwrap":false},"0.13.0-alpha.fa30b773":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.fa30b773","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.fa30b773","dist":{"shasum":"7b1ec18deabd0f9a9209948ef71e516b8d461be4","integrity":"sha512-KqkVZLXoVCjCQYO3acaJ6HeFqJVUG4GS8A9LmC2ONiwEnVWJt5j9Gy4anuK3KD3LaabjeS7MDd9s3XAhUccxpA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.fa30b773.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2AqUCRA9TVsSAnZWagAAaAcP/0hPFsyVUihRPjaxVJ+D\nQhufixuANfLo7UZtc3m74wX++jpZ0vNoMmIRRcczM81ituKcA+D9CzMTI9Cf\nwLJhNBopSa7ECXyUOTv4zj36pEBqmJn+fSG4jUAjdQqo+RUZxksD0vXErxKW\nqiv0+ySUCv/+c8NidGwxWjJENunhNLX7JAEB1TReI/QxQ6IG/tKWxbZkFF3S\nX57umGa2Iq6GtmavfH9J+I81xNg9l0HYKmSG30HZoTDqrgtGE+quxjjGQWXJ\nscCDV9Pry7ExmkMsJu116uQgjDKuPo5yAboDM3ONanFSXIAKGh4GcPaWfTjP\nH9PbiHQjUri1cBwkl7h+pJWpCDBhYety4UxgYzg0XJ1EIGyWl6KGbfY3N8sj\nDPMjy6g31Y1PWj+xPbzTZVkWBUtLqrO8ginX8R/f3iJJqRcyQDvqP8jBcDVQ\nDvhioh/585LNQSE/q9KvcYv8t/OiM4NRqxEGv9CIXa3vYzfvyovJ+CCFIKBx\nRYak0F/5Tcc9aVy4heLbkKe6RP1xIn4Rhmb5TTgynjTy4UzTz7uCpdw+YLZI\nnehthuu7YvN1gK+4HCk9U7QTwz0gF4Xh18vdrx8NGkKhDHL5ZLQl/0hWjP2Z\ngc8uFpY8mLOg3AWpwejzeHiR+4a/Sc4CtKHOPMvcZT2rtZd/lLWTPaGhphnV\npPqH\r\n=wE+v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/3as95dlfkPpknKvmdf0I89508CaUFP9ssKRjPOXkVAIgbM3F98pxB2SZz+pekKIJ2TaWLtSCpfVPSjG5ABX90rM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.fa30b773_1540885139883_0.7216861253607627"},"_hasShrinkwrap":false},"0.13.0-alpha.31a499db":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.31a499db","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.31a499db","dist":{"shasum":"7ad9b0f08fa35362bb1045e6a50666470b86e5c8","integrity":"sha512-9xeNc/Cq9IQjx7HBtQPUAs5/4FkPJugWT2kerIOk9MTylqEAK/MwlbebIMbVoOf3YLvWPyec9qGJKuyExIOQqA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.31a499db.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2AqlCRA9TVsSAnZWagAAqOIP/3ylvcPGNeAw/2gaKpwL\noRz5r+MYYeDGHEgOSUlk1BtbrQGwKvVq2rTwfA8l8Z4Y6eiTYzZRmdCF9aHA\nyEPtI5mWF5AozhEw2n/nOBTvc2cD6dbQNHmQW3JNZtM0Qww9y2fgVdMJIoVP\n2w0pKDcC4nGKFivfGkL7+DpJhdHygN9XxhM1QwjFaOmVIm6MHOC5jOZeZvNH\nDdHGSY4+ebLeQYfAmBn7GvL1HQqeLVgeCCicFt8h0+DA3D53v9Nsz1inzBPq\nTZW3BaJOszuLYFnYyCwSRYipX6TEVmwY0+RYi75CtYHiiUGcJVo7xNZtLR80\nqXWQXYhL8XtDcY7T2k9Tlvwdyb+Tek2JEhTAyDgG0X+r3fay2n6pZEkT/8J9\nFkMG3EjAqgaK071U1yKgBphTD3kJT1ua4GOJKGskw54sPossEurZBSv9zBlY\nXS+34hrn8uMjGIp7+LXyT21ZhELM/iLVAlvzh8EB9pcBKjuGJWvwI2RkuiTW\nkn96gVpxSQAh5xtr2KqB9T2ikELOHb0oFNqp8YzjQHrNDuIIfgY9A2yUtpop\nv1go5NPHLaU2uW/hJLWE/3FeIu4015Dr2DEerUwEjfUHw3FUCNw1JhNYvJXv\nc4G2S7ZCuyCLAYDDJE3tQjm9F2l5a/SD4BEs+cA6wJV4igY4cwpL+/hTP6oU\nHJGf\r\n=jWE+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGAORVo5IgQHGpWDreocycUlrGAFWtnNE+erIFtvoETlAiEAu0dZaNxBnZk8GFIdO0V9OYAusEHMPiJaQggHZ7IsGh0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.31a499db_1540885157257_0.40478049777693004"},"_hasShrinkwrap":false},"0.13.0-alpha.f7c23626":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.f7c23626","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.f7c23626","dist":{"shasum":"57e311ddf1903d9be4c4aa9e63db3dd4f2a95552","integrity":"sha512-xk/rfJMYO5obfLM1PRTe4U8t8lqwtZ/7ttmr4g1tGoXPiZjv7L076wctblPOjG7JoKAItr43ET1lAZhXpoOIJw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.f7c23626.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2Aq5CRA9TVsSAnZWagAAClgP/RLfeC/zMwwL3BNUjDxR\nzwrDMH9ZVjG+jP+XOnWWdFIAb4LrEzK5XUkHR86m8mTX32RBDkKlqyUw3Sne\nwJ6yOZhILfLhxouXHNAbSZU/alrw9x/1JEIgqkrqq+k1dST7hA7Ue2livu2u\nG7xA4/4QbPb89AsGInoF70y6+Sdu+9t5N7anBoAAcF2/S4B8mWot6EPdOdVl\nkezIGE5TW7EFD5efyVmgzjzLBSdyt4u5ZYyO2wHP8FvP4Wr2fzEtRvgcugxd\nooGaEFuv2KzOBhjHbV698Q1M3PCB8utrMP8uEwP/JoZlOJVY/hfepEGDm1xG\nbsU4Vcp+CALERJxRour5NsPp2oq7hHK3YrgUM9LaoAvIR/R1ZkQ1d3Nns1av\nx8BNYYtLZ7XXC5zqHMdLbyeFBUUT0Lsqhq+R/K0GtwHCOBGCzt5cFN1wP8If\nlZcxf04R59ovdu4MVzC5XfjLNqouCcZpQOfd7KHbmeVRiS4ALmJIfzaRUH1s\nIxJhe+kTIMvn3hSew914WeBM+V47XZ7LW0R5JSQOtmqZhxai+/5en9PAJMNR\n+myGCYF4AogZOIe6EwuAZAiBapbg74GUdfhXt63Go8HhpRqu/sj5vIEVr5zx\n0T6g/8uKhbfuOmrUc5+BGqOtBph5mYhsi+7ii9Ukfo3eNj0mHo7GiDMPLTNG\nBnBY\r\n=E/hW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKbIj8Nsvjgdh796ouWcyGsiGFw8vDCl6aD4WuuktOrAIhAMAstoucQU1vPOkDKWJ6vU1yGidNEFPmX49btgwaUIzF"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.f7c23626_1540885176257_0.5648705457005545"},"_hasShrinkwrap":false},"0.13.0-alpha.43b5774c":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.43b5774c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.43b5774c","dist":{"shasum":"164759c8207f15c447488542d7bb17ced041d7d1","integrity":"sha512-eWMbtfoRTNzLNfpGZKKU8aGHKNlA8ZITcZ2wbjGdrJFM2Rw7lpE5CX1tCth6zOsZHF5ZW5oFxptoW2A7Wj7QFQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.43b5774c.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2A8oCRA9TVsSAnZWagAAtN8P/0VnuDaaQVCpQIJdR67y\ntMirHRi9HK2WGr2W2TC879/uh6Be1lTfFeFWfMQEW3iuZ/H3PsYsDu8dG8g2\nLd9fAg56H7XtffYXFfJW6ZDgIyWckQxKq+0PV/JCEReNvyJMcF4de0mh5AHz\nzazw/2/mAzhjaJvCgRP6bS2f6H9ByfR77FjgWibM+gI5s3qe8Rt7V12s36sJ\nPLEZlToqgmIMlB22+1+8Mb3QDjFmXh5+hWiAJD0U1VfejD3NZhFK+oJEw2c6\nA/ayyCHcvrbvkzLnkb41yzL8IH4lyJsZM26OGU1wWVdk/5m2UeAK+tk4cJar\nQ18Gq0YmZiB0a34Ehi1x+nB+X7MFJYQgBN6R/COU+5F9fHRQ/EH+d8Fd3MZ/\nv1ILOeeBOs8wtxUdCl7j+s+9YiScsJmv+9Qb0uVUCfLbLCrQu+TEjqLeCsvs\n5uevbxuqVSiPso4hAlsB4gM0urTmMttVFP9eg1ebC6ZkNzuPTSQBGi6JX/3z\nhd997r+plUTuED5BDtu0LWH9xkkoCDZ8IQElb4s9x2lUjj2kjungdpmSzsu7\nK59erzWPRydTV6ucPcWGw2T4Ap/Ypre3ZUVrC7ktXAGaFOaTdhQS1OjrIkF1\n5t4v6mhbBdc9wc4s3eC7f7Uk9dj0jbjaFgfgtds1GCuvlEx09QMqMKjhkxD+\nZgbC\r\n=7rNw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCL7TiE9uqw4TcJsDSbVuhDHfNYOnNcceRmdMoOTBLEfwIgD2I8T9AIMsrlvQGDmKj19rhwkCWCOYC2lwAmokf76T4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.43b5774c_1540886312151_0.07792387750601493"},"_hasShrinkwrap":false},"0.13.0-alpha.ca932b4e":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.ca932b4e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.ca932b4e","dist":{"shasum":"f16a3879b8033dbd819291ca57ae7f4656914dde","integrity":"sha512-S8hTlewcnblsHTuODudEr2ib1bVV0+k/wLd+FbyJN4CAPQ9CLuJtQkd46ussAIe46Y44lndXBdzMhAOOm6CLbQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.ca932b4e.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2A9JCRA9TVsSAnZWagAAOn8P/AtAND3jjU1QXcL8H7sU\nnYLMT6iHT2NtAXWICIW4rNAWZKIbdMLAYhIKPBrBxlUmAygo2hZsIb05K66t\nikG7fjRjdeTYtVexXUtWQrf8v6IiNeZFFyv5Mcabdm4oTmssYcubVWtvj1Gh\nnCLmDXZHnDnL2gaua19ZkgKVP2/Eyok/gXaYB8b+oidgqwojDnMnbwMHYtGU\nfRrJjGHQ7wCfCi1bWzWRugJNKyQAcTasTYAz4B25Mz6w4aeGoYjNplaVCN0h\nrRfAbougl+2OfATWFNa64OAY5/b4de5WuHF5wOA5/KdnzLYPDvDhP4+ixuW/\nOBs/GMKxJ861R1INUze1uh3PyFLN1Z9PosdueGzEBKjIz/V3nzhQXqJg5O6F\nR7xfg+VwR0IGFmp2omNUaSJrkdMuXujxwX6uC7TZNqMeLwGKm2UmqxTDe/yH\nJrXFFhhjsY+iRjqsaFUmHzlW7FKotbT6/ExVKQRxJ9nWNnsyD4HI2on2NGbC\nazAu3prMTAsvaqv4XOYO4SM4Dhrjrr02IkELN4Aux2lCnNgwansPNVVEUKJx\nZbNDaS42rv2COuKMAGcu93me6ZzlwEC4nOE/60d7TrFHzPRNdUlko4KyOAyi\nkWE7hWB4CScjcKQGjpQeO5iWESKHkYpH5Vr4HvZ1uLj4+iplNxv0o0+UZU9g\n7Txj\r\n=l5wo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDA0NX3AMa9OhzcqC78FL8C8uCSBi3IwtwdzmFNGtN8NAIgV8u8U9q223a59ebfjejF02I966ZRaNjwnmT8HjViipg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.ca932b4e_1540886344331_0.16286519916178244"},"_hasShrinkwrap":false},"0.13.0-alpha.fb93ced7":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.fb93ced7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.fb93ced7","dist":{"shasum":"e4563b324b943718abb2100be3a0e895f57193b3","integrity":"sha512-B1i3VAqnWUZZrGazM7w6Vze4IGIHO2NfFzE/Kth00Xig10SnfqFpgno7JxmFISMsFtUKRFOfxpD8EudCnGNwHg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.fb93ced7.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2A9dCRA9TVsSAnZWagAAQSUP/R2dchfb+fim1RhwYQs0\nWnbaJzUPCJK713ezaVTshWnFFuKcEm9M5EoYkFNB4Re478OW4c7dcW6LFy/9\n6uH66vfGfU7rkL4r0eHCmJ8O+gmvHfCOyhnMHoSG5Qxpc3CsJ/LjgM9DTsyJ\nGu2h1D5110AbB18pQfQNkGaSUoh6pMU9wd7k7okWMa65/dY1dqit0im2dHya\n0/izG9Mq+TGzPDqEbS7eIX2kgJnV1B25IFZCtP4YBgE+ryM7eXuvjb8oII4O\nIriYvJK+ZwVa7U0tn6+bBmSySB5tnVs5SRS4xOLcIHj9eAwQ8xbndfDI4kTr\nXbbEuLmYDvJtkIPjJhAsnk7+pnbvmK6tY/WdYoLwFoccxngJW02NUeDORfLZ\nju5s/AVfe2IQdGQ9XQIBH94lwBwyMC/5gsiPMcxa5wj+4lM1pTI0hmB5M8iZ\nx1aK1yN8b9SP52y+/8+n/HEjkneZ7es8iS+NHEYqLOFbziNAI3HPm3Rjq4S7\nZvHOcxD8xnLHTdGjMrZRGbq//YkAS6mAq44shA78/tjf870biouH/CZPjtyt\npxZsWvIuvhWAjstdX+uaDOTCjvGcZ81wH8jQQXlT5HrvWzIdYyyrnZ3uEyqS\nOHci7ThwzUDPAiP8qrAw/6Ps2fBELXOa+d6vAG+Epw4q9bbnXubYWHK2Ez/I\n0aGC\r\n=YdeW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEKqKlZ9Hb4sVSUoLpPJzqmZWNiVwZPYfoT2T00v30bsAiEA+iFo2ldZZyjL200WL9cjlIaoJ9IJmSXzGy1HbWomnPU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.fb93ced7_1540886365100_0.45340117876965946"},"_hasShrinkwrap":false},"0.13.0-alpha.e2710037":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.e2710037","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.e2710037","dist":{"shasum":"1c387fdeec15b42a9b42faa0f05ad3ec5dd521b4","integrity":"sha512-WAeA6K15aggxSm/WVK+OdHUjGzX53pEwyyqJuevl9+abMXRhBCLDOlPZSyBdwYuBzkOn6HSZrcAa9CyKbE29fg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.e2710037.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2A/mCRA9TVsSAnZWagAA+UgQAKUCqN/Ywnq96dUCMsp0\nbeb5rekXXAYMNqfzCylMChZCXGPgDoCSQGbhP4I7A3SO0MDm/31Kanr3+Rjk\nuc2MN1hMXaIfZAMa5ehvB87KyPbhCFZvZPCig8Hc3CDmVIB7ZI2wu8ndECyL\nhqgcujvhiUjqykxNl/52UzkYRTeKn6+FhO4Di4CdA1fHa4aIukOAfqlMpLoG\npw1wpX1LRkj5otsLPy11GAkoatVxdtLk1hnIZeQTvMDq0R5Zok2FFonNdckn\nWcyBLFwyNMZTBhekHkcwJEtKZqCw6B59o7jgPA30kse8js7F/XD1k6MOK6Q3\n5NsXiie1Cx76UXWaJSlBGR2fmEgWV0KbBnYmUCRImtJbTyg85GohHrWkY78B\nq98nN4LLfFVN/ALvsVNkKH9XUqkMp9hllQxSS7QeNaAqf8RdN6CT9C8q5BS1\nxgxVsxeWYTwae3m/TUuN+4U7tjWBYtDe7aNoh8Rj0do6FeKd6FAWKyt51MRC\nsDO5xK5Q9U7Zo6oh29xWmmOnQ+Sd2CGK5hG/Ph8+LCJU8vOXYg+KBu9yPviV\nZvUMBBwmdrQq+zaf6xuQVqJt+7DjMbinQbbkA1qHsWMiXWfdIYfRVGO/anxN\nMNHq/t15z/3r9koujNS81nq3rUmLyrPqq1qs0d/FyXuS0n0AaaXIdxRQQV9q\nPUtm\r\n=xtaN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5zvLGG8pm1HxhscKpJ0weg0plgroQ12y9B9wBVb9vPgIhAJU00109RA4bawqdrZNErUrnynf8kAAOqAEKWGU4bOqY"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.e2710037_1540886501233_0.4609029157262705"},"_hasShrinkwrap":false},"0.13.0-alpha.898ab460":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.898ab460","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.898ab460","dist":{"shasum":"99f1d62f845fecd49b4c7283afaf56713d8737e9","integrity":"sha512-nr9fcNE3flCZxLTTvARVWznuDb4tsmojSqIm725A+9qBBBDDriqtBgWDjnoLs1lHHKU0oC3sU9UxwlrnBDz7mw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.898ab460.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2CCCCRA9TVsSAnZWagAAf5IP/0E6EEGG6lgquESZM5+B\n/vmJmKO5mmGXI4GbkMzpVy1TlJicluZpPAeIRu/TsMMZr/NFRMQEQsaEOt1+\nAlRylSSQpaf8cKr3/7IaSzVoxjX8E8/NSJcPzihdWWbeCmrJ+CCY2//DnAJy\nb6dTGxDHL07z2mxCqfZRGwTXl85CLE1o9GD7KG2HrAj87q4eqEzxYFWVND3j\n8ePXRVXxWC30D5H5BX19h599vPQelWnyGp3XCbes62LNCLVj9vAemAoI00A+\n+tJyF5BAHChDuGylccjI2EHJj4/bSkSV1ZavKTGc31cnvfBuTp/uCkgW/x9y\n7+ERlgelkHetwdVPVy0MrQzqUrIV1T5s1Z0woN+VBlpqWYHlLaaxbxFTSJmo\nCaMLyymFt6lC3TF7xrE74Igp1nR5Gydu5jBcqYmknBP6/Fcd3aIAp3zS1IY2\nJ+dCh2q3xadTeLgJAdPtKCwkqXl4UnK3SjilirYlBpeQbSIisZmfQUfIc/Hc\nBJ0SdzarQVgbK0JQkzyJEXpQYBQZJ72wkK91yieqggc5S+usemv1owQB8zKr\nt4RF2N29HStRXRSWQ5n8l+pBVT6c9eKjdmTQjd3r8o8i+IUZpWPduPylNZBA\nY5m47V7OyCdvYCLFAqkdHnd2/WL69eEvzBDO5IHeK1U1IYafid07QDL1moDy\ncOcL\r\n=it2f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+KQLf4xxJf/RG0T7SUrWDc9GhopOC7qm6t3QosRrGEQIgXLMFGi5wfhe3Dbvf48vIiinpXlBooyL/E655m7CLGbw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.898ab460_1540890754183_0.9285360469352406"},"_hasShrinkwrap":false},"0.13.0-alpha.3fc4ec09":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.3fc4ec09","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.3fc4ec09","dist":{"shasum":"c4e0aba4a5f250570fbb180d59738d0c8878cb8c","integrity":"sha512-DK8cUJTk67NSBM5YUBg0qNjLFJrRrhY22qYXbySupWjoQXy3JeL0oHDy8gSUeaBc+w5S2pfmqZziKVQo6j67hw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.3fc4ec09.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2CIjCRA9TVsSAnZWagAAhdMQAIh3/dQ++IbzomuJBleD\naG1nEhn4TSCr70Fh4AGsfKwu5L91d6790cXqBI6N2C/T+ui3Ava5C+gdKZ4l\nu+Rwt9gINCsJuEHAcj+BEOyVF5o0RXq+TjuwF4bTQqCBqTnx5WdbDLnQts1I\nMB189PDxUas7EoefwrGHk1LY0sYjBTETolhdg3ZY4EL56zTl72kbYU+JebKW\nwLeUAIXEtEM4SVJtwtoyHEhdlRAQ6+RactOqvGewjCWK9JeIe+azL4SdE+sz\naxib1QgTPkm22yUuUc1I2CGdkw/TTbXQ0qrub0WMsTA07lv6AQuVPm+ulQ13\ndiHlzr3khf0d1+l8rMomVgOQPlzoEWu1+C/P5ReTQzXKjdgZ1fu86YQ9h1Gu\nPiA8QRQI6NlFdFA35UkcITIuWBeYW2qgXHnfYZGVRntfa2VxG95N2dzzrAcm\nDX46wBjHHLinxuLG1JxAo9Th18mAWg5q1nXkgI8JrvMKSIsvlGbXpk4YQXVp\nv4a8jKOFJIxq+12nr7ewchB0ASbUk34HFImW8nw76+RVNyhIG7/bNIADlT3P\n4/L50h0ThQyhKKnbpT5elo/wGYSnqHSL41sG1s6vLo5woUWKRpRv++XZjVtP\nYsvdei6oyP8xIQaC3hYiKow1Gl9GlR0KChZ93YzpiyDRei4W6C9NDMLJN24U\n6PTa\r\n=mA2Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCp5llX0W118Ql0NaODXrjO3qvgM/LVlBc/Wyesh3S7mQIgcNwUZu1PEJtnXG0e/X6jCkFTXkkNS/pJhCIs4gjxF1Q="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.3fc4ec09_1540891170491_0.8327874746068515"},"_hasShrinkwrap":false},"0.13.0-alpha.612fa4cb":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.612fa4cb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.612fa4cb","dist":{"shasum":"cc7a309f08690e4519aa177441ea72fb428c60eb","integrity":"sha512-8wIE5HKi0l5jhjOTcbdcySzwvcrN2Fz9/TSsfDmIYKi+da/utonDKkUHDYjofFX606/IthFBJRb38BtoWiwXaA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.612fa4cb.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2LojCRA9TVsSAnZWagAAqOIP/3TZJb+PMfJCBkKpA6/n\nrlLSGu9n9vhUQdD+coXv7GC5VCwopzRrmWzPxYaDAUbtzvRzqnRC3lpkxLZg\nFq5bF5XPsW5LMmsBCuYDFGWwtOVLJRbaATPXdPFfc28j3k7Ceodbh45knh9F\n7TzIUFiCVvqra9SmWTRMxsCAVImOAGokj0/6zrxc45sNlJ9TBHcOHZ0Uw90h\nwqvuZza7eeF5dak7jGgDCzO1XfhaHKy9Mj2SVWxPpW6LlSGneI1cXn38+tmq\niTkwOkCINfJ8Q3/vieXijMafuoABGpbfOdexD1lI1JptBDRFUQg8J2xTABKc\nWbLlNu8ophUBHJlpPb8vQ3vW2B0/uaTl/3JnuoP2fvpVsEY2ZUOvIcjpBoGB\n+o5zvVwAwIVfdbVeANxUIUwacWvKFbcI7NXfRNI342OatyXPkcwS/vr6fPaA\nSHj2aLHkmVm03umU+YiFwWEclZKY/F8LNnJh03+7AIm++xfoPtMT5u4u8PX9\nPcsId3mJJtWXcWnIWD04kZqKjqxnIyNMOlEbfWZYbSCPt9whJHEJZ99lFoeI\n9Jd3ptLgYX0w+8LxFtOE/nVw9ggLr0OEEOaHJqcf556t6cmprr0G1OpffvHX\ndOszbxSIZc+0YAz3rkJTT8pZDEcWUQRrRfQtu2EzczOEV51J3pYErrV/OG6y\n391C\r\n=c0EG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtyqLu6qSwBkMJHVT5qW/x8pNp8cPDm2VmGuUAOaiIfAIhAINFPQpX+OG05i/S9vSwiT2H+2OhpaIUjh/LOZ/SvRUS"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.612fa4cb_1540930082724_0.20861994476649826"},"_hasShrinkwrap":false},"0.13.0-alpha.70def5f8":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.70def5f8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.70def5f8","dist":{"shasum":"fc3fea76e057f8d162c20a2be4747988e77b845f","integrity":"sha512-PDOZM6p5p5/GxNwYRyRl+euLA+vRymkmqTQGoqGWLJqAx4XMLErwYYN/cz9iBAknpaK0pZAaWmzGcUn8mSq0Mw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.70def5f8.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2UV5CRA9TVsSAnZWagAAhr4P/ilVQmuf3mo6T0KwQGE6\nrTiI98Cj5zkaj6YwqlLQMR9CXkYzVMmZKDT8rVwtIIAQ0sfX7K3D07X8vIXi\nusr5PXUB8GrzWgXy8cWysR9XVIoXGbksSNG2mTw9WSkTElfnPKDDxQGbO0t1\nkD0mCOcVZ/b5Tnfh5uv+WYTcDxtNHqSMlK8EOUJ4BimKImrY/DNzPX9qVgfN\n6Gz6PigKgRV0uJk11TuV9ynVMVC7GrqIIKx/A7A/BwNhRAAnv9wL4W+Zbl5r\nA3Fcsotk9hEfsCLsuLVyYbtDjEcptTcQvQzYKWS0MkomdjcNv6jVAx5XCz+E\nBaPx4MRQEg/Iztq0wBnFySrmBOZJvR9GHkGwhSXICK9FE+fgjcHbeatJcMFy\nCMOPb4qlXMTALkG1TwFFZO22yU/npzcs59q8ja4PKFsFZq7n/493QQsx3Bc3\ndnwIR6fr2rNWAdelf66nZBNCfF4Z7LSpq040c5E+EuI8ArjeckR/hgeJ3/M9\nryp5XGff36fiwFpMOVlsECnwb8/wIXfXQyNvmrD4+O3LSGq2FF+kFyqQrODn\nPVALd/ygam4ZzY7TJOo9kDc1yTnoxTtIz3/13u+Mlk/aymuNCNf1Oz0cmgD+\nOnoOwhWuj8VhXgJK7kp09BxQYlCLz5GPA5/y3IvNeCgueibU0MXIDj6a6Jae\n8hP9\r\n=Jm3Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGdWlZjHlN1UNn4Azvbboh4CcsStrM/EaOCusqNBqEMwIhAKwDGz83cCrbq+As/OqL2UoHLJCLX8he8xgzbP7PUxtX"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.70def5f8_1540965752290_0.20151432830592486"},"_hasShrinkwrap":false},"0.13.0":{"name":"codegen-templates-scripts","version":"0.13.0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0","dist":{"shasum":"7d980e53e646dcc25cd375fef40a51f38092fbbf","integrity":"sha512-vRFj3NXmLK1v3XZQ9Zoh8le0X+SzIhO1+EvdhRjZC5Vzn+2exBAfS4Ix+7p1idLcVFjqYqfkIqkmOjmo/ZAV6w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0.tgz","fileCount":22,"unpackedSize":17827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2UcOCRA9TVsSAnZWagAACo0P/1i92rcIVs2W+S7UssMh\nhmS5AtjYyBaqrjMbcRQxHb/NlFL0lQYxlDuivNqNpMkQvpvU8a5QXf7IUYP8\n3H34Yi4TtQgb6gOAS3IQCYtmh+usvEdvT+tKdvbI55OcZgSWbV27cI7E+Fe0\ndCQtet55TyieIuBud2Z6bsha6MW88gdNxg6RFaER+Lt7vtRfCx3DBwQWXbQd\no4BDauEm8QeRJ3ZnKgvT/uL4PoiMTKhgtQC16FV1vf1+0TsgUHy5r49c+wwB\nIPugwImLIsZLHtOCH103Akya0tektghr2Q34YvhNgJeXHJShEos9EsBtu8Ks\nzH8mJWAIRjZ606StOBdk10nMH7Mcq2N/e7+Sy9WDLSeaMQSuuvqvmBEANy7r\n2NYWO+cuxYHmMUFJe7FCEe+owHN94Ty9x/8hfWmRwOpdfU6BwtEDO0D5maaL\nqS5/BAflh4vPAd+ttS2nEX7NG0UVZ01uiwDW4/PzuKNk3qmyk/pGbwc4hJzp\nTS5OKTc1XMWBxVkH7ua4cKyF4LtbnqFwO/G8gaNW306cRpTYe1P7j+4tJOZ+\n3PVJ5CtWtQAr/qYwWWV+h3n2YPOaicB5W8gsQRjYeVobZGefp+W5oRGtbL6n\njDGgz/BDsJdTvhec9pJ4GH18aPm8dsKOcj3tJdztNEMmSJa6m4Hx8QNYmU7o\nN20u\r\n=7eHm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAUALL4XexjNK2CUH151zWDHx3NBDC2Jb9ILWhYVuNFkAiEAtoOkh/FKhtpbLHFTIf3Lb7uh3omsSGTQwZrdeZe5Vik="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0_1540966157279_0.12361089310377671"},"_hasShrinkwrap":false},"0.14.0-alpha.6e18acb1":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.6e18acb1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.6e18acb1","dist":{"shasum":"85f58ba16fb942aeca902a8a8cbfadc53ddfd203","integrity":"sha512-tWRbP6AHuqojBKxImekwwE7hb5vPTGEHb9P2VGXjHSmrjBWx/YBvFGqOv+Dn+wF6ren68OgvrQ/IF65RA+/Xug==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.6e18acb1.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2UeRCRA9TVsSAnZWagAA06wP/3aJ4RrzVRUKmw4DrzCA\nFGkAjqXTatv2aNetKA+6OkWHIJP5Wq/EQeYHO5Ci+C4Wb0fojJTtOeagaJK/\n6Q807f1u0Pl/hGrl8eOhua+27qNDwKDTTIUe1iwvG7tFTHJ3tXmdsZfXzNrt\naNX9lZ24DsIy9FMKLRPycaPVbfIEjPsmmbt2iczNqxeUoxDIFaW0aszI3YUw\nrAX0YJfZHYEW9lOxJ/hNt70Uexk1C1ATd7N5RMLiQV9+y1ukxiymGvOnPWwS\noiCORkxxH6zMxg8uBXiLh7+9kwvsI2E+1kfspiNBChCV+Z55NcGwg0Lkmpk8\nH87vNQPh+GKQH8wSYAIYsopTdfUHcozHuyiXZIMZsZps7xGIwdEwS+TdtCls\nRZDwMUiTWSob7ytFk29HNQ2QUCA3DVNyZd9YJt/1mdcResom6wKarzg2NgM3\nA8r88fjYkOjJ/r5/O0VCIoCqCVuzrZ4LRcxcJbDaZkeaOHY56+N2mDa54Z2u\nc6bQOBGrEVAsahim9KV4JTVF/ZRh4nAcCauHlTd8sdDP8QiQtS1dvOG7LOxJ\nUP4x/9/YF6z+WYFTpIrZbXg8BdsINMwVimz20Mc8K8AKlVt2XzRUmBP/qzAF\nHTAzICl/P7kgASJ+yoYMc/r6PlSC10dLz36mHKL/t1bejE3tKgUibjhPiqLr\n73zh\r\n=dMRw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZ4ALqZh6Hk+u4FxLJJYStm3QoLhH7w6WiMTheQHdjGQIgA96TMJY3KU8ddYKvOk0oYP4nAZWmlh1SErWEiYznqQw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.6e18acb1_1540966289207_0.6809271595741968"},"_hasShrinkwrap":false},"0.14.0-alpha.3861680e":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.3861680e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.3861680e","dist":{"shasum":"9a894976ba4630cb722a4fa5b275696b536b4e24","integrity":"sha512-MQyQi2NRE9S/TxyXh0FX/DlbaSUNlucfczkjRol4bHFR3+EubYpTmRUUP2+dcOlV+TmHRGvVBGaKceUyJVNfkA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.3861680e.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2ZZ8CRA9TVsSAnZWagAAxcoP/3HSRCFG0FNp8aLOoq7u\nUVkpgE2OD+BT4LqAopvVPat9OR/HM5zGO99JLeLbepvKp4CMFP6cy2z5RlpD\nyZi+mOnzC9cbjoWYxuYgst2YYNw52he845iXirxotbwIxRxooV5HjmQscUdI\n2J6cAiF8feVSd+JD7iV+m32uGOk/fMLHVZ9h6SKpeYlM95meU7n2IQ0XwfNB\nOPuXwVETe1QdK/hoil+zR18NdEe0mc7hBlZwqU4+0W/lI83sgmibxyfWqES7\nwZGg2mWEctrodYqawz6ANI9/1pPZr8WYRtgqBlLKiH4ktaW48Eyqq1jsJ/Dy\niXaA4jZkeIpSaCMKrG10EnTHHtsVAD+QSnf5veT4EoVft+T59kjkDsdwYTCZ\nY/mTvZf7gTeG/+CaPVxTQIVdZiXOXOU4oHvSghaAWHwieqWBJN6P18gb6tQN\nYuQ0M9/ut5w20vo7QbB3XcXgjn8GOJDOuOCntHf1j5lodOptutjjhMR31Jd+\njFv8OAHh2zTWVNg52lKs6DLcEbOol5Rxrh0vhoO/P1ExhlxpVGGaGsDZBomW\neXlGIM/Bkbn3hwT29z3jJnJoJcSFmZAJvjiox4sKENtfBDjWYloVvFHizqLO\nrnBdH0tY7u4USANDyqj6ivC13WkJofewNNYVGkuY7Xp79S1hmqi5f6RP0vtX\n6Cz+\r\n=gbnz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCywC8DrpwnSN4/bgqLxCS7zKw0eKkrRmWXtAPARQYLTwIgYFPIiyXXcZq6fpJESqUETJIPcM3GxpPDjqtx89V9ih8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.3861680e_1540986491925_0.9351960689095464"},"_hasShrinkwrap":false},"0.14.0-alpha.753cf9d2":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.753cf9d2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.753cf9d2","dist":{"shasum":"26293395b3aef065725dfc72ddeae3a8cb1d8ba0","integrity":"sha512-ctkwrMG0J0vl41gBOQeKDczZze8ZULGFVOHdwGrmpqob3yWaOFv194zfxQOy3gT1OH68LYcyI/AvFt6BtAfyGw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.753cf9d2.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2bMGCRA9TVsSAnZWagAACWUP/2DkZYwqSL4RWqiMgvJc\nejaHNa0HL3NCGJpdQgQa2gLtOoEhObC6NqDIMWy0M7Le50398dGllMCNdRs6\nidWmwO0e0YafbHjh8yi4JkoUV2IpgnhDJg0nNOa3Un7tHuLDE0isF0xwp7Gv\nwXjqKin1/MGzvShd6P3qg1mlc8KSWGR3hK81HbMONH7zziJJNxEj6M8o3ErX\n8ab+tcgrSb11cayfPq1i1Fm0daksE1Kx1Lczq0QmxFngHIeg5CDhaiqucllF\nrFj7t8K3x85hQqfvjvO1CF/lmPDOAn20kDE5r/xDkPVSwXqyaifFQPIhBda9\n7sB+zAjmo7jx047Yd3ZbTzNZ7V/tI6Dtxjzb7gN4OiVnqFFliKUrAlZk2ard\nzivHAOdsv4zfGyXknajDT6d1AiB83pb4QHUAA0nnzeY53bbEsmyOwYZRwrJQ\nLZTvT7oL+wdIBvxZIrcd+VW1OpgdFxIreR78w5BcYxCt6IpSfjjBZxpkJVSu\nUR1xAug29N2M4M6UKUHbHuqG4Xp/qLY+1NopH884/Os5BzXejyUnGAEk9ykQ\n1noF9+UszU9bnlj72dEp4ynoNWcWSUF94SKhT4S2sUs2o2jpAJMCivFcXz9w\nu65KI7/ujBnbd9HBuZPkxT1WFsxwE4eyrFuUY6FdD+TUMi8nNQNkxXT7EOZz\nhnU7\r\n=naxc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHbOyixD6qPGYiPWrlNPT3Sh4rp/d63hL+bvwnet++UvAiA6b8kEkRaQz6s4A8TB0cvI8ByI9leVqYar1UR2qJpMow=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.753cf9d2_1540993797269_0.5382435295228798"},"_hasShrinkwrap":false},"0.13.0-alpha.a51638ed":{"name":"codegen-templates-scripts","version":"0.13.0-alpha.a51638ed","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.3","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.13.0-alpha.a51638ed","dist":{"shasum":"fdd98b9807bff879890d1052843a76558f53514f","integrity":"sha512-MTYSHue018HlOMOpYBfTRHG/DuxXw2JutUI4XitQxtNslpjhpjfw33jgAV/Xe4y4L/LXzfPjgJunhKDuaUKFew==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.13.0-alpha.a51638ed.tgz","fileCount":22,"unpackedSize":16650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2dc4CRA9TVsSAnZWagAAKS0P/1lFQgI8Ck+YjIcfcyE1\npy78NnB3eeWjxNg15kiuC+ZmDJ+Vu/YyVzhR3JHs64fzAzOkcnB+Bu/UkctL\nRLWOPDRrXx5syVGwlySeZVwP75U1VsUxVpqglVe8oDj5A0ebmrgA5eEm2wCe\nbAgef0wr3a4+7zJ7o8FFkzQayuuQoju/138/1WkYfAgllHW7g4fq6tTLuIAt\nO4Hr130sbuVVp4VUhSiufzuPfGL4iod4MpRuqnRVAC1OuAqd5CGMV+5zaAAh\nNYVlaX3Emd6gt35IFL7EN5eBeNhHeZe6XTpYMXpcnUhJVNeOu0FobmT86XTg\nScl7h6+TKnnjlqROJpH7wLCMSxOvUlNM0kHdCG7DsMtcfi52azVYly0QUW8c\nYCrPnIYGROSyTf7/oCNJKy2i/iyYtz7XKzd2YnVkIKc7t9TMtHhhInANIY3r\nQ6OjXa3llQAJ7lFU6+BTlukAyiO5P+hxjvCWckhE0z8xPwWDGv39AYlznIeo\nrciakBv7sBLLYku0GFjXk+ikMezo7jLT0mXEboH8jzGh9sLgQlWWkleTfutI\nFME1G7H2JMK92+p8JXQ7B0tdDkkdQX54dcKUMWZlOZ8WlczUTKo6eWX5RPdL\n1PYMBbYRnRCyPrX8T83fVd/hhLXk1RjY3Vmk0cmvxUYy8Vc/hZPn+yVYxg14\niEI0\r\n=LnX8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDvZh6wGBgkFGQgAw6rGGmn/U6XfcbOYS/bAbFGbukOrAiALLVQ46NW3bb5M5VFq0Uy2Er3tbvjgS5urL9iIkt7vlQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.13.0-alpha.a51638ed_1541003063758_0.3225655858577765"},"_hasShrinkwrap":false},"0.14.0-alpha.92ec3c00":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.92ec3c00","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.92ec3c00","dist":{"shasum":"e88d81ee81c43370a2725436dc89e5d206bd1607","integrity":"sha512-eHaPawwTphptXntap08mWEJhqlpCx3MCUlFBN01QNhligpInb/51lD0M6japz3qwHTosTTmYomlexIZXv8R+qQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.92ec3c00.tgz","fileCount":22,"unpackedSize":16650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2elKCRA9TVsSAnZWagAAcREP/iqgDQrj6kbVEpeJYuHP\nbdbz0Rt5CPFEu3tAo78FHo4dSm/sjIyaulRotVsy3ZnB53nnJqBaXnif0VYj\nYuZZbETutBp8spGiNn5OEcUmbG3CC6RjuvZ5riBEvHfWY6Py7KwXGX2xeEUy\n8TqfRD+2fv5b2YbPhllJZ5Xgfx0c+5Vuhax6yoTTim6XrYiBb5dZ1pTQEVSK\nvj9SpO/GN8iaj+1d5fdTbYHSGTDPL+mPn7n+H/wHm0IxRtvpqC0IMzqAUcaY\nh1/Vl3T7ijGeKOWWZr1rnSUwACjyygVi/pSon6zfcP7S91UHc71wbzSrrGUD\nc40hMqkup0vDOmPxUzSKsylIrw/PUu+vtplnH/S3Dl0fhZABZy9FTBnbGNgh\nUQo+PuHA0dk6tGltYnX+zM+msDkePpNE7UH48AnLtyqSOSZdV/32pEUUzKs2\n+krYVhd4t1QmTZ5pE8Z3D6xOKjh0infUZgBMMvcMxFsPpRFw3aVUZSEp1cKb\n3kaazF/mAiiLR35PHXUZoDUokguelreHZGe5m9IzTDS7DeTHj0eEUXPjCqY3\nnwBPTjVXcE5IbqzaC/WtEA5ytUTOCrDcNKBzkLPQItBZEUgSSlSB2odZc3N8\npXcsBxB7bIhvQKPrbJIMId+XfDm3A3CX+ZJWO/IlmUj/9mQ5yihWaSR7YJGL\n0RAW\r\n=FT9Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBgK92go90BqOS/RPfFCUdMnkxErIaCJLK0/lKgfCewwAiAOLeygZZIOEcFMn12pv2fTEvWj8v3ljfaQgQFzg6xqFA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.92ec3c00_1541007690100_0.9809716297767479"},"_hasShrinkwrap":false},"0.14.0-alpha.5aabe967":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.5aabe967","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.5aabe967","dist":{"shasum":"bf74997fe274acd13465c299ae6e9f0868cff36f","integrity":"sha512-fRvUXdtGZb1yZ5ZeSW4S5Gl9HCyTjssRdJLv6bkQfYFH2z/WHukK38rjCYFWjMz6fl0tAYCg+YyB8Lnm1UGHFg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.5aabe967.tgz","fileCount":22,"unpackedSize":16650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2enUCRA9TVsSAnZWagAAthoP/2ljg8t951qPCHMGadem\nnNbGzV67iTuS94mzaF506TKm1c9eKm2gPRYSTKuZH4cbupX5ezGpa07APqZv\nHEf8w4RvcADoxuA114ZyY2LEsHmf+kkoqgDF9tnWmakLJVW/d8w0PL9BCVXL\nHeN355zVVekZdzn1acD4/SmZu2/9+BwlZQXW1puHbkTiikXrVlA8sNVvVW7N\nYPoGvDc6tNrdT0n4B1f8+LTdAEFRagTNR7DBeJRxnBz+FWFCE2oPe6UUfFtN\nVkkwjCqvUpfVgDszGv9v+HkmtaiXejCcZ1ODV0RA97M152nFplQzoThKRk6G\nakFoM+uvagmIdj1OVuQBoebHSHK9Lwogb5q1iZbpHFEQR+caPPyOElrombto\n4JLmJtDgG8Wt7nWnCGLsvidoa/Nm87ZlIN14gGxMHRaAP3yP2RybLZGFkiyf\nMC0Kcg5fsN4oBRJf1JD5YYBu7gQfyF5xhk6uyAspCljYboqcLx76/cElfBkY\nIOl6G+MnyYKYHUFz06onSzQFAg2MJpXs92/rI6PZUbuE17YSwockWyOfM+UY\nXl9b2AtJN4svYXI2KUmiDiVs4EF+/EZDuATeTkV9FzMar3jD53GPMTXUKIwT\nEZQqgmQ3UkU1VSERL5C+twqU8XdKmJnLyksKEztgmSQ1bax7SX3CIcdOW3O2\nmcj1\r\n=dE7u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBk86UyO+lrl/WQoFTv0A+nL0aNM7C9l/VcAt4mhZQu6AiA4SXTsLfZKCJ6wTyUHOtefG4U7m33c9Gat0DJAdvwMFw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.5aabe967_1541007828203_0.3576324967032265"},"_hasShrinkwrap":false},"0.14.0-alpha.7537dfee":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.7537dfee","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.5","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.7537dfee","dist":{"shasum":"8211f0e8e726da597dbb04a2d0403c2137e95b45","integrity":"sha512-d/gyEx1/x4hAIAUoCnHzKaUwQsoYCV93VObmyponEMDmDhu49wIuCGSOXEZSje+Mu9THkyD4foZp1y8ZsPwOiQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.7537dfee.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2hUxCRA9TVsSAnZWagAAYmoP/277qtheaRa09Yn2oFBz\nFp0AZMWYpZFgoj3NHYKlDvftqo1kcYkWwO4jdbRgi3bC8O5V+sV71Mz+xBJN\nW91Zb8Rtth7LUzTpLBvVWKhgcD12y2j+03lylFqP5c0RQQIEsjFZMPc58rTV\nTlRr8eJFptISQk32QTwqj6U9y0wJzR6+mqfomWE6f865VpUSEVa/QwaXxvSF\nZFerIxs2wXwso1SZZYK+6HFOt9FLsWwFnmMjQfsPD761Hzy4F2qo1MBhncID\nu7eL9+2D/yKOcQt5O4SonidWGAwH64yz/Hkcekcj3ZoeEBw+CrdwNa+dlYuL\nXtY4odYGBAEhZOHhL6Ua8qwUGwvmEiupKOpue47MSaU1BrjUpHMaFo1CT5V7\ndn58QTRBUCO42W+xtYJX6SNvefJ8r8QcYaM8Ad+BoF7f5zIc8J1VWGkVGS2l\nkETK5Kbu94ZnbRswc2wp9Ex40RU1f+RznA+tC0BeVezkTlAeNPBM7rgVzAFF\nRzKMK+Y8DU4KpusqKYlSSn2REfYcHrp9MTrwTRUTZL4T53iyXOb5bYsC7bQa\n+tuVeXO4YkdlbeNymARQd8IxJf7TDsaj7fq16cuzFwfNGiJvczIto7RthikU\nxVhC7gnjgmw3wOswRClbGNi3rD13n9h+7ZW1mzCzKf9Mu0kQnzftflDXR/XB\naZIL\r\n=6osH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3lCb1RTlTmfDjpsuViwxoCvX4Od6uE86douFQLjyTBwIgQIL2zpz49SS5bCL81pHoeyiRpRVOBxRyyTmIi0LHylU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.7537dfee_1541018928809_0.9189983108931892"},"_hasShrinkwrap":false},"0.14.0-alpha.42a7054a":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.42a7054a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.42a7054a","dist":{"shasum":"36d8091572c504f31b3b0a5731a1bcd7e7e6480a","integrity":"sha512-1zYX4cxD00azYdqL/woFALoCQ2hZYAbzWxfO9puwDY/OnfyCUWV1hdY+Mj/NkOEa5qP8vNxV/wwJKIkFjqdvZQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.42a7054a.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2qWOCRA9TVsSAnZWagAAav4QAI9nGwgrixjTod3Qeyxn\nN4syOuYwRLEn0UctW7jHj2RIYrsLQN4SW+0V95+kptLTL6HKUkcU9M/1PhNe\n+jFV8j0kl4ZqDl1WUmnHFQkYnO9VuvfizNwucHHA7/0RZT2TkdThgkLvcV7W\n7zOSgLQbjPDAncxKbg4eICb90F5kCnlSNItby1b/FVzv8rtEGqip7lne0ZH9\n7h+CBDjeCo/pf2AL/Pz8lxCJXM7xQjesp0vCbIu4uCgqOQ/I14tV6pElZU1g\n1ewuC0jNfqqAWxDw4zHR6ZOBm6alTnz+Z9BevKA1tLrWTqqYPOhUT/L8r/fS\nMAJh2WqfRJNcohHQIrUY0kDPn8ipCyPIqbdJPfR15LPL1kdzdpGvTPBVp55B\nQOWFYzexpp28Udr1zrf5I5NSjZgTrZ3iEqjtpRuxYH+xeyxbsI83pXXLVoR3\n9pmOxNQscf+CrX2Zm24Rsyz1DyOQ/eb7bUhlKsvlNta/Wu0FO1wsYAvnv/hS\nX8jig+8QwbM7FN3MxZWZpVbwJVVgysVxgY7gwo7q693lD8OkiXV2XhyiIn92\nE7LMj6smAHgGEuRxLwFBftN+SbI4viGBYgeiwDvL+AGnm64TAfWPVj2dUb8C\nX/8PYhHh/zVgFGZFjxaX8SLc0XnYbC8YAARz9rUvngtEm4KX3QLAGmw8/quR\nsAha\r\n=gpNZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAS9dbYgomy36sf88JLhVWq+N3F3NGqSrQjtMJQrBa5vAiBScQqxdf17n4tTbQq+7n+oMQHoHbyNUr7I6J5RFWRzvA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.42a7054a_1541055885980_0.9846380825527006"},"_hasShrinkwrap":false},"0.14.0-alpha.13706952":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.13706952","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.5","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.13706952","dist":{"shasum":"268cc8cce192eaf961e694f08ec9b788b66f7c67","integrity":"sha512-hLV7Mc6oocCUr2tF8yYxmTwYxcYK58UvAbRVyVM5F1DCt5TlAJW1SMTxKemU5e8+rJk9Xwjttm/+rqwkJU81Bg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.13706952.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2qW6CRA9TVsSAnZWagAApW0QAIOF/nFM+hTR3ouzjlse\ni/rYodJWMoDKIHTIF7q+B59MxqO7wnGhS6xrvOjCMX8yqy5+FmuJDS4WbL4P\nzh3k8LS9D6yAGNI9E/S5L4kGv2As81TqYUyVcBnlRwSmjfABKA653UwnKhYg\nVcQiszpduOwvZ8WrtH0vBUv/VKWkSasn/Y5rOwMUUjcEGeHurVSDLP0GwVF3\nlMQKtT2PWZKE35sIMPfOiGs4riq+DN9KQlUAnDREckiB9ArNIaELeyLj7tna\nGk6kCUtC4SXao7vQCxSxW+wqMUmdB02SP3lJRCi3m/1USdyNEFig4LhoIhPh\n5SlNNZ1vfqBZKFgVcFPtzouhfeN57CKT79v2pUiKTysxtbSGus5+oCZC2xdy\nrZkXfLeBIpgwK4d+Yp+RofQtSWHG/3FK2EmIOAzWSk3nE4Potj3p144hTiw+\nETRJ/fIVtnhXkFCRwlsr0hoK0quuUu6JWIhRP17C4upgUjZ/GEzhlWLV/0K8\nmEINHXp0D46bnEN9o2LvCA8AssEJ3DVrN/cTQcFPbpUN1SWMr6U5EKBgPiiu\nT6dli5lJThI0ACNyDIofoHJfoUQIYiKw0zLMM2SrqPq9iCClhpPxcQgp3SaC\nLBM3h7xo4b2HRqxAzO16nBnBQ/13GePjoctX3h0qZCq3zAmqJ+AsQbXyoW+w\nyEnz\r\n=06X3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDv9A9RTDHtEaqRc1RD2/Fnk7CqUCtSe467z1NU3J/SPQIhAKIDkrLns0necOaenx/Rw1g+LdY8BCVzRUmAcpqe5eHD"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.13706952_1541055930219_0.2929281426878292"},"_hasShrinkwrap":false},"0.14.0-alpha.b4492c37":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.b4492c37","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.b4492c37","dist":{"shasum":"7a5d94afc48ce3f65523b9275ef03012b77f51f3","integrity":"sha512-398BNWRfp489PfFXgTC8Yuj0lsx5Rl2MPfsjoDZxMiS/LH3gYgkiSDpAFr9I3g6m4GlWY7Ew8fUvScVKXZAMIQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.b4492c37.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2ydPCRA9TVsSAnZWagAA0ywP+weHX+dgQGZX7SYEZyiW\nP7k4NiPAPwx7sQfM9yO1lcmZ8yAyU678C8ousP5buU9hK4VHjV5FuEu5c090\ncqpT/dv+NqUMKv0gDHIAC64up721DmCh6VAkvvOTSaXOgaevkWmT6/cJqp3V\ncBO9WgUpNJ5R+6WI0u8AY5aoON/pUmr04QVKZwvTeGbSFT0WrE7ayNF65KhI\nttOEzC6mltqaT2ll4Et2zT+s4UwdHT3VU17UV5gAMD3ZUNkVbZT40AhyFZoh\nlR4fPXOpkUfbsd8POxf7sTbkH5WVJ8DwEFQa+CYWDc3uFgkLDHEVtGRgdrIb\ndjlFUyBeMQmszCeyptctECHRk7hF6eZfWWSkw5H+gf0Opk5k1fynfbhchxif\nMCZap3HL6PpLCdRfo9qPuB4wjGBsdZUWfXKBHPivcwTMcLfyDaw4XGZV7XLg\nJHNoajDRDLd28hr8zK/LhwM8j5j9hOvpHbkW5uowlAc4KVZmXt4tn5xTt0qI\npujWbhjzW0/h4+ROnKTVZKLAxrITqVu9XkaJ74udoiT3NgV/utD+5Vwb8Y9j\nI0XAHXJbXxrk6z8T3kYAID6keR2QzlaneZkeN2zeIY62CwSTfgeoJXee+FDf\nlskpTqCxFS1rTkfi2I0BQS4rmkExbBEOqahUcqqI55AclFBbHV90ZDyItr1L\nrk4D\r\n=HjuJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgtbKiyk7vbNRRDVH22Iesgxc4UFZCZTkW14LLkO1h1gIgLBO+DOXsmM0QW8/Wrn5j2sGKvYYA462Ac9znUxTZMq0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.b4492c37_1541089102954_0.7537830458230683"},"_hasShrinkwrap":false},"0.14.0-alpha.8c647ccd":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.8c647ccd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.5","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.8c647ccd","dist":{"shasum":"635b8e758cdd2e1e49ec37cc14f7673d2b44c702","integrity":"sha512-Ksyisc97nEsxGjIDXnLGUTC3QppR6vM1ceqfjLjwVyDhByqM8GdayYtdSMu09BhgoCDiK7DC88Yuthb8ff4Q8Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.8c647ccd.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2z7DCRA9TVsSAnZWagAA7gQP/26HhkqNLNcp26KIv3kA\nFGDp4b8xmhPmKhEOPvjRVboAM049NNQzKkw8TW7/yOTpZsP4ejv4zraeVeg3\n95D642G423vaVtPmmdi9uDl6I0QP82qn80AvWJcJk0suZ2JLL+8DrvKlKaFt\nFxlfBzBbjV/+WxlMpt1bynYCEmSBFR18PzxrBPnb7N4qUsgTYnRoba2bLsie\n2wFAna65zFffEp9D/lQixYsoGy9AEabtCZWxoiCdWgqt2Q0cTlq1QOzK5NFs\nSaQu+3STBmw/nqqgoHyVhaLu98aKe7sOFA2cFUxNkSnmG/AFdCtrI3xrOzMS\nIVIopmjugXY3/Jzpjt2cTvgo31QUeCKw5X+mW11euawixik7Z9NuQLa0YqlM\nu0/j7n3wyhOOJ6sq8k4t3dfzOPxEaTdt5h1kEd/9zBt0n24La/dgpoOBTAIC\nwQOYWQSOra5fKfWp/7drA8zrF3SDriFEb+NPriFLKsbniUlmc5TIQg8SjO5g\n6Jj2mupavmV0mOmhDVtJAw2w/GrXiz805HZ+pjzb4YJLYgN+ryTqTUVOjgy6\nXGaZVRn7W+wnqut2s3LaaagtT/cvlx6iavgx5y4f5e3REtHVhTUt6V6Ay3nX\n9t7fC+V0FU/FS0nqiCKcraON01LTVDZIX+scBGTFT43/5JA4BbW8oDwhEyrM\nNL3O\r\n=Mcz0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF4sTDB/jWOgVZ6DiPOIcXiXl/pO8ZXfSMCnRHKmhN2MAiEAyxaRChfnkwVH0Eqbx1hof3ycVSVePy9NJVvRWJqKbMc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.8c647ccd_1541095104996_0.40136671279940783"},"_hasShrinkwrap":false},"0.14.0-alpha.58a2c883":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.58a2c883","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.5","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.58a2c883","dist":{"shasum":"6843c1deaf21bd7a2a4c436b4553804b7e1dcdb1","integrity":"sha512-jO8PCjcUVovui1pyltS8kc19YpNXbw2vtnFgj5PH4h+5qIW2RUjif3bZzr++8LKz0+uy9iZ+greJaDWOryqEUw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.58a2c883.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb21T0CRA9TVsSAnZWagAARhMP/RO6pMFdYvw6y/abEURQ\n0pAE1PqRpFfDyKA422B9//OXvE08Fnmv8jjw3XhiN5jDDjVMoHbhw2g0Liqg\nBOOmyaDMqCHpf4II/O+NpQtLng42pIXgLX5yTyhdwoOPJhDMOmb2O6Yrsaaj\nn6nuEnIItq5BQHkaCB19cfEZJTgFFhEMwAuf2IdL9ynEgwYZ06ig1CI/psjD\nMwS/sRVXA1nzIQA2KofzmUnASEaO54CTxfgjpQoJBbMq1Mr8MhxxhMYRSQ+0\nQvCbeWHtCtwOIIuWWQKhEFiGKqubu2L/N5I0kOoCkOkgKA/7JZM2fZqtcrVA\n1mbMUB05wt0R/9IuBJDlAwcxXC0Co9Sfcl2emBn+SvPuSVmkFILUOfdvxV23\nwfmYuRykR5ZBr5focTsmDMDwb1O+MP5OE4J6BfB+qYGFN6UmH/su3eNxaaF+\nOCBgpqP7lgXZcf1RZFnbT7SshB5+HisegVq9CDGA+GLcSpPUPrUwrb6Ff9AZ\niBhvbfgMZn4SoXtSPISRqVlv+Q2biMzO26F/JZbIniMz/LyjNt5IXKEPnfYE\nOZF+qId/K0AUewTDu9NCurKW05rJdH5R1uuvhb0hnTbZhUFZ/9+YM8xIx/DP\n08CytIH0ZkCALvM7cxoxCxnFU0UdYhc9knzQEoHgnAFKuJ0138xJydv1R+l/\npUOH\r\n=/0xc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCo7WAXLJAs7HpY2tQuK6wlqmFckp38SavOzzwsw5FksQIhAPgEJBdqvk80Yu7H2mg2GOZ3a3iu2OB9EQ8waIoGWX42"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.58a2c883_1541100787238_0.03238694533876196"},"_hasShrinkwrap":false},"0.14.0-alpha.0292b740":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.0292b740","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.0292b740","dist":{"shasum":"5da781d2292016b697029988adf0deabe8470391","integrity":"sha512-6GTwS/+2ijhc6QVKQw8CC/Eb7fK8H3tj5mi7afnwkXMYdsih/xS8ZrncxjnopNfGdhyGKULX6MSFb+bzCiJSEQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.0292b740.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb23CDCRA9TVsSAnZWagAAUwAP/2/PJKgMOFAZrzUYJDtS\nY7wFdZqvi/GN7+RPfd3zICOKuVbizZo4nYQmqbE9GGoIfSi7XONZlUDDwrYe\nhGtaZUpa7Qa7RWElsNkPd56X9Pn3s9kD5M3SMQYPAujgjnaQPXB5gW3JiXBz\nZ5uZPRcEbm6ke3BxgLqihnv7Ehm98IdwgANoyLtkobp05O9bpDtInGSnEB7+\nmOj4jG3CajWdpG+b18m2r4fLx+smDQr2fqzlUpw0BuddIF4pif6ihzT3ECrx\ncIJq7Hxqiqpe4FBLGnqfRzb2H8ZktUGELUiUi4jVe4EsIpCnfCi5QhnYI2E5\nVCWLHmjGJt/87ij4tY3BVEmNF41aTajVvmCLnsoWy5HM+GUL2YvQ7ZuiqJ+T\nYPLzzlQZOe8YLkY/XDRIVvEAgMjpHpqEknVXUto4kIfQAj6fsZyWrib8Mh1x\nWBt9UdI7aVInyB3XIcu3whZ0DGAmt6I3GQYLL3sz4Pz8i+sIGHQtSRIWbM3S\ngt3GU3wVGqsbMjjg13gYpj8bwfhTbKmRn1oMyZZwwy94n+uq2B/MYjN+E8BN\n7RH8IJTBjCpS537TV/1kmnJf9M6Zym8dXQdn17uwR5IcCbfst5YuvOQ4xCop\nFtMl67yoQn4GNOLreJ3TPHXQWpcnB/O4Xka6NCEYLn7OrvTJg2489XYXrhpd\nAd8m\r\n=g7vC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1Ty0boTqOhUwJdPgos+gxJW4kyyIG7heybuuaWp+ihgIgJyYyY/CFhgoLzB5zJNwm+kjhWSihLBTxu8KLHTsmWWY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.0292b740_1541107842730_0.27518257722734596"},"_hasShrinkwrap":false},"0.14.0-alpha.7cc612f8":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.7cc612f8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.5","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.7cc612f8","dist":{"shasum":"c7d32e13c6f3caa622a33a01016ee7a37d9ae850","integrity":"sha512-mt3kJQYP/D4r+Z3J9yoz1OAPrGRqdfsTTnSR1ECSFEAfKv1wu3uXNKFG3J2CHx9flwNVr+Z1sekiMzsvm++18g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.7cc612f8.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb247ZCRA9TVsSAnZWagAAVt0P/R2TE+CrRoQzdx2eX/2X\npx15Ocs+Dwj60nRi2m0dktaHtREqh3WgNOGKATFxS6dfFrjKnmLU+MIOctwv\nv3uQI72bKRjuAg3iRYkVRCh5GwCuUe5LFGoX8OiWGH2z3yV/ocAmapYKsZmv\nhN9VSify9M/q+c0nmN8vRZmf36h7kWdrMNG6Xf9vxyj4/pd8HDlGul4cS17C\nGwQZ5ATpxTaF3r0QxqPTTDR0NxHCNuFX/pI8aCwprZVeBUZUDlRKPXGvMH3g\n474mqlqHKMcQt9HIqkRWs0K88Ax5YSSjhDtVqhIA8pneKutQIrdUR4H2Pz7i\no9Q78Oze7J+26sKKsFBFdwqRgf1eM4VbQn+lPYxqMP9iW+NIqFhiIYnpsX73\ndSfPIdMNyUILzCxWazyHnR6j+mZE6fa/FQaD87RuKbfeSxS/u5ZYDkyaQ0SM\nX4s9Wr1EzFgY6li6Ey+vOuk0ssr1CNYyz0e5uNl1/06RRNNDAR1uzegG6hRr\nIQTQ1+zIGWixH2dMd2dXqjF0tC6VZLbwq2QU9jmygCgreteUDuQgP9KcM0ns\n4g1Y0EHqH8Sj4LB3qKcwyzkaRqNx9vs7/CeFPqUDZxaryE6uE4n+6CLAbJcg\nmtiu2rRGCyHvugNenmf+XWeYE8NSCdsq4ryTRibp2buflei831yWCnSy3pJ9\nzzMT\r\n=+5ih\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDj+cqEcLAQkaJ8JYUTUPgncDLfsMzdtQaQCwRdxoLwvwIgaJQZ8dUQJE9OB3ASJVMtPmnRZDxgALYbKGbVFuaXSLM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.7cc612f8_1541115608289_0.828658371536801"},"_hasShrinkwrap":false},"0.14.0-alpha.31f55221":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.31f55221","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.5","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.31f55221","dist":{"shasum":"910a64fbd53a58b1eebf6de8387839c5b589e524","integrity":"sha512-ajIdUwjEVtug2vepwiHaO61/byyCRdzvrslQClf0IhtiQ/zJEntlKj+PK9adegSr/+gA6y9Qpgm/lumQa+gN8g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.31f55221.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb251dCRA9TVsSAnZWagAA2KIP/RJX65GuMSQnrBrK02A+\nN+YJRq70cnLChw46b5lnV+iHZhKYlDqxWcs6BZigTdfUfiODOsvXqadZUvl8\nyARfaMUNkMuMI76xGFQxGHNbIKBgSfEfQUiyQxOjPt8LPxduCOD4loa8I22M\nkEwGEP+VOjhxaec1X9VYzdY9F1xlUrzBerl+Alu1ecLDtBB3KOvLkBpp49uy\nEvQYF23gbhQWjt8IqCW5HpDERk/z4cAxPJKPK9Z52kZbvQgaUnH4V6Da6VDZ\nBN2+1U8X6OTNWyF8ut33qLZEhR2hnODaPRHaimtu2Mdtkft3dzRTkiR5Mqwm\nyy2YS6SAEAQVDeeFLQ6e+bxdmhgic9oVh6nsfRbzsBlXDy6jSbaogz4C3kyn\nhwV3inTkIfrrTIqSgKuaNx1RUdgtWY+GrsgTqwA+D2B9liERcN0UGwkYaZYS\n0fXPby4AigX7pVR4mMCrQkBgDyDa0pHpNoT02t3WNQeyNmZDZC8LHSFEoEO0\neOrwbuorihhe38v3l81OyqK949ObyY3xt1+K+pxBavqZ8/4/GC0nugLGcpTg\nZDw059EC9kTeDtjg22Qi/2qJdL//LY4ET//ieiHJ6hRTrM93AW7lJ0A4KPYG\nc530PrcQL7VVP0j/JZFUDvMAoPYa2FPvGHQifQJ3/EBcQRNcPCHHkSaeV9C8\neuVX\r\n=n9Kr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkd9drOz8p96Ezt+liMjQg31VEJVWyfpA4Nt831vanbAIgfm7iaY+fCXxFwHgLdxOfMykNntaslmwzBg04BJS1ysg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.31f55221_1541119324524_0.8352621149204884"},"_hasShrinkwrap":false},"0.14.0-alpha.2e1219b8":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.2e1219b8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.5","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.2e1219b8","dist":{"shasum":"7e7adc55aeb3bedb3a881da852171b03089b4dfd","integrity":"sha512-U+7D1CCLE3ImET6lVT4p3x88MZQ0beRmhJWpIswIM9EnAi7gJJ0Aagj7as4GITyyLn0S1LMtFjkhg+MaXHnPbA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.2e1219b8.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3AdmCRA9TVsSAnZWagAADoQP/ilQYJ3UPtNCPDpsz2nb\n7jcKctd4lLIZbRpx9x1MM+aJNFMSuIQHCXWCJ6ZO9yU44holHGEGp/ruVlE+\nHoIjdMs0PW67MT4t83LLWhUM87fpt/dalEmioOfjCzfhEcDDHSZoJ94l9DG6\nmV8l5YWszZKb6S7olJSqeNuRcyajQidDREw5GeIDpjDAAcgLRxDjBUmLKMBP\ntBCtcylqPqjtTIBOUP1hnYcMD2KpgkhMWC41cUCroHlNI9CD687zfgAgMOHP\n7b8mbC1oyQPPs4FctEZqd3pwm2Z0Uor7C/FJmKz+Fp1Vst4tWvwvyLJUz0tg\n6Nf1THuQqWtgD14lk8ytcmO66dKuC0tEu93rkhvlMBHNPp8poJiLg9bqyZuG\nLYG01pMp8QWi4CO+3+seOadwuVw7807ZGul9TQxDrRgbKbmyx9w/cSzBGczi\nrakz2MuQb7ZqZCWWgiDGcAvXpVypp9MGYLdivNgWyDH7Lxg3GCG3PIIi/0kX\nCW+CJxriVrz2Qo8aa83PnUpxh8SH8by6NwyCShBINtoML5uR72KvTYVmynmc\nMoNzLdEJ5eIrOGmtQ4zYhG0Mf9ko+GVCNymU1s/7k+4fkBd/U9Jd15YOBc8H\nOdVUp/CofkBC5kgnT8EJ1BBxpIEhDSuze2gAkLmofGKFtfeXHIVmL2OmMpeF\nwngZ\r\n=JR0W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG2H4GsRWQd76iN5RyjUp0bLFJAiAye3K66fPzttRQlCAiBilqT+KTDa2o664v06aR0mMJ4yVE5+UziqQ4Lo3DJgKg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.2e1219b8_1541146469591_0.41269010477767654"},"_hasShrinkwrap":false},"0.14.0-alpha.cd9a7e57":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.cd9a7e57","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.5","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.cd9a7e57","dist":{"shasum":"856bd44fdade0efbc6f1729b22723b890be3365a","integrity":"sha512-yIaq4dxhWce7sbRd7LB3j4A5cDHm4ZdAfYKRRmVvTN/tGV910Mw5uuXSmNzpxBvnslxqWS9zoNeROZqIIms6Qg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.cd9a7e57.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3AekCRA9TVsSAnZWagAA8tQP/jt0VwPwbljmiZIXAVCu\nKmi6N1cfEvy5xFUKW9/oUs63W7whuEuyxYKkJhCYsmHwjtMd0oyvYWovHtqh\nNTbamT873ZODGe+92JRqpSg7FQODGOwZBbF1N750UZkVD+OxDOEqF1J3Bvsn\na2zjgYRTUwxSkUtoWgtDtfUueRASgLiJs4IH7Gmbm5qazPeamZ3A1aoxETtt\nw9l7DAYFnuB5sPIAnlnKmS/gK/Wdt9uuzWpz5gvbPAQIY8I9BqTIuqBNN25U\n1gyV6dZyzEUCuefsnqgslSmhsNYDj8BVcVhbRpM+GgChbzIxZdhxswTbVBkX\n0ijYsmvXuM+2rUHuTLsu9udyt7ScVuhR6be9ick2s/jmMT5Ipc7bF635VBJN\nv/aCo90DUgK7G5Hzpu65Sbmtbg3frJiZccbkATlZ6fSfq4/7SGvFv+ADCqQ7\n1x/GkPbWsK6uF44Na1neywOzm8Mxpkqe//0eE44K+rev3giATbkHJ3gjHObn\nZu4CX8rNHW5o74eliI8WgRVf3JQuyFKb6XJNhKqUAFR4hqO9V4aIsaXvafTm\n/rKee/8mHJNPGj9pA3rXHjAbDFk5WmafwV1MIFfhq/ClEPLkLhTt5jGe2fV0\n4VZsWNB3yq1+Wc2U2FGu8NsiFWoJkLVThXQwTWZsLr3AA0wNE90fxPwZ53OC\nFAJ9\r\n=zIVb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGq8ACLYVWQT3QrdECEDR+VspjeEn3nvVqLG+Xlasz7QIgLlGtYYlfULc/EMPYxkS+Qy6p8GQUXDcjx49UcRVSGoA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.cd9a7e57_1541146531700_0.7747084327537204"},"_hasShrinkwrap":false},"0.14.0-alpha.6d918651":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.6d918651","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.6d918651","dist":{"shasum":"2c4a14f84a2d4a602d492ec0222ce7be892058d9","integrity":"sha512-3xtOpNED/VvB9AEsPjULcE1xWhsvAsW7zS0/iYLZa6xRdH8CFGZYtfcuiNrJbWsVCKomdPQJL5skJJ6yvb3DeQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.6d918651.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3AfBCRA9TVsSAnZWagAAWKIP/A6yEEE7FEhJdNVzk80V\nn7bLCJSzOsAxpLkITmFRaZR+qaQp7LEtCScIWoKlb9qNBvZUMWUqaipm2ok/\nA+k93vh2UWi0ZwdQmDSgRlqzKHf5mTX3/ARrs/lN9mp50yv36p3fTXPZLGwX\nf3mLK3L/eQMK3ZgnYl9opK+NLaLErb1v8ehkvC77KjMrEevqc8J9wAFSI0OM\n72/LibYXQSnkXZG6Sn5H6+3jwDCRjgaSifUWwFbEkqGEDsq2uklX7qpTmjfh\nakto7WI0nb4gjOmEPywwyNfOryoGHcwFTUt+n40kHGPiOKtqBZ2Dx3fh4sjN\ncUf9V07YM46WwuXD8fwN6O6Zqro/ignrT06mJrqFGbeOx7CVqpybHvYRj2Jf\nBQUmgPOUw5NcoZ5c49KDKk6Bzjg+Q727ZL9Y+t9ab8NdfzO9Zlsofu5aK33G\nRzo4v0NvpHhlT/bm1boeFx/92qIKtojBJAWJDmoK9NyzMlqBYtQViXuEuoFp\nBW8j42q7VwtFGWEPA80H6j3nVfmxP71aaKxb3J0yxLH4LwxA0FGJSpXotqo2\nS0Ga9M86488+LftwJg11gzc2apvyiemf7y+BnL+c7eJWh2wUiujLneHwN3b7\nAwyFQwxh/i1D+2yde0dWdieM28JKLywaC/jjMg8HkxaDtEVWZyY9hggbxhia\ny2uU\r\n=nrF+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAjJKN0TkV6VIDyMFslJSR2cqqGxLH4NG+UnBuELac7TAiEAqu1g55K6GWmMnPwsZ0qYfMkMYbWyi7/8o86iL8jTA0g="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.6d918651_1541146560852_0.6461541702250744"},"_hasShrinkwrap":false},"0.14.0-alpha.12b4fe0e":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.12b4fe0e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.12b4fe0e","dist":{"shasum":"60eed793abf7bc8ca011d086ce57d55b32e3a708","integrity":"sha512-PAL75WbYSAM1RJDGFcUvgTB/2N7rCuXUC6YI6fpXjo3hjJIrzjDbGNNZZic7CEB9JbaVumr+3OvddunTG1+5lQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.12b4fe0e.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3C6FCRA9TVsSAnZWagAApocP/R4SO/BFnwIlTMGLL/RS\nXPIEB1bdnCrSj8yI+ClvDg+dqB6xDPxCaFSxHdutEEPkLQ5tXb7gsuZ+XB8M\nYGLzFDFEv3yVli8avWlorbg0gEI4NvDrkwAoAn1aLJvjdsoodSep1ZTFqdhp\n9RaxjMOX9GCbAKpI4PBnjIauL5ls0x2l+RhzFCyvZ0CKXRULqMXvT870+vMT\nD3VTLU/7nfvwTQLLlMMpLjlVi0VHjlkfzY/zXPNozOsasZdmASVAJ7HYrbLt\nlXOhaVKG2c3uLx4ZK+uvBNXeuye3lQ6WRMdeSa64ovmCJsDp3tx5SBpBSIE/\n1LX2SdgCCXXYfoHN7dNtzGDLVJKoKCY5Du44p8WVVo11mf3alH3xiF/TUoeF\n5U05c5+pkFL3XnsWTt4LzXWCNlOf1wnHK6NCkF/ENRL0kMWpyRlV6xzM3jSb\nFh/PKj7btdxSTY0ooZsfPON13orDMWuncilFhPLiD1vqbHTCDD5+EgK4CnZD\nCrG/wPiNn1W+Te0sH8KzxgFDA+YcvN3MrFBRtE4Uizy0MB85mymq7qj15YoI\nSrXcHuGyAmROKyiB+Hb09okbdGhkxDIdXwX2nrC90UAf5N0qb23Dh8JCAH68\nL67pnndgbrekphY6Ofbd/nQK/lMWjVt1ezRTDwnZKUMHSkBAg7CmHaVD3FcR\n+QU+\r\n=3x1e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBIL0EcqCD9BXFVtjq9aNAU9QFezkO8FCdcd/fboaJkDAiBwrNtkE8QcsdgTHCgII9oVbCjU/lsIkAGnR9HhtZ+Gyw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.12b4fe0e_1541156484309_0.9896509062580781"},"_hasShrinkwrap":false},"0.14.0-alpha.4c605fc9":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.4c605fc9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.24.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.4c605fc9","dist":{"shasum":"e6dbd9bda2e394e3a01c3dbdff23f8cf9c25d294","integrity":"sha512-ejbPQzzwkfu4MeTdt9dHqjTpK3KgN4MA2JE3PPSBvyesq+7BORBlY48iEGzQ0Hebwg/m63CdDFQ8Qa/zb74YDA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.4c605fc9.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3EP6CRA9TVsSAnZWagAACmoP/jcBrHFQyg6x0NtHWh4n\n+ujUqMerIYvyo9tSfyzUn+HWvHIPZ54ITi5iJKUiLZ3WMUcbOa4KW4ltE0fm\n3EdikGch/pEfBbIpxxraw5NoyosVvWeLznvGjE+yN1fRx3KpOgI/XSeik9PE\ntrRwf/YkNCrjaCAJpfaTIJt79la4vclHjusnzv+uv2qeQYhZAPTx9lPgcbcT\nIiCEn0bpRmGRO2tUpfm5RBWvc7hsr3f1TIxQBmsyopscT8HPqvRfnRBKilTt\nsUTCjIFP0in816gxM3Ixj/UV7CZTm9bSGBqBrOUCQFl2sl+0ViVeGrF5T3Hk\nUSYf2qB6I/zIivtgkh9TQgYnhpc0QsMjp1aadaFx3/6/14hC6yB2ZLJ9MJc1\n7UYXEGJJ+H9VZ7IQS5g1cYd/fndvCTBP+sIXemapnzlWoFGcwn3Roqp1dT39\noNdbA0p+8hS7TgFDn76nIUSFDeA1yIO2u75yGEf5P/uRrQfQYUr70fwCgW6U\n6avCz1JTo+oO7vsBCs+HN4MoQApf4SHFStMu0r4dTHyV81zH4kglLqXvR2Un\n4Rk3P3r6EQq5bHJGXMJOZfo/Y7Doiog/FWvPNSVuOcQzCvd9uW/p5oM5pDla\nuj7hgMPEGsKcNCad4nGJH1vNfqhEzGPJR3ObZjAb+DdntnTtzyHaKm+z8g0+\nUU+F\r\n=fnv4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+/TLPIPSA3FHXwDicp0RHrra7VXP22XgEycM8YNMZngIhAMKyTwYztpKQE+mxw7KNy3SyVUShs0zPihNXtbBMpadx"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.4c605fc9_1541161977240_0.44875933596913287"},"_hasShrinkwrap":false},"0.14.0-alpha.45c04164":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.45c04164","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.24.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.45c04164","dist":{"shasum":"7a7aa21ee242ca70b659ab485c4fc8678aad8292","integrity":"sha512-k4kM/wmGMCqt+Qo+K14xzVyxJEC20vmbjlqHW0EVNf0ARul02em8JL9g/trJWwDRVdKFSZxZHYa8BPPSJ1SsAg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.45c04164.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3Y48CRA9TVsSAnZWagAAxogP/i6ZhQG+a61rVIKzo9r5\ntsQkiNyEcMNkQR8qvJa2Nl+myX6corlkNje1SP3yz5SYIFu4H8KKPWDHINBO\nORI+89C3akcApzHRFyIfCSrc2woh6BntcPmu+g4zTo+m3zzM6rmrD2R6n7a3\n8xl29lEfUJr+3ehW8BQy2vTyhHDth25gM2dBfZjzI7WXpkraYaxGGvYP713p\n7BVA9u33H6iCgsbanpLNDJIcSUaasXGOV7Xm+yiRIZbyFqZYEkdptEN3/7ml\n2J+Eon6R0DgvyaSdjEB5HFapkhJv8ebPOfqQK2zMS0iomTcGBFuPHUEsMDlk\nnjgUeDJaflQ3KlcqARh6cR3hDn85p0YsbBsDV3Of/HsLKrQ6CQ5Vsiu7hlFE\n8GdJo345bR8zQxVY7yUNU0Ydk37UvejwNfCJQtbfS9DBmcJMjLDFs4BIwFpt\njAuRkoCowJgjY8EiY28m2tTN0CU2MX5vEsHfW071hqu9iNxeyKb/ctLLzdai\n1S7CiPbMLfKxtK1fjIQNkmy3LcTzFiNCoXQZWOpoAHEvTp3WB0hQZQ9DM3aQ\nu3H9YOSRXnXumB0gYdYpyB+nTyPeiCAchDnuIIoB1TfOCj1nTxZT5TpqxGzM\n5Nf/5KFNMpj/g/YrlSOs2yVCTfu74f5nT9T37JgHK4Zt5HfWJG5U5r3S34HW\n+URe\r\n=hTQo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjbeSNdyJ1beqGZl/Ef25NBF4uiquynfmvjVKT/ukgegIgPeOriGyoQSdt4fHl6wbpkNaaE2yZehfTTBDywi8OX58="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.45c04164_1541246524100_0.6765377162988202"},"_hasShrinkwrap":false},"0.14.0-alpha.0c572152":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.0c572152","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.0c572152","dist":{"shasum":"6b6e716a92e51ec6bb97777bfd9b79de91cc3f5f","integrity":"sha512-bFrGkjL2imql8ToNjFvXAsSrRbAHMj+r8dvelIxoYL5fr6vxXoIfG9WjKgeVfjtjql1bv3uuqXa9XanKq9YEaw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.0c572152.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3y7OCRA9TVsSAnZWagAA8cQP/RoeDfNHDqk2vUbEHiJ+\nin22U241SOJx4r6NQK1k9bXuNoY1burwe9KUB511MRkT9wdJK0X+9FoZ+qjP\nHPH88qbXTYiF5m4avg2ClBseUlbma8i3K/9AR8o8EolKB97zrxZMBuizZauf\nRKd8COrJsI73AFxOgz+ETH5qwdV/ZNQ0cCi9EhuYOh1SP3xLX3AXas4hcFti\n5+MmRHexKZxbU+yCHu6DtILvrfNUridOZ11OsxmEXGzuGvJC1OKrDHbFpcFK\njoOzlASM9PJUtRNLotx4MKL2MHTFb/y4gpOqva5c923jlS7/j24ramnM4BLY\ntdJ+nVqHZCuWiKeEM/hI7nBJuPc1QEIFHAFFZmylTtkBeu0Px1tmcNfAJnoA\niTXuFVsRQxv9ojv5dzln+P+9V+nDB/h6eesAKpStHVA+uaHQxs52jBsS9/eH\nAwoqLp+yFP3cB77VGWLEgKlbxx+Y/sJH/T0s3Vv4l8jAwduMRlMkguo70SBO\nucGyrzphetiybMMwN+xp+P07dV4N1k5WWtHK3NrA0fxmypHfEwVQiQ3mkewi\nukiaFLMBhIcUN5A2scpa99vq/bTUJZtk3MZrg/MHXJuase7l0BFcPpe72let\niU0NWzx0IGcw+R+57CuX+ULHLFjdHeDoK3UTdI6MXaQQ/apJuFzMX6tePSpS\nopIH\r\n=ygjo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDc5pfUhBv6ynAp4dR4MhjURAwvsI1FDgU3eWq2AA8QyQIhAP5A0MbCHmg0iyzZHjX/jNAmAm2rfpAJzOHMNCOqw1g7"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.0c572152_1541353165273_0.9535886305674508"},"_hasShrinkwrap":false},"0.14.0-alpha.150a7582":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.150a7582","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.150a7582","dist":{"shasum":"ed4b974b116d684849eea4914b5ecd7ef44a4b66","integrity":"sha512-Gl9EHtYgUDAI6JrQ5RcHHcwWBkw5EqefFe2C59zD/GdEIoYYXx8jNrkbHBGMmnFBBrV6l4vXCW9gj/ndjRNsCQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.150a7582.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3zLECRA9TVsSAnZWagAAOSgP/A/wW4Lrq1kT+AxQDwSJ\nMYlhBbzLBUVULyg4t0BKeWwnwU8lxdhxG6Em13Au8QuyOgGcfVaWbjbKd9gS\n/hlQRDWkGuXTpKN0r2EtGw8GweobSkRjfZUOlt8tyhSWcgHALOmNnWwxAJV2\nVkdNDy01N+FKzdUqCa89q8OLUtCKmuMRUv0DDWp08dB5UNUvJupJJwM+Hqio\nP1Jllgb4+hXoDWYKQI51I6RU2NYu0VNPWXtnj+AxWp0mt57sKmAPFH9GpPRo\n1U7/1oB9L5GRyY9+cQzAKMbqZuU02q2o0wYwenT8dab1XYFHkYfctEEuxcol\nSzhDkq380VOR64xRHgJlD1SKYmDcddEB7hrQiNKaDxL+vqGWl3SA852+uXn6\neQczkcUcGPkolhn4bD0AeQscEXNI6aW0+3i7zuetvaxXCMcIKIEAlicwqLvE\ng5NhNP2OAKKUdIxAKd2f3bdGjwcnfjjJRI8HdnJEsby8rtN4YgWzQpHXmncK\nLhUE39z5KPgDag5wDEMwKpN+k0GLD8tk84ufDUwyDCmpNwKu7JCLRveZThDw\nMsCWCnK1DotacYgk77NlPvpbN4P6lD5u5JnY/x79hdLUX4Alq+oliGNyyJUv\np2FBmgS77wAiGUPcOreYYLkr81pjQ9dSC8hDz5j0Dg0Twmpr4QDZJzcbJI5s\nVGSq\r\n=TahC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsVNdz2+hxU0Vs067LQNHfy/NCKEwIWb3IIfuwR1psNAIgWl+Um8RqFOeEmSgt0RiDw60fwtzZ2EDp26/JhJdaIKI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.150a7582_1541354179967_0.5647785365575138"},"_hasShrinkwrap":false},"0.14.0-alpha.cfc8fe47":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.cfc8fe47","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.4","webpack":"4.23.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.cfc8fe47","dist":{"shasum":"518a4d7618b7832e3aa410b98f91583d53a84092","integrity":"sha512-8Rxi+nUw0SlhM9Mbhu0bE7paDSIZ8Ut0LgiITRCzOWslMneHg+y6rTmgzlgnnKaeiiIdqUW1ZRy76J2xxURTNw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.cfc8fe47.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3z0hCRA9TVsSAnZWagAAZDAP/0C7pJhXMGqEPA87mzYk\n+8MOf/IXeLuCpOqnMrcAL9Bt4EWpufuntvNltngmpHa24p3Tkd4mHXKWJou1\ngZvv9NuvWK+hWgU9IUkriqgjeMK2pI2I6EYmz0JIi08RG4Jr/KdeIUUREMlz\nW9ntD+HAQVMjQ5AyvssQwM5A9s9d4oNFNSuwbgBGq9UcClQqUi5/+1Y6QO/I\nz4R7XizllgA1YCURFjVIeCMagCw/Ap5X8UjC2fPHbq+R9SE4MgyNcDUoBsar\nR5xZ8aqjcfNI+pf8li8knKXGunnIAiN54zwV2RhNJzKD32V7HoKW8PxTdhxx\nNKWaZBlB7EVxsMX6kL83n0SMEiOxP6IyNzTjIc63B7Wk/G7+ZTmSUgqQ9Hes\nnlA8bM9ac41VYDQA98wbMUUg/NTHRHku8M3vMOfvqr2j5YPzb0sExHYP54f1\nuByEI60tziYIOGPEp4ftaAOjL3Qc50d1RR3NURfqPwXU7W7Zi0cTRXY2s4XB\nEc5JsV4q4DSVbd6463KDJf6/WjDUvloBT/KRbq5tjoILSg4VY6Ow05uhLDCa\nlVH2IcsgiTstLKOjffzFSB8MakSmcwOBmWlWLIMfDETyTIgmaKM5bYBLymx/\nZlCr23+NIti53Sk0NZ0aqZuf7eE/psiQKmge9LOjle+W1GTTxsRM76z13xRy\n/q5p\r\n=GqPh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOAoiZV7iket09uEDYZUStA/jV8vBA1mHbYnzkyIxVbQIhAKTXzHEDtVW52x29UG7G4OYLSou0jh0bK5yqlkJGB4Ae"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.cfc8fe47_1541356832603_0.6020448206919728"},"_hasShrinkwrap":false},"0.14.0-alpha.e90b63a5":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.e90b63a5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.24.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.e90b63a5","dist":{"shasum":"e19541bdc380af574c8b4a7c063108c393a983cf","integrity":"sha512-1RfnXdjFjA4XOrXJ8TZ/2U2YoDvlT6/9YiQ7BiNTHhFzU1rIeg+dkpSKecdmwweYME6LaRGM2GJ3S3rhFI118w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.e90b63a5.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3z/uCRA9TVsSAnZWagAAx08QAJVfeepXJFhVFjbopHVw\nyHKsLGfR45FkYonjkIg4ZaQ4P32l4KbRSsUBxxS8XuqShcm4LuvLVt4dfQGn\nC2IDJNCGMq4dczXIcYb65CdYF3frNUVmdeAoNLkAz3FAb2IFujQsxluv0KgC\nFpYXDKcn35kvPSly4nA84ABzLA08LWAJsWUda5iJ3seyzEKM2mX9L9vJQHh5\n3sNVFA8809p4lwLS9bnWceLSXjbVVrSpPwyLJbpvc9G5OCddrpe/f9d1MurI\nnzqdtnqcVsICG9byookPg5KYVon54ztpsoWG0QuwdEBuY+M4fzoydyd3FFwB\nAalmEqSzA5ALvCYi7nh07dLt9qQGxPJ50CnL/BbRZyOJa8BbY0uNmOfNYcMu\nZqm6mFDiI4ghvogoP7ER2vOOiT7R3Za7J3VW5U+aVofMCPLkOXTYN7jmPBfl\nzFwKnL+D9fcoir6cWv1MByjR6kW11wexy7meE9mvUcAw9zBYh8jdtF2r9oG4\nBIVl0n/FTKsa5R6l9KIEecPFUm4CzUHn+Z9SMQvf2OiykKJqVQxXlWXmMyEY\n69E2gAy4j7xeFgZSZay+OPh2qtPR2e8giRtf9QK59tcEsWmG1adKeYSwGNkN\nxAeknazwOvGDWFOqDbHkPw3/wTJlukTmh+KFHg4T29CDEgjfJUUrfTzMzgQa\n7y+r\r\n=UnXu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcjzvf/ke4pyNaW1h50xRZDVgJxxYzWQzLhX9Nh68gTwIgEx93skV75wiPBWqgQgrZL5TYxkFRZ16unmzmlt+AT+U="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.e90b63a5_1541357549343_0.914830560248791"},"_hasShrinkwrap":false},"0.14.0-alpha.5591e383":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.5591e383","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.24.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.5591e383","dist":{"shasum":"ce86e43efe234cefc6bdb2eb2c6d286bdee5bc7e","integrity":"sha512-8nitjQV17WsG/cOMbt18KWMzxj/TqeBqvOn+SIicVQsMUCz28uLC9AqTAfunHrtLQhp5mW+aViEtaAYSqGbdZA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.5591e383.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb30Y4CRA9TVsSAnZWagAAdsQP/2A+mdq5zSxRNYa/NUCJ\nzANPMRvJXrhlZGv3T9vKdS4tUmYdQByf6FTh769apyTzqRAq+VMzPCjV8hhI\nTUhMp/TTG4VKtiUBOkNbo1JUp3Km8RHKAY5hsLdJVbDPob4iuWsHk6RpTvdN\nFrw+p+8zp4I21GlFiH5H1V5Zj6bFB2bX+fLgHFkmRj7qJfapPyHsJmb/95yR\n4xE8PSo4BlInEShcdnE6ZyCAtPkraJ4hfQ/ssYaXhO62mvb2jk697SzEdUYa\nTf87BacozP6Y1suf1FvADA7vFAloBu4Peh/ZlWNkwx4lsHRRCvQwi4+yw+P4\nfYewLwgS6eLBTJr7uyurgsnyuRSLpzu0Xnz6WaL5NzthJI+uziv50FcgSOnv\n1liLhummhSjjvPVgRvObYqXfC5RNLK8KuaHzAuIpLiewsVSQ15fSpYEg6W92\nwBHtGhz/sJU7bstG7aOOlT05kZdG1fVgH24pvyMETyCU7Awt2U7LitCBuIxP\npA00u8MmJeU6f+/stnr0x4tWR6QAV2dvPf83Qhfjk+SVWVwsT+H7IPGpqBR0\nL+0NiAvame+1QWMthWfzx/SuxpVADXgjxYzll261j4e1BAhaN/RQsOtmge16\nnC9Q7UFvdgngp1ghPWSAfVqlowtjoK4KIMS7qBF0hNNj17ErgkNcLFNCZcSL\n1DuY\r\n=bXiS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqs/SsN3ZFcMNA2gtWgOxQfI5QikIYHbk18snEozWzwQIgOuPIceEqXdHu6D/k9O0oJgiVRX+020yxlHuOKCdloOs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.5591e383_1541359160277_0.16031018094544525"},"_hasShrinkwrap":false},"0.14.0-alpha.69d49fc2":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.69d49fc2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.24.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.69d49fc2","dist":{"shasum":"ba0a6ac4844948dd76351b853d0f6180e5854887","integrity":"sha512-lICMGUrS6TvqfaNUajso6vSwXvnliEtwwGLziumXH2t39bvu+MabKg7Ke08D7OFLeUQ1BR7FYhBZ6ZNXE60y1g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.69d49fc2.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3+iPCRA9TVsSAnZWagAASm0QAI+f9CWlSyFxpltIq7+0\nLWjbSG1JQS656L3yUsmSwdMnGCNQJ7uWgqkbrzuN2rFWxk8c8QMtYd4fpabe\njVeZIkgf2Ywp1KgPkxQp9BMrZkvRPzhdFfMsxtNos17lJg+5YrjIIxMbrmIX\nor8gHVvC3s9MDfJA9/dp8Cr8akW1z2Xfca2Qj7YUd9cjyP5Rhf8D/7iXHpfu\n5Mp9o69hjTW3F+TlBcE60TNrbbZARCKjFKYWwV1AeBMwIrAnKESEAdh8OuaQ\nart+jqSi6IYLmrVqV5rQx+x9uRJmDz2zPatBdVHHZDFI8WgUYlnPJXj0WsaP\n/rIwIcX8ixHQsieBRna1hb//FWDz71n/hadasFajsX+jqt/dWUBSnj8JA4KO\nzArZSIhyCXL08yf3vUG3istWOvwZIHGfz5cgfUS/X0varVTi4ZW+2wXN/Fow\ntcRDR6HfatcsLYQ7RczD9WOOx56UWFxHlj9TN097Lubk5rndfBZ9yeE7CLyW\nxbULl+0lfQrweeEj4XrTUsflifMJ9ljd9gUEX9AFQBdph28gdIlFAw0ySISe\nA0IKlF2FK/n2BsELrTQQioyRP1OXlHIIriEPTbhyB+3BYS+IFjQNkPvHC+67\nGmYw3sQDK/kXx1sJaCQclOUHgR/qrlQDXwsdOXsDwj7XlWXC9bT79uMAiFhM\nDmC1\r\n=EdD8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0LowXyxLfbDRRgTogVVshPbh68bYojbUEClhtUS7eGQIgOVmFjclw+jCW9C6l7gFS0gcQUz8QIVbN3ANxRH7sSRw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.69d49fc2_1541400718634_0.31950551706562025"},"_hasShrinkwrap":false},"0.14.0-alpha.197bcfb7":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.197bcfb7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.197bcfb7","dist":{"shasum":"bf44473a87c0f9c8cc77f7a76df6dfb336c9eb4f","integrity":"sha512-tBrNz9c5bGOOklgwxey5HoksPwtNS3i/kkOFbCNnFmmcz2Brox7aQbFrXEpJ90T6S+lz447RfdM+q3vXTqLNig==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.197bcfb7.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4Au/CRA9TVsSAnZWagAATNsP/ivCNuMjmpRx5T3+W5lt\neLa1OlfSmutNRUUVVZp3Hfto6fqpT3bjmkOw5bwQeK5I5t+6XzGsC5tn2Gj5\ndkyz39UGgP5Baqde06/VHLE4Dq6tK7YYCgwOcuCH4/KH8zQhXSMqFNThSdGv\n4tiG4pRRQZU9T8zBn41lHHy6zeuy1LQudbvMO/aFGXAg24V/JAZwnpv6sx59\nCQuUeTKQyMzmmjnoMS2nHdXKhlWMOKJeVdMrsO+TX1DAuGz/+nIEuaS0wapY\n+X4d0K9LklhAoogULl0Rft+dg13CLUiz6fJxayHZ9nstQV7Qahxnk6p3ozMG\nwqXQjgUIPMltriHQQ5NTUN1bDNFyfrAk9JLLI9qaSe+hybzBpgGZUANe34zc\nUniaQ5uF4NlMvq4T6e70iGCq6azC3EtSfkGJKorFXLPCz7xfIKlU+ExNaJTy\n578bCmLVCOATBh/QbZ/DOQ9/Au6r/vAVBCJgXd7bQ82jMLHPpZPxmETUEsdv\nGTdfnWmeVnHOdaLG5WRhOaXbsOEZvhS0E3TysJkEETqRkHg8gLLjYwJK8VAK\n2yuh6hFMlc4NdsapER3TU4m3ohJmVDPUWlVtyJo4Yj4jMQ3oW+qpnTXtAA7H\nrgiYzP/ca4TLhnNU0JJZxVOocTqxjaEYw2mKNFr1p7cTj1L5GMLp12o82ETJ\n4bL0\r\n=7on7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqXmNmIkw+zw4ItcRo0sfxSBYm+pYyzsInhW3lZ8SfYQIhAKzPWky7yKlWKmRK9v09b4YbkKlN1DCrGtg4szPbT+/3"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.197bcfb7_1541409726335_0.9449865910841002"},"_hasShrinkwrap":false},"0.14.0-alpha.72564d2a":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.72564d2a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.72564d2a","dist":{"shasum":"a64c1ca7eb398d8c5a3f7bcf58b63974758d1085","integrity":"sha512-mlb9uBEGXeY4qcTb6YeVpaS+BKjEA3eYahWRkWx9D/N0OFsgQn5G6gzxHeMoUqW/iksaVgGS+PJ7bYsGxbqHsQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.72564d2a.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4EUZCRA9TVsSAnZWagAAAQYP/2S81ZZ7OU9ejnLGtBgx\nwFGtqUpNGGQJTPrBRMpV72UAuf/9rbBkW/ZharYjwqQ7Ke3/yz7JLs71xnp0\n9vrSJ/TNfgiPxjLcJ8sf+BYNNsqU9dXYn57XkLpxuTyx3WML+fXErnYhO0PU\ngqJTfB/6AesglPZw85ISHc3PlAG9jdmUL+ZWbkj33sl0y/uCio+Mqw0RDK9o\nNsWl32M3TlJM+hWGM6C4bmT6JyuY1FhMP9HJLfS/oAAB3NwhvOirBszKN+dP\nSnqrJe3uRMzHQFalSQL29OB529cxv9bByCoXzYVhs3i4quvYPJmqdbgps2tv\nJfolukNkom37pqIYYGuwNMF+hjua2o7fVCT1b814LoWWEkvi5RJ4rmOqDHPn\n69W9F6vKZy8f7vyg5d90t520so4PxRWaCPyjANnALa/eTOmSUic9cK4XF8kj\n7J+osOEAJPdoSkiE9dvlUmRnflYS37alwMETLOmZR6iaTgf0FyMcEMc3j+ZT\nSABFJiO2KiRkqVhKZF+kc6QAfRSFEu0ai0hIxaI5BQmyEG2LRgFyHre2UW11\n6Z8eqcmg3iFZzRhk3mEvDTkxSaLHYgW9Xgvs6F9J3crcwNivN/xbHU47E55Q\nRR0kU/hCQp5VjT9qNKk8PzoYcDPR3E+jDl1x1JVAGmV0pEE6SyLinxu/ACPi\nbN3G\r\n=mmkG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEOHb6IYqXRo4DL4eNGwSKiYGpy5baVg8jniRkNx4lwoAiEA26r7C4DXG2fGZuKEAe4H9TtxN0Cb7dbONatH7lZ47qs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.72564d2a_1541424409021_0.18866062479802848"},"_hasShrinkwrap":false},"0.14.0-alpha.7c111b43":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.7c111b43","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.7c111b43","dist":{"shasum":"824b4d21078626c3415f0aaf1ff2fa462a148876","integrity":"sha512-iw2ukemtMe9y3Q3Gi8A8eC0MpiXFTZdy1ZYrhFKowWwvCs1Z4UkIDtNiczVG6oIvaofyjnqW5FfaDKtsYGCavA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.7c111b43.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4E8RCRA9TVsSAnZWagAAA78QAIDC2+qZomeZrVl/Eukj\nDqH13mjgq6BdZRirkkUVZjPzgSTnDwlWs/enZYRvAByJqujaAqSUjMNfwAp1\nYXC3f4fcrxIJan5ymXTi2i9C2AP+9dgS/DAJo+5pdonUAzOJM9Q9HXmU/8r1\nq0+/OCtYn5onRql9zzTn26ZaDApcrQ9P5yXSlMfpfJCyhH1v+mZW1yiNh+n6\n+FdJAKNiGkw04mg7YO3WE9UrPONComX7ETvgVdf6rc/Wi0rW/2dtigWJiUrq\no5GqM7GbYZtZnAn+Svos9pBfCBwD1cUWZ6hvzayWSh01TlcN8LkvUL2OYIP1\nkhvYbRUUoFKB3g4UdWV6dJQo8LuvlSZ/RteZP4fwXNZC7WD0fXEW5VfqqeKN\nVEMYhW8xbfsgKUnUoDTr1oM/3ZNgD8I9Amfg7SdIBdiCtzqBikfo8jPeMo/z\nZvjhzBVlOPdgPqW3QzDiiR/f5hIZQejL3i+AzXg99lLWcUrrpanu9M016qtv\nwv91OwonO6FkDT7UBHa+8s/X0ZzbnaglR17JUu0aJ9MHy6wUCSi2+142BAEi\nEpjcKtnCIqI5FvyWrGgpQjBLKpm6F8wZW2pVjzgrsycx0QWWzC3BAjje+swp\nfQjuC5/W/OkSS8BfnpH60be76Hbn74EjgS1mEEDYpDvEqz2GX1BMb29rQ9pT\nxEdP\r\n=QxQ7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIECrSgfNd9m74ljQw6MGSh4YWOyyWxZ7IpIQKvY8PcBAAiBYYe/aAL01YTd5GkneELxe6C7VBe7ZImjzmVTBYSs+vQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.7c111b43_1541426961170_0.386390542624127"},"_hasShrinkwrap":false},"0.14.0-alpha.0bf44189":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.0bf44189","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.0bf44189","dist":{"shasum":"0026bf674f37fe427e99b6977dc5a5708aeac1cf","integrity":"sha512-Gg9Ro6byDhCWw+QIg7nmtqNESfeiO/S/2P5CIpPihtvKP6WEu/kKhOXvcfpmshzZBTbQlZCOJhuiY2XJeP9ytw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.0bf44189.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4GFmCRA9TVsSAnZWagAA7F4P/07gbLIx1/6dpTn08LwJ\nkj9/UmMKnZ/bhWBiwzvuf29iwexY+DWIsPRai9xcYtqUZDJ+Jws0QleU2Emd\nhVF8gUGQC9bTarRp4JRoRCUincu0xj46b4kuB3yi6tT8VSMW4ZpJQMh1/msJ\nipPgv9gOW99SpAMnyHv5TGfrzdwfCuK2Z4QZTnXjafqxS33OVr7tdu6dvs9v\nZVvR/vOqKbrlIRUiDCYWH7e569fX7w4uolt9M+QBaZ7WeY5jOUvlqWk5mnJZ\nylvsOGLI1P0slX0JKPjwGYilq3aBQHgIB4d9OLwRsuOrSoGE3JEKAg/iNMOj\nnHPwlJtRGNyoN7u1Or0wma4tQQxHj+WvyZ2D/XjmtLwxeSR3/2kB5+mC8v4Q\nw+995mtmRhB8MDCX2xLqgAC75rtZ3tPEDacXrf7l/1GuxYxxS+y+7EgjzqYl\nde5zxLGy3szFwpDD45Zjcgh32YxRQIYrRSKdb95mnafds09oLqF56vUm7cEX\nA1Af0QaDMl2xMVChqlobDim6b4oeW+vGpBmiJVOERfOOURV4j1x4bg+gPAVX\n0ZqUJG50lwxP836I0s17dRg4SFhPAQQKOWXN8mBDnQp607DNUIXfj9nMgqiQ\nDayZx/wVThSQAOEW/Rh6UAo8ZaM+5Rrvtlhl+uRPEyWiB2NS9Z/BQ3RfyDLo\ngv1v\r\n=9Pw7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQ6P2fDDGPsx/P/1s9eVAERkxGPNUlBLWbIn3dB0/tZAIhAIkUVC4toLUuedTy0V2BFzNuU79oMLiTFy0vbIhYeg1y"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.0bf44189_1541431654065_0.9059185011074167"},"_hasShrinkwrap":false},"0.14.0-alpha.a9096b1b":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.a9096b1b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.a9096b1b","dist":{"shasum":"2c884ab2d6b16214daeffb755675cb5c3afb5ead","integrity":"sha512-smVJRmq4fws0ogu81N5nxWthMw2IfBm16RI/vcXgFZNuziyk0xDF8fB4hyqNQkDQlnROQUPEjhmdGqP/w68azQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.a9096b1b.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4JLvCRA9TVsSAnZWagAAoW4P/0uzbBUAlPc64S9zA2B2\nA0GFI6fm5HcdLf2KPyJLS1Aujboz8Wgr6wNXQNNBHKPIJxnYw4dBwqw9zkjx\n1xSRhXPj9j7Y/nA/nra/9pJd9H4G3ZlkrIH/pRSDDx1Du9FPfdefWsng3Gej\nJUgsKA7tUsfoBmU17YEG67b/epmVeWvJsFRAp1eb2zCDERw74Bqh3LuTKeZn\nw/pixjIkh4ukz8CduTnsLJ+eEEQJQ2hs8A2DhYb6PLf2FvHmuXfwn1zwSmez\nm2/lPj8fiYbAob6Q+VPAfpcz+KR1vk3m+vdvLuPZ1bI7r34TC+yJTewqGPWk\ndnkY/Z/xdjvU1VnKXwtBQ5Aolg3DxkTjvLsAYkP0q9ZD9tzASJaSeb0jN8ve\npux0hgGcOAPCM55OV31qgXpK22dUIp/7mM3bPSJzczXExiaa/2Gor2lZgSnT\nJRRaFE6Hc9IKQMNq7Z+myPW56aUHUkEm8PPicjMqVUZqjg06BMPD2Oiyv3xJ\njTcbpUuI4ixGsDsLFpEVNb6f37oMPIrfkMMyOhTNXHYDWU2Ll42XNP4VHg26\nVDVBhX1rKqdptbSyhLVC4uK9LTWZiCRBFmA6B4Kk9gEOD9Xz0QCmHo9bKi04\nXwKEXdFav81FNbBVBSYqiBpH3vyB0rn+c3AUqPl10+374DWH0HnCj0MzxnNU\noo+r\r\n=Y73T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtLtEdapPdDNMVwyW28xjJKuXEaoYAs4NoWXFQ/6ERfQIhAJc0B+XI4zoclXwdNLLL52rhJizFL73Wk9OVNM0J5sME"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.a9096b1b_1541444334103_0.10006987841532688"},"_hasShrinkwrap":false},"0.14.0-alpha.667411c7":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.667411c7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.667411c7","dist":{"shasum":"8bd5f0b4462980c75db7e80737ecc0260853a030","integrity":"sha512-C9oUinqimkC0x6u71865elkRcs8d/isuQTLvBSDyrKDrmhcH0fh6bS2PYNan8iTz8YIgpqd/tMKYw31LvSQmGg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.667411c7.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4KwlCRA9TVsSAnZWagAAygYP/Ar4O75DpT8jOpFYyhlC\nRzSTqE0dDYG2+DCPEruwZOrdfx8/IPWdZunPqZh5+R9t0r/9P/yZLsnFO42b\nqMVT5cLS5FJPA5e3cAkJpm0sh7s/sRW1jdJKs2f5h/3dVeFldtpcjTowSD52\nADmuqI21cZb9TFlYJHu+oSnHNmDYUEXYoeupbf53jHZdgNGXpOZ63JwdnJCZ\ns9YoKbe3PuzpX0nJzuyl1geKlmkpi2F200Ht2nAqX7IhbMyMaug5Y33qj1uX\nQh3/1OD5CL/hwzJOH+YjeJOv+ctEdY7lFy042m4r3isWm3ii3nJ/22YVoDPl\nmMY8yxkUF/NQIERzvTI4wBllsRe5gvx4jZhukRh3Qyn8EvTfyjrTHb2PNvUu\nkmWMh0j0nbBSaAiNxcX/WeC6E05Lt9qApk4JdpGOnnXQTLbDU03GirhlWxLq\nvxLTzyfJyKbtT8vsPaAf6odsA4x7V9W8Jgqngt5Pr+PnEyNoELt6TRZ7dUgh\nlJVB0dWzRAS0vc66aS+mAHB4tfhBvE3F2GQF94CCs8aPdcWbUn1uXVhgGXQy\nB8SGHNZoMddItp04c7PtGai0D7CAkgIx73xzX99MkNKTMs4/JrQIl9gv1S0d\nnQWE7dO3B43oom+b4sMvdh6FYoURxN4o4cuJGmcGE40gsQcbr4i5JvxHx1Ta\nETXV\r\n=8edT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDeibl9mLLS5k82Xvfn8JL0vhG0+mi+losR9Os6FH1FMQIgA8tkdqzeE0halOnPNywYcLpqaHBeEQdGa1PbHCLSs/c="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.667411c7_1541450788871_0.3038286919402797"},"_hasShrinkwrap":false},"0.14.0-alpha.079e17f5":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.079e17f5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.079e17f5","dist":{"shasum":"df81c2cb5786e363c118f85cd441536734611cb1","integrity":"sha512-a2JM+sCAD2kBJAMKxdzsBxt8lyw9qOyOugsA/i5Vsd0g5Y27kKXRQZqYBZxiPssS/SaERqFzOye70dsbD466Bw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.079e17f5.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4MreCRA9TVsSAnZWagAAlH4P/3fSSEvXzTbgOLCg6b9K\nzj6cAIQZXanggpeDj25AzBiF0rTm4NYRixtnS5VNxGiZhmsPBawbGwJkAd5D\nvA3h4gdM6CbWWu7cneSFOYkRnUxWoN9mBp7DJXn40lejq0+PES0YLgAcmBGs\nsjpLsYMTgg6fXHm5zQ6EG9JRay8P7d/CN2EhXTf5Un3fKhwIDqdCca0AXJf0\nPNWnzUxFOZrjcrTycWnP/wCiM7mkrzcueBARKr3dnQ2HcOyHE8m62IfbuQoO\nVIznXLPPTknF56frSFQPFEaerIw7pxQXloo2Y4lnshn4j+Utb0LC7Kn3kCyo\nvCfer5I19KLYm2+no0lrvBW8hwplxYK5uLDa2EVTY1oEReZTxjVdk5UoiBDS\n9A11kF+okYcc9DHKIt9iRZ385Yz8hNso0GQqAAeClJRjG9w1jgP9ndICJou5\nJ8T4W9ZmzskeIM/0dN8aOxXW+uN/gbjMTFGcTRhHN4w5R/bl690S6y36A0wk\nnYhSmktP2pXVUr0OZEiUx7FqbJctosuIIdFi9ynL/q/B5NpsGwPwbJ5kOJyI\n2Gvg+9sNeYvNioDNLrBzA/KduZ/bd6eSdvw4FyBHrd9C5OCyiraZqcY1KTux\nGs1OYksU4TT1lhosPiLFmD+yvS8TPpfENaSK5L+NhQF9Jk88kgHe88MLgMTX\nYBVM\r\n=IS/6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCn66B6D4UK6KIkcAoQIN8HqHbVEflHzJplHb8MwDqxjAIhAJvroFL1ent0bLC4Rusz2B53qRydh8E5nPUdGR9lyhtG"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.079e17f5_1541458654214_0.9273350650929295"},"_hasShrinkwrap":false},"0.14.0-alpha.08d3f8ea":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.08d3f8ea","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.08d3f8ea","dist":{"shasum":"b6c689d383d348854cefb885dd9ae36824acda2d","integrity":"sha512-GiUPEuD7cGLK/BtDlnhty8pspaHihn0rJxG+llCBiR7oXPtUZudb+OsJ8I6EDF0HnvpfK2EFP+zSIxP99QXOFg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.08d3f8ea.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4UbxCRA9TVsSAnZWagAAXd8P/1/P0A7LD5EcOJ+W8Rg3\nRhVRtUkod2eKbb/kbXmj22Z2Q22Lye5Ckj/OSNMRzo/6Y9kK0+RxK2igTc2n\nUfY02o0ERZCHpx0zTb8mKXZNw5Sz9Z0tFMrjQYQUatGsAXROu++7M2KVdGAe\nDp0DPWgevxM8C/avLgQ1N/8C/tSlc4jyDOQ0nRHz22P5UvDQJiYckHeHxtJP\nnGWkuUBIbK3gk+kVidYji80FFjjmriCmcReh72eDY45hsNDdKmrjF6cLsxJb\ngD0F+4XAL1ZET8o1ATVBC3IKeFawk6OWW53JwymQEFwHzRu77PqI59tBnK5f\nuEjwCGtM3nfWhpiyjTfYuackVDfW1Srx00eX88V6xRZjWC/osQYh/YDfZIhE\nPLUa55P9wHm4ppvFiiobLi/C6Y6Q0JJljbhBz0ix7Ue7XRVCqmy5LIJdvvUo\nmHGYKwcYo4PPF7wQVTpSSq7P/KjwOPaARboR1XMCAL1H9YTeTG0OptMGvg9E\n320g6GtjK/i98gmZ2e/+zk5ns2dk6qNY0rJFodHNX+z6IG2feVtEtTD2gurf\n+WrH+Uf06nx0RIIoXLfOxzk+nF1qqmClTBBzaMGSgxsqFHPFlz0mcme2mcjd\naCwkUJWWyc9kybll3aYwJOC++v1XVA/huizb5ITzPAMYTqu5a87Y08c/3I9k\nnHgN\r\n=G0d5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHOxPgmO4tsvcnhlVweruTLiL7WjEXSH0bdY8/Kps+XhAiAMHheSDeGKBGdgL74guR3JnvnB90lyUQnCPr9XohKOnQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.08d3f8ea_1541490416640_0.9245657207569975"},"_hasShrinkwrap":false},"0.14.0-alpha.932a4f69":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.932a4f69","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.932a4f69","dist":{"shasum":"d876779f6ded0ea2f77aaadae9a9c4d54884c4a3","integrity":"sha512-AF0eAyj3LMKoDkrHr8v0U/GF/eLlaBREkdWiLqvLOS+EfoUSiVTQEj6elX7mikRrYZOrZQMRmPuZ67UjzTMHSg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.932a4f69.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4VaGCRA9TVsSAnZWagAABAYQAJyKL55ZJ+bYqQNLZxuk\n/fXvFcJldY+Dy61T54MHOXqx6gQiw4k0hbWdSnXrNGppBfCgXFDeOkrT56X4\n1XI7Md7hoKJZa4L/Hx8tq6D4qMj7F5Fk5I42AL6chXMKrTX5qeCfmQH1rK5q\njSKHEgzX/MgRTpmtVYjp3xKhumd7IubUPimjdbPKyFHUePYVj8DIDCv6PSYR\n+074D0QX39Am6FgCc/JbNeg/CB7r5r0XjhbJSDLYR0k9JbUa6AZJR3qVizv+\nELvTbvagUYxPf96qzPYE1diYcCtlTG3hUegdGyCkgVaIy87HxQhRwrujSThK\nHuRCrok/DymD6IGeScL2V1EeXbCNsf9HrsqjPjaYiZWjksFP05N6i8GblU7l\nRhfY2YoeP9fJ4jXFu/3MhUOWPTDSliPj3F6HhzpxSw9m5FXxQfcZ6yymZIV4\nwUoAagInbnM9od8tnxIu9xDqxCDPD76qKTdOrJwQ+tU5ikDYzEHnM8ARcbYo\nvbZ1qxgw2Ri+JeqAWdaOsBEEGRA3kkSeCTdeECMW8ZS75RD4H2tMzN6gYGwY\nuw+fDnYsYZNAly+p6tfsgxcidYnUmG/jNu2UVt5DlcaQFtikREUO/MyWm9eY\n4ZncWXfaJCqVBYKeSEdpfwaoVvK5U0av+VUAoZe0z22IkKU1dhbbharl4fFd\nPCNm\r\n=CdtO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAcI83PAO18TYwx+xRZXGVjewx1hQb9PfrsDpqH40jL4AiBElwkEDRT93G+fDcPKayXx6rz0w47OhbO34Sf78+LXog=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.932a4f69_1541494405311_0.010506332822230569"},"_hasShrinkwrap":false},"0.14.0-alpha.d4fd0077":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.d4fd0077","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.d4fd0077","dist":{"shasum":"fc3b1b971b925b73043ac0f295a883aed422cb6f","integrity":"sha512-7xPKvRUIgTjwThukxQ28e77Ai5Ymq/Z5AWaMrngXROl1PMoLMMEyoCqX3sKiuWdffl8tLILEvkVOOjyNJa69Ig==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.d4fd0077.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4VaOCRA9TVsSAnZWagAAgKEP/1/Uw8W/6bd+RGdZR5Kz\nxszjusOPPjGCoGdMG+7Gtn+46BzflPKMAwX7nHWTkC7jmFqn/v9jRK8iyzCw\n0IUF1Kvrjk+JuLyPQXZ8b4WCp3ZmVOVs9URsc7oyFE2yQUc+HAAyNlM2tWtI\nLSosBJOwFRBSaKP3Ry0y+78/yLrWWRJu8QGbaVwsCItGYm8odXffuNIe25rT\nKvWp22kSGlo1WgSbfq1hc1EMtbS3iBgdbg8sipQcjRXyVBq0Y9tzLhrXvHvs\nEKLaPbJcnPVfoVRmfupw7adpyrYPisnUC/uoCTW11juXvjOWrUtprtHkrUpX\nhxKGvaoBrUn7s8qpmvGpDtlCoeLOxCKWi/yo63kzGpAnwXHhRFFcl8D5ymUz\nsrvsur8FloIh1x1No0AZ3BgB/Hh2fn0bet97ihHOgvRQHNlp76WFSUba1XLV\ngj61F9gEZsP/z6O9fGqcZhD1smyHgmuCr+ce21hvdPrvx+deFE9gvzUCTUMo\nYQv2lFE2MpDplSAT5f0COdSq2KUv8Mi2WAUs7HDEFGuuv0bq6r/q/dMYBzt2\n0o8kNDic5CQKjNbA/03XjTLza3oxKpkg/3QvXxndkD0BzU+YbENtz5cPPxBe\n49DRTsb3pheP0enHEdbSyNA7uI9XiXkwl7HPlL6eWYgp0PkKf3tH00b4sn6c\nK3tD\r\n=PnR0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5B7OK88EalTXmPLnngrKiVUlk5XhEORkhQv1c2B7MAgIhAJ/mxsd1iVbyAtG8Ik7LIVsA+Xe6Qku9K0apjAWzOZeM"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.d4fd0077_1541494413951_0.7496238554090628"},"_hasShrinkwrap":false},"0.14.0-alpha.8e19c3fb":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.8e19c3fb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.8e19c3fb","dist":{"shasum":"c3b52565c3ab9bf347f6c57eb5eaa60641e65158","integrity":"sha512-aBA07wmO/a7CUXPSXNgcMYh+QJceK4ZVnx+BrAEVO7l0FZPdhXJASmigxcAd2mLhuACifHUpu79a+XPqGEfdNQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.8e19c3fb.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4VaWCRA9TVsSAnZWagAACGcQAKKSVdkWhfNjMbNH2Vbh\nLXwfAuiroA5KAzfuYjtZ5eudcT2x8w6c0KjG/FdEvq9u29sm9aQrVRgClfff\nM64ziiVYOpcz3+P5qZrGF1l59VwR2OZn7FvUomMrJnPNNUJkOoUFdNEjvN7c\nSRGwEF0qOPvhw8sUxW2wPzGG++CcPpsDUK0yt5mLbAe4S4NbbBGlpnmaqAqM\ntTUEg4kSICkxDb9wvTIWWQ4AWnppfXIqYEsh6YVFSRDx/KTGLsDO1y7CTOX9\nLb7Pp9C+2ModhjybV89PmCl8tX43VaBrm86xksYXuR294IVlNXxTYXXhvWwV\n3zRK3jJKktBB60kZSktBzObL+/lNwYY+feO1ajmk8X/8RAWVSw9ppppD7W2t\nh577PjGPlTgTll/HlSXrAC4lceWiJ0acQx9OlA2kByt7BcbPN6Tqd++MhAXD\nM8YHXancHx8hG8fVd8fWR/JgoE5Ne8amJEfENzSx2Xb8A8MVOe1QWBhAxLGs\nEW1MlflfVr2f1vzgnnG12aeT7iC4SWOR2X5p01tEBmq/LT4LL+mbVFTnlLWy\nITGFgYeX2DonGjtxKs4YkkJnnfhuaYoc+Dga06rx3OqS1IpPGPxQoBnvfjcZ\n7jq9RZFcptWyvq0ObHcyW/I13+oWRNbNfvsHqZE01uSBvqtnrLiOLjITfLCG\nm3KM\r\n=shy3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDnVCibEY7XopTeO8rrd3OoSubqOzPGspZT41Y5NIo3DgIhAJug0SQDPH3yJH+iCSg1R5kcvHwTj/rD9gbOQZCs1rQJ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.8e19c3fb_1541494421874_0.08798867915903164"},"_hasShrinkwrap":false},"0.14.0-alpha.10dfa501":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.10dfa501","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.10dfa501","dist":{"shasum":"d2d1f54995866a5529e330a07a07d4a41da2b844","integrity":"sha512-mFbcHo8SJDE2MjdTb92HGrWJBnus0AjglYWGlWUwDN88d3W2xuxautVw4E7GwdSbmkXqR9kBniL85OzU5ijGFQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.10dfa501.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4ZPACRA9TVsSAnZWagAA4+YP/RrjLthd/1tHoRyoVF4U\n1LREyJzHpvMXT+tvsJszHSKy0kXHgLfWrkzx+e61SWw1n1JMKbucYccp4rbx\nelMAy0KSIVlw9+XsFZ2YFSm2Sxn84hHFFkSSPf4Clxvva8fto8A2yO1fDzUU\nDsf/3ogbat6WGlKfnmecPfOVnUT7+BcJVMg/B6PftBrG5wXxZfShUdHqrxAZ\nVADXJrzkjyNiDJm6/TGAbOTjZtC9rUEB6OropbdfAYhJGIe07yGWhx/Fdu3i\n0VU+m+wVnwPjelUa6Q7WFaS3q1t3NSseXeuxsE+Ma35wVLeCArtOnKXsZ8wv\nBGgnuEeMJBkxGd4NspTVZwDWAg2ejuP0Ff/ZWuEb9//g7vAhLWEpzpBdOGpb\nVlAcBJzQdH3qMzijF9ni2PJkjiClTd3ZvNHGN+sTSv3GDbiw7eJLx3Bnp36S\nYx7Qyehw2qYsIhdjR5TL3zQLPdxm8i9xTva7kxKP9oV3tQDxn8mwXCWmURCD\niHqMIV/08SNHhSNNyJPr4qlUSfynHEjjA0JCP3apP/qx5KfrHxa4VFHF4/eB\nqy3huMP3mDwarLW52OTnkPh88Q8Nvcb6FEQDbfBH7mGAAYDPwHezjkvPhaoQ\nd7/y/ggAvKzF50fWPuMFVDxwKAa+v567qgJXKe7Vj5erG5fJpg7KeizTpktk\nOE1G\r\n=Catx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsIsBA/j2LQd6FVqcBQhj5E2K8yH93MA+1gvHpCh156gIhAJwGcrcc5Vg9MM4ytF+oZg0ZJh63sUXJ5XGg87/oUJmi"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.10dfa501_1541510079304_0.42500793078743415"},"_hasShrinkwrap":false},"0.14.0-alpha.a5b572ed":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.a5b572ed","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.24.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.a5b572ed","dist":{"shasum":"c9462361678917919c661e6fff855b4210ebcc26","integrity":"sha512-Kglg07ge5mT3R3h8w+Vq6BskFr2dBYWdM7DqXCyG4Hbl5Gp7ngKANgdabK7GN8sRZn3hQ/Ynrvl7RzD8+A86nQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.a5b572ed.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4Z9yCRA9TVsSAnZWagAADYQP/j3oEi/Qqo3G1kyrtV+p\nyJ97C2b7PILyWfnYnGwBmY1CFMhTSDxCKii+q9OmxZ0/kk0CYg69+ih/EP/R\n9ksPhhLjVLrRf75ONivpyjAJ7Y9ofb9aj2zIPW3AUFeGTdHKV4ovWefeY3vb\nPjvILNpEGtGZOGxAz4iuSHAM0FBk9CxX/f5eoZ+C+FXor9zz1DlOW0HIFrWw\nTM1dFaXh46qOjVaR9ppeoT9aLIDuu8GpFIq66MoWw6QBp1VWkGUO6RUlq9Kz\nMjiEGwnjwnLVSdoW+pghnsB5wdztXXudWTxXLMoCa9ynRf5EA9PQ/piT9V4T\njZaVcWfOz5DAcB86g7qbABXtT5I1h8Iuj924huApYYwQkSyXScNpA+TGZNNb\nTg1/DjCI99WAeRi5AlcasD7SZneo0WtHo4tAgAnISlIb1JSBvW4XsVEYTJ/Y\n/e4Taod8fx+tfGBrUDi6UW1v0a5cTVZUiGsurshcaTj9G5SFzvEDWUNIWgga\nkPzb3KpCokM7bAlY/Lz0XdQacUlQ7fnwXl0XVwc0FHDWFqDWICxqQbECc+i0\nDSV6DQJkiawCISi9mOkQsybZfU0pvWhkoBiJbEo5abW5Vqb76db7/qFHTzAh\nAkHuL/DLzhIMGBq0Zs2WVhx/e31bvNehvQaKCJWm1J/bkjdkdraLrTOeLBFx\nHNh4\r\n=XjPb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGmdZZZ2I1dcTDGrCA/+HJWgI5pJhwg7hwBlivAMfWSwAiAIPp+kU3pi+qSLoqJe9r0+/eVZj1GVL0uCsszYYoxuVQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.a5b572ed_1541513073976_0.769715698963295"},"_hasShrinkwrap":false},"0.14.0-alpha.21950c91":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.21950c91","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.24.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.21950c91","dist":{"shasum":"8f13e908e4b2b43f637c8d91ffef50c939977066","integrity":"sha512-s94sDGTnSFoJdwgmzqHvYIxZfrYkB9MY2/5rAycCsEhMXvXypVhga28OEG/dJe5XHJ2qspY8gZ1sEq4qVPXGVg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.21950c91.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4aWdCRA9TVsSAnZWagAA6hsP/3ZabmW3rATBDINKarkV\n72mDuYLPs93P0NJwyKZyIFAjoe6gMaYZ7mGfCV6u1m4Q6pND89aQ+6UBEgkq\n9ZwfAOfETdOH3IYyQFc+BHES+D77rQzE6f88amCDk7nk3g9Zq78hwDObD7ya\n+dd7rKQ0ki0dKj9czSDHYaOeNO7LyfbUp86v1ly6O4gdN9JBPmvu/IoGRFjl\nfE6cMKzB1/9l5Oiel5ynKhJUiJBKQ4rBY7i1UZLbwOujdLUlU6h4IYn7VmRC\nGuW60igXvjYKVinGU695dqMuxUs9h2u15MgQ1JAyYAQh8R5hRrDXQS/AaZQS\nv1xMkniydhbXPm1r6C3vS2Dx6plB0WLqdlD5I/77pQUc35sy452AP8pEvPZb\nI3r4D9ATEVEwbih0cVLL+/iKTmW3JQ+F5gAYrMk2VuskEtWegElbpV9taDe4\nI++TNZMouL939xrRbMQ8B/6NQkNzb8aANiSHSoeEtc3DKG/eFPm579FpQZRK\nc/VmnKpNV4kvBybF8VykSQfvPgZC4yVJfejbZrOo6Vp4gGFtRFOyvetVw2MW\nwLMRAJz30S+hsTmo24Fk/fic81LpWqNtFqfeWDgAlEt6GAIOqX9e2ZvKJ4KO\ndIcqYJ4nljs7RtthfRQbgH/NfjIif832HELXmQplOgwrNQGajYjyt4HViC8c\nZI4t\r\n=PF0E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCK1dLGVpPo2BIxlkytMOfN2bukcEMyWMbfCAWfE4Tx8QIhANxyIcHee4TiL9IpTp2nYBuMYHBq9hbCN/xL5N4ehsz0"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.21950c91_1541514652650_0.04730082447624162"},"_hasShrinkwrap":false},"0.14.0-alpha.d3681d44":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.d3681d44","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.24.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.d3681d44","dist":{"shasum":"2d729704c3470f8e4a75a6c2e325a9cb57a78c34","integrity":"sha512-+ngS75TowO4877qTG/aqe+JDPPpXIwQSfnASD4usIRNyTjbe6ZPXzJiDcj1Rge1qWRr6LsGiM6g5WIhvOgkAjA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.d3681d44.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4a1LCRA9TVsSAnZWagAA0GoQAIG3FcdEMLOmk9NTFkGk\nLUOselXRh2mc7YhYRaL9ZmoqvkbhRdrytf/wNf6IzYLPk5YHyW7r1lep4Bmr\n8FULY/uHvqul1h3703b2EyD5eVaXWUKk63g5OO6nEkAbKo/DPF61SvMgceXy\nFphTB81RqaxQ9KZtiAQWZoOadkh1OCvEt+F94LnT0GlV5jhnDn1S1QpdFZ2m\nzuxhAvL7PE34gbq87nXZvkJr6VB0vZSLKp8KL1WFkXh8WCIYhXAqnj2KMFvV\nSAb7XstSwxrepT9ofW677ygVq/gR7rJVMOjloKgqh9nYiLSut2XuleYaFZaC\n15PWaSy3FcA6Jy47OGnrOsmuWkcMc8kToTfS0il/+5TWgJ9oLiG1WG6Neht7\nMVkcVyl0GhXOedoqacgCtp6eDGStqEiuwpMWVqEfHcr7HysiOh+DDXDN6xk1\nWJ6zNLbyg+0bWnfY9uLqPy6LoXhm5247uAJYkwZJWa379KNrRHz4YPGLOC5z\nrkZ/aS00d6RXZOog+zaKoBjj2pMgn1U7JGs3D0nRXW6P4fHh06sRFa4/WhlB\n7CzSfU/CWfj0HR3cUpvnahJC70JxkpbX1aHB1NNVPzxRrTg8MT53Q72Gbd9q\nm8iVzgVaTEuu8UbY5QCzv0fgPxYy0TQVvov9+RCDiprtUJNzBmXVQw9LFChA\nzBGh\r\n=oFE2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbPtGbXBPgXikVER1DAOQ61dfu2SkF9DxH0nVBuZ7N8gIgU0delGJyp3AQ8pDYqvZ1jYHAfIUoZTqkbbAsYMu18Y8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.d3681d44_1541516618544_0.5876511207944"},"_hasShrinkwrap":false},"0.14.0-alpha.600d2aab":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.600d2aab","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.24.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.600d2aab","dist":{"shasum":"93be187ca6d6cd4a787e84be07ab5988ec489c62","integrity":"sha512-7iwPA6wfFtP0o5NEc2KG16Kn1fkjHLluVbrkJAbGVUhmNjrXHM04+QnVR5DGBJNeTTBevaX66AsV5qvGegV8TQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.600d2aab.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4egiCRA9TVsSAnZWagAAKEAP/iFF74zZq6GnnCLZ0XUw\nvLXDXoyUg/4TeG+yPQSTVCM4ifClyl5qnpcqOTAicAn0xdblLIKd8SrKC0pl\ny28eO+vgeDkoAYD8Lxq0PuiGb2wUGEtoIfhRm63AEmfnIyj6/GCogB6DYDBK\nYJit+0jeXiV+qsK1fmBGrqwMJnYXOfiIHQPv8l+tPssXu4+UKKLDRSRBqb9I\nBmE3AA63VUk2782TRAh5i0cMSQgwNuv7ocWGxN6zBXTuGBGEp4co5C//E2wq\n2DgHFdsADKXQe7sGw/mU0UvHlWm6nTUKOrca5s/1pV8x097vSvKs1LFBIhCn\nmHsv1LmfFQwL6l8/tJUwKbPHXnnj4h+s2btVjkE7oMwoQ21wxkCAQp1N1H++\nh2Khs4ec+a2KOrlPemUaADY8LwBQLGQIyS2G0l7U7Vag2QfIMToKnp7o05Lm\nd6BGDOe0hq1OuQenWYNkaY/O9Pk/hfw0gOWbs0Y+/AyfddjJxuMnaGjZhLNI\nPMWlTzWXUyWTcIYbfaILycdXw689tXyIQ7jprsf4L48RRWiBGDy/E9Z4W79k\nUx6Bc3kVIoK7Ydk/EFZOQ9aUntcVJFIWw9IGQSWEgLGWBMkrL8U1UZbiAr3W\n7Pc9VrA59iAxuZI/TtlTgf2uGb2b2jlrS2ONoN6TDl5Wsv79Kycs0xG4daZO\nT0cL\r\n=aASF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCX8emBrqHKNM4RcN0fmRWs5j54YjLUor0IVn+5PtAxiQIgTz7vsYUK3+KH3ni6pBwcA90Mm5ilM/9uL4o90iqvJBU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.600d2aab_1541531681929_0.4329991893348826"},"_hasShrinkwrap":false},"0.14.0-alpha.365ebd86":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.365ebd86","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.365ebd86","dist":{"shasum":"d8cfe51ecc917626e31e83255ad316ba866c1d27","integrity":"sha512-nIKw1oKotizwc4KcUCoFWMrHFo+Ok3Le79ijjS4eAF/9HXV7ESs267mhe+EBVXh71zhXoBe3zO8i3yVo6uOc9A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.365ebd86.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4kPjCRA9TVsSAnZWagAAVpsP/iNn9rhu5f2OsI6wHFyv\n+s7X2WJQqYKOiF8ifXiXmhrVr8e5bTKO9cJNSGSrKoEm0HTn5caJfpQmTeTa\nDo8gcXTMWwiWb8monWTrtGTt91G3LOR8DaNoQLjkyCb7D7iQjeACwtwD7HSH\n9G06cgTXE/1FubIGme19ABjnoBVnSg3c6B9aUF3e82pjznvijXQWrL4+Pqs+\nkix9531vb5tGUHgju+Iop3MaEk/hf/4mg+MMZY7LlxbZzGaSq1FcNDwH/ukV\nDjhwRSCIreCvG57BU4PisO0xoTqFpVM9J0mMD2R4cwLLpp+SoMiRdHiZmi6i\nDGX4KFb5zU8G7Mn2SVUkmSsE/Eiy619q7ucTp+uLWMq1HyB2H8BZXv4TVPPA\nrPGt7unhH7DqcQcWkbey7EhhVN7RCZy5xhlb3Q72zTQCH3UgsByYoX6jvBfN\nKxvDyngDfY7W6PTjDA/8xcFbIXCejIPYsuzCsjteoh+e14uWYoWIVToBMmbx\nZFGoabDZq6ad3GYtXCdYQmZ+0vqX1nsV4CaZI9MwmdT5bPWlQlKhtB9hpsrT\n1lB2mxe5pLhjAIXq3lNhesbiMoVAUy7QJh9C2YivL3TKbZUonAT8A4JpNCBq\narqe3Hi8QqEJH6pFmrTZviTTdHsdYlp1hdZXbFM0+TMlraiUf8KAfSEdeMrX\nvB0z\r\n=B3fN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH5KypHCYpEW1ISqL1pWP2f6UCteaOfgpepP1g+h6KKDAiEAo5OG0hVLJBjgIvabfcc0pBWMtzedTRTQxMG/h0oiAzM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.365ebd86_1541555169402_0.13074715161423112"},"_hasShrinkwrap":false},"0.14.0-alpha.a7d6cc1b":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.a7d6cc1b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.a7d6cc1b","dist":{"shasum":"12ac2dd1aab66516b3180bc9c225331eeafe45e9","integrity":"sha512-u9PXAJirnoDa+NLRtpLhnRI4gV7AO13uhgRXX/NHjfI5up+JA5y+vH/67xIVc7AAoITb8QMz4mtENIPuAH+gPg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.a7d6cc1b.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4l1MCRA9TVsSAnZWagAAFdwP/0daTV56JnsOKgoj/wAr\nzEDCUZxJ4LZICJRu7cWP7GfyS4egaJ8EEf2N0RseBCEKxu0ToobkSYeMT+qY\ngz4i2YMdvOUu24KCLIO6zx1A9oULK42MET+wItawlV0d7fwA8opThIlTFXTh\nT+9l9FHtmaaBTDzPUqiLr1p5oGlPWMpbCxtEJKwCeWhsa0iQJRobA7zgxTum\nDn+IyXpnhOY15CAkQCLq7U5r7yoE7KuMQb4I+vmMTbiz7A+gtyOHrRUEuEHB\n7GGZCzIWfSRU8f2jyN3va5ZbhDZh9v/2XUraypJ2uuYaK9BjUFRzeSq27nUB\nnrd+WzBIE6MX8/ERKqkgJOd7Asm4b2GuP5Xv7u5Bxpv3svsgpXAQApJsUCKH\ntSoYh1E+4bVY+6IWV5ZSBGbcJO+ELoajIledS6CQRjvDz+yHU5YS4FRT8Gug\nvMXk7Hlz8bGyPuAp677TWFTX/c2YLttahMej8BnucIfITP+3AlZkRVGKwrzA\nU3IEmvEBsR27OdTfKK/7quzuFRfHrEADR9phQA2u0mxAArQaFQtNvorCy6/q\ngHzPi0oCPfcpkvAly1RB8XpV0/jvupZe0eBYPLbgXKMKNjpU0enTTsDWdK6F\ntNHA2CyX543py/mE5Rpenscs0khuA0iQTeZrygJkTthFhFd/9Q9GE5hHryIU\nV5SK\r\n=nNtC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC9TMsgt6hBCStZYoMI/d2UKuBPZsHrjF4LQR3xO6eBnAiEAn5c0pmULXxCvd9e6+NxAJF0p7yWciT46tAZ6IkUg9a0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.a7d6cc1b_1541561675736_0.5742842753495063"},"_hasShrinkwrap":false},"0.14.0-alpha.f29bb497":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.f29bb497","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.f29bb497","dist":{"shasum":"bffb598fe565e1e010f51538104efea65baa000c","integrity":"sha512-065tPmkHI+HmOPDtWS0zwscqP9wPbCDRZBpm6r2QJXhi26M24CG86uozhqWwepP+/Kl2enGYpvtwvRS1EcUdeA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.f29bb497.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4p6GCRA9TVsSAnZWagAAZLQQAIrty5Krgd4PUWaaUOZu\nsI6dM+pjsAkzUSbDK3ckeNNz2RkHAQNFq+YnXwELNYFY4uANWZCyLADmz1af\nRFdRMUPKF78P48UjsO43HqledKN36XhbBQsR9m9oc6c/3Z0dfxA9WGA0NVzA\nvKEbtmGNcZ4CXoK/zFY7Mb3s+6Z3+YhpEKbGnAwA3F+9VrAm1AEPl4BU/Yyi\nCGyKv12F3zPFYr7twu1pE8/+XsCTlPWuQbqLp1DZ+kRgKqwmf1F73CpzfjOJ\npvdE5zvXIG5mBSyBLm+75g2LudsdiwPdi6t7aB4dNk4kyGPuMEL9atoNCfj2\n32rv5czTMNyLRray4GGLkdW0r++pdXgphp/wDsl5vdee53gHWjIiCOIi/zyj\nTqoK4kME4dYtN5JiOc03UMsUlMLryQ9E+p48UWlrbCFXcEpjzBcSZok6BjR0\npyErAFYnei/V5SA7XyI3F41ZN/OKuuc03SclaE/yQqRsDsi0OnrXrsCW6Ry3\nfzkU/Uo2PQjV7gUFdUsw6kcLlSplqo+AkvKzMfPJZOPFDmhGoMTXP8E9VYMk\nq3K/xzUJcD3VNef0/WnKMr1PrtFUP/GN4NShrYJkvn+aTUsNOycfNkcktuZz\nZcPLz+HAV92YNIiTiCLll7Ywcu+j+vaG3OwpPIpuAnluadrPvEiVwsIklhs9\nSNt/\r\n=BDc5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHZbx/Q0Gh4CoAWXQ3S3Hn4wcJ908OGx1ClzKzOia+l1AiB7TMOfgaNUZyV0udCKVJiCwiYpMrBBMT8SWP6a1JyxTA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.f29bb497_1541578373260_0.6252605802127127"},"_hasShrinkwrap":false},"0.14.0-alpha.d8402d86":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.d8402d86","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.d8402d86","dist":{"shasum":"fc37bdcda75601a1758abbe89a9929248182ed25","integrity":"sha512-wlNqAHlLXEawDv6X9Trw5YvZxaEL2X7/EDvF9dBL6E1iZmMx0I8fN7Uta3J7kNnvSJchBW5kDc/C76wzyAz5hQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.d8402d86.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4p6YCRA9TVsSAnZWagAAlDgP/io2oKZrXM8tgXo2ssQf\neo1vwdIf71iHWMbMaH2s0g6m540RW3e2am8/ud8KIIPwDynOEtDUt4ZcgNnx\n/8NOO1LQjrhljk//CTe7uWg6m0ARvqWW7hJyOsH+XJOunmFoJgkz96QxxS5w\nUYW02+VS1zwlN4PrHzMW/Wrg5+Au/trsLd4Bea6C+t6V/HHgv6Qft7V+TRnF\nf9yyaFGnpYqvPmn2QfPXSbahpN5zLy+UI8URnLmbfiQF6plhxtxuIVk3XylD\njQr8gCiEPaOcR0gmjgZ6ghZhWzHXoH9veCW04A6geT1e/WIt6lTIi8AZkFsN\nqZs25ieXNS8ubkKRGbMFjY/UZ7YpP/FXPJQLo5c1BGSEdxpRpT2oBXovmzZP\npRTJLNAbOcdH2D8RCOoqWxaOrtMfhz9Pgqhptks5Y7acw/8cWx3961sRGI6f\niiiwxSBd3d2xfqGk3S0S9skfnSa0fRiFDKSctfz9DD/iDBkG1EFTkUnTC1Sn\nkXNZ3f/Yk65F4qa6vip53BzRm7LLIMcBi2MyUwS0LV/9yF4onCXkeXzx/YwQ\ncDpyxw1c2RdOFO1GNX9EzPIBsFgteWYkJxy0HkjPNEQtmTtQFj+TnO7oE+xv\n/cdYEQ/9WwkKayHt7dSZ0YoHxYeOLJHgYcjIdOk9iLlCz1EjDYGIvsjQf1u2\nwlbS\r\n=1Yu2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPGRHlQcf1O7FLwF9msZCbWZnsGamTYK/YLJaxNcAlIgIhAKI5Ck/Z9ek2drDhefKvvpPFcBiKPB7skPIrsMHba2uw"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.d8402d86_1541578391926_0.7618170261075741"},"_hasShrinkwrap":false},"0.14.0-alpha.3b5bda17":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.3b5bda17","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.3b5bda17","dist":{"shasum":"4466abe7c6f2ce972bce5a0444f39d5300146f3f","integrity":"sha512-pI1QJ4q3nF5kcspqftJg0wES92bCUeUXPuCKUovhJHcgXbAarjPFclwchvrjqfUA/agKgHMmAN5xMq1I9UPnYQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.3b5bda17.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4qjFCRA9TVsSAnZWagAAFecP/j4VFYKrB3JSzL6gA7oI\nmactvy+cKjOO1NxKawSz19X6fRS7tuDmgQQFeTVderNxH/jz4AgnReb2f7w8\nOKIkpO+pxbudOkeXJ+1QLFxLDOdqE7FxzR7sAlSXd/grFITO2eYSdn/3FZTf\nLSWwFjQyxWkxyB3dvBFRuVrvZPG3QYQnMVsgNl3HYFj8xyWLQ5f0KMMcPHLP\nRAvHNuM+zIUhf1SibEPqXHHt2QT7INTjKluywM94x3w5IXJhPM5oMj+Kquhe\nIi2k/aq4i1NXvZrJMCd1z50eQnKYph9yibfoODYEIiY25MTnJ4IKnCJeE5ba\n+UlIxS7L8Ikel4bkdgWQCs7QR1W2k40nPVMuMjWLbX0AoQfnpxzU0Pp9JnZG\nqB9G1X2Ym42dwM1vk5fRB12xQtvFLdyKW8wkTlxDdaQvyEEzr1PDwwAyv3Bw\nK/dSyyeTeP+GJqi7oW14gI6/152VTUzfhe3sL1fnQRYlsRIHzZrt3Mev+Wze\nadgAQ/N7bQsIKKQzQ7rPPz82zwj6xmhKiDStcOYUkSZIz5AUXCGAw2vicJ4k\nHmce8rJwOCLpIBjrHmgU/YLTmB+PRXboasdlF4xiYTkKK7db7FokybtFYjpb\nHQ8ZV+NUY/eeLiUMD90MsocSXzhrepRPJBORMvMdfRuor/4DrDLNAWCgEzyY\nPfvG\r\n=jvNO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH/2Vcvq7mXC197CkNs7qzaUzSiT/acvEZlYfcXuyeR/AiBAPjjxbk4oWewj5oEuaQjLLl97q0uN+KukSQBvSlvp2w=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.3b5bda17_1541580996647_0.6486749480602221"},"_hasShrinkwrap":false},"0.14.0-alpha.e0b152f9":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.e0b152f9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.e0b152f9","dist":{"shasum":"eace36ddbbc2abea75469cfb7ef3bc7bf0427259","integrity":"sha512-To5IkQYSQJJbcPkWaAkrjuq/VZhUsQ1c/j/i8Nilan4q+x6odI0cvzyi6UM93Bw+wCIF8CkEMeyaOjCJaNm78Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.e0b152f9.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4q2nCRA9TVsSAnZWagAAHt8P/3EH4XU6SIin6PxPBpCh\nxIjXn5wrcV32VSCyiRp8j0rjRG8Ayoivxv9kAJVxPhrwZQIk4yEQ82FGG4Qj\nAWLXkPOQ9nlZQ9l/u1zZYa8kjVQ56hLWmmg2/UkQOYAjH+eQ/XxwiYPHYQlZ\nAxsbmIsSFU4+/kNQ5EKV5HoloTXR6qC68aCzc+Xuil40RoZkBGgedp+9mTxF\nYMqAZYfLa+tKqvhqxgSX+ySyqzkVBgRFf+h0L62XhT5ClPuE06hxCW9lhm+I\nSv+QkkChht8+OwdKzBgJBf+aZ7QNUPv37987QjmnjduLe5wpqYJeU5WjFXoe\nQ+n3cFUcvEJlmB1oH6EbUTVwQ9i4qpr9xS05wDbZwvyNkNBdrqHFsAALKr/b\nHOumfoU2IK0CyQ/3Enm9bLWN6khQcX6dE+mz4KhCfJm7zCuaVhpNNoMHDlqC\nXg7ta5mSlT0oIoMnJCrvN6W+7+QhIBydC8h6HyEwpqFo7OF8bxgQXo7dLkZa\ntlIFuZnFCJxCodS2gwIGMdrMI0uC8/JyOeOqkFAk/nEirxJ+nKh/Y6GUNykh\nA96AWB9xGErQ7rNa3yRK0h4aRRoqY5ShJlMsAJpGIWqwX7ArY5s0DFW8mGBe\njCsUpUo7c2dODzJQU3Q0f3LTRQyyd1pAREPvxrDJsfAgqAE29oKGk3iJ4u+5\n87k9\r\n=VLmU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBg3pVUZOBZszJZA4jhv2ADpFWnLnaCTP0I5OYqaURQoAiA0mT8Wjwv17lp2Eh97qJ3qLDj9UAuTUlw5fqTQgz2KMg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.e0b152f9_1541582246727_0.40198305206229756"},"_hasShrinkwrap":false},"0.14.0-alpha.3ba697be":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.3ba697be","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.3ba697be","dist":{"shasum":"4181ef9f275c160f723502a57c76e5110a9f33d7","integrity":"sha512-20qNNQtCajNwkde1SY9koNNnsuwA23HH9eFdRrdIw8Wi9OZBG57KHk4OL9/PvhlcCh266UGCMibJP5tqwCOpfw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.3ba697be.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4q/ICRA9TVsSAnZWagAAyZ8P/2wLh51EoC36ElqlbnAr\nHavuhr2/aUSHD259sSRrVof0H5XvOgphNd+oFTHM7VNVU6J5CVnnEKrNUDGo\ngLStmTy2bVpX5IffGJrqy2M0PeTHpn+fncOUXKoUKzPUeUixz6BWglBFk6/y\n8ia+iMs0y9nKvwKiOmreD/dYGv98R7CWAZJmMjZChiSp70titGTlvKwHnq2g\nPW0V0dP6HiQOO/lCLzoeUBouuHfmE9UdAKmOIHwAzbf/mSNWhcEzKXujqy8M\n77unXn2ULx+iAhHkF0wMD9GsEs2O6365Kh+4DubS2DBmSDJz8i1ne71Pm1ZW\nij9W1D3XSIMvcZYoyAhro6zqXUuX53zp5ZNzHBPjddaZeIk/gbP3+VyJrNiQ\n6JFTaaRaKXlTE1DBT7E/qtMLXP3iufMMEYkDIZTxvc6LFsRiDvbIaYSrHMSw\nlX8Tjjh4aSG75tqr0B0Ij9kTbNUeTH1OOpm0xMLPn/mVtbmtUeJnzUsJwn1U\nZM8dlNBaB7wMCdcfQuXv1YxmDC2FaBrCtQ32fE4RIecnyEw0wu0Gq7KrXIo1\n1WKPmvQn+3Pj5nAsKKXMFE8Xo37VThnXUmGnNrCgSTjAT7dQy+CeITfdtNaQ\nTC7YQpREh+qdVftFByZIkUPnMDKkcK3bTa8KDkjzxiWr5b7NcEk7kti49Kpm\nqWaA\r\n=cgZp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAQCrctZqD//Z36EFcLHaaHU9HVAkaqvaaUGCRx8saAIAiEArFHVzVssxzrW5EmV//WCb9aGvKMe/pfggLHb+5+LD2o="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.3ba697be_1541582791363_0.6233665631392853"},"_hasShrinkwrap":false},"0.14.0-alpha.217d012f":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.217d012f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.217d012f","dist":{"shasum":"bc0d9eaa953afe1d4a42364441a4885712a10f6a","integrity":"sha512-HV1Ufk8RYEpW0mUkQveEsNcLGbZmrCdbvdWJiHOWiI+F1rQl4+EzQcQCqY5GkszXlc4DEEIWHUW/5Bz2ceY0iA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.217d012f.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4rBZCRA9TVsSAnZWagAAXNEP/1s9e0dFJrfYatssMxLQ\np7pxCIJjIVSy6p0CcHMRZnR7fRIPZ3bi8g8AKgqPM72jVA6k4PkseDZC81gZ\nISYU808xVcdmj+HjdNsP3ynZh4RfbxKACHcS8ouaMolohJpbAMkoAQlKGZ7u\nRc59QSRQxNG6W3P9t1Vh1ucVXRLgqVq1D6ZCmoX9H2YIQ2EuChH8DfXQZgoH\nV7zgK9ziARNatNr8ivYbAuRGJ3DRgpfN44fbD9C/8tyEmtaeniEW47L7Lc3O\nsv7JJDshi4K9lDLYwf2uNGPpE3PNEJtQGZS3b5RDZjBnkTsx/q5vxC5UK5TO\nUvP1WARAcOSVeMEa5OGCXuNTwtMMmtdJKI+5dYZNllbv6a/QT93qUntlm+zA\nEKontBITywDJY+70RfrwOTYfRRkh/+NnzC7IX/Hm5IfyXk5fYCWREvy45SIz\nWI00Jihi9eTpkfNgsBcM1/y/LBBRBnpKLojISSg+1dwJlF7TI1Ct1l48rj4t\ncVf6PTq3/pACjgPrlsTATIoNgkinzeQVt6U+VxQhPWoqSXuLAd5nADIKllTd\n5GYtygaxaMdMAN2qBQCw7vyKJmngHcN3qINKi+DV24pMlczX9w0YqjuFbjKj\nocycbrJZQKavA2o55Rug/0ftKaw4ZZ0gjgT19ilOPWHR6/VteF3+cO9h05ch\nj373\r\n=qimL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDs3PrSGErw5UIRPDvw0i7Zw7gnMMF+s/8aTbxV3srz1AiAEsDLyHI/T/nHPF5DW+SLcDo7tpJHdoSqZgU8UX27BDA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.217d012f_1541582936553_0.15071612127973988"},"_hasShrinkwrap":false},"0.14.0-alpha.7a8564cf":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.7a8564cf","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.7a8564cf","dist":{"shasum":"43e59c751988816c82b70743e4bde32c3c9c961c","integrity":"sha512-IIRziaUkuwAZwTAuNe94yqay8OgQp2MbwqtzpSWLH4zHBQ7AQOdciVvr0PoQYciv87yVkbe6xIQgfcRAYAqeTw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.7a8564cf.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4rNNCRA9TVsSAnZWagAA5DMP/1lrHvpa4g8QR8kXBjip\nG76JgSE1UKvCjnEzcoS3F+Qm9w5ANHwdN1NC0BH5oii/f9sv0BzgUwaCA6uQ\nmhpT8pq/xZ8Z0FUfzH6BnXRk7hEsqCu7EW1Mlh0F9AC8CbBgJzWDyQuG0mkG\ncHO0lxn+JO89v4wpuLHa+BWkh7E+wDLtyoKCh2Q9w0KWJsDSjXd7GXO50zdv\nvW4lht4mZMP5q646gULY1TsADIqMqXBG6TE1ROlU1EqsRq71k//+0z2+z6bk\nRq1/qrqJUkb/maFyIZmynPS+jrxAPJEZarq6gx/eqDgNh6/NosYAxYK1x/Bz\nnmMHleV+VM5rAZH1ebYK+TnplNS2rx1pSXqsEyjXiyK72aoNefvcW99GmBb7\nBs5k/cnNV8nAvCG7n2KURnArihju2qSFc62vhS82xGGdXT9xRTVbXd1Klmw7\nh/23QfYp7Og7UgV5k+NxvSEgorIShglFhj/i+hhfSSN8NMPyqPjEoAhGjSna\npxTso9+Pl+AFOEF3wa22LVK01DYy12CpjP4ahV/XwBxFzvf08r4lEVOdGN+A\nqCkbkRij+AqGgGOBUGLBpxNl+rBcqLr75LI3291AjtGJjVZ+b8Dmsd9FDB94\nwbBiwX/M0jtFQ/OTnxpuvC5W36XSP2mxbpdFdL0CNXLoXRT0LEkkgnsq1VW0\nm34U\r\n=VauO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvFBl2jZKdkvlJwhAKwh/qB3y8N8VL45mx4mbAyMOf+gIhAMvKc7v4LC5EvaNA/7EN9nimak4NZbtEUKgYJKQI3S02"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.7a8564cf_1541583692811_0.47425384662376824"},"_hasShrinkwrap":false},"0.14.0-alpha.12824a93":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.12824a93","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.12824a93","dist":{"shasum":"9e2b3db44312286499c11ed8995c1c6b9bc2d74d","integrity":"sha512-6T7fGJhsV3+OAy26nsgUegRx/QquR9Q9RQK7NpB7LmyVldEVKqgOIbYLo2CORU20F5IVjmDdSZY5uqpbKN7Jlw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.12824a93.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4rwhCRA9TVsSAnZWagAAVhcP/0H7vOrD49TOiOi5Gq2u\nCBRmoVXdHHmjuu21z9j7MGQucgrRwz0hDrydUQLh/QJZU3TJTH5GGo2PYFhr\n3jizWvt9falvS8qru26AoyELpGtqmz3T1mkCiNIl8tHcLRn5kH3+aglucD91\nGYAtgeHDwLF7BPGAhh+bD5t6OUXniy7uHm/ut6rrz9bQWbnW1v+Vv+Ksd+5M\n88f5jRkO6g4bLGh+48irFPN3c0YWDYAXxN6TtApY5ktbGHnihpcPvyK/kOMM\nrv6qFqY/mATIlVEtBiR0+boHYKJ/uwwV+CCYpcM8H/8Up+JEKa/VLepb8s/6\nseZv29/3L6NSGYtgvlaCS4p0y/7ljBZlzU19p4jrCB+Ea5YqsnIPACRDPxk0\ntDRX8kFkl0sH556GhzecFY6KRCgzrBSJ0/XNqm5uD4+uP1WOuutb2A6ars6S\nKf0ujBQph6BlKK3TJKWoSFqqxYEo3I0CmsjCImW6cSJ+fgqAaDaBQfTMCvE8\n8z3D+03slgut1WtqgUiiD8p4M+T25bMsZ5y8LnlCjEAC67A5MhpTCKtrowEM\n+0Lx+dD8CTxfzuvyWYYKKnfz2IdZX0aUgqWmu1p7WBCYUE77/sxT8J04sEMK\nPkrfO3rkihNfcKivQbIUaA/6fchWO0sXe7fZUJBxoN3R//YbHYkaFV+tAAh+\ndcgo\r\n=d25k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCG/R1N3+hh1ci9v4tOyqk85QxqKIVtY3Cr3bi28PmjwgIhANRxiRss1Khrm5N5+LjQvTS1/VX3j9952rwA0RC6Bcdf"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.12824a93_1541585953202_0.46220508043082464"},"_hasShrinkwrap":false},"0.14.0-alpha.65c5da61":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.65c5da61","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.65c5da61","dist":{"shasum":"ceb97cb20fda4884a4e3ca1d584b12d579ac55bb","integrity":"sha512-vwQ48vBPW5YsnD1wTJOf+9oVTRXhy8tI/zwM3KCK+857lBnabWxCfwkdXKJis9vAjm70h55xpg3zVomMKQkcdg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.65c5da61.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4rzzCRA9TVsSAnZWagAA8U0P/1SLqBqUZEA4Htl1ucH+\nknItOxNO/wHoNt7g3AqSfJ7MWFP8YL6Qg6zc5tvqePPKeDrvxaVTLIBwtG9O\nznkFmICLRyJEPCYZTSltDGnnsp+XxzkxvqNRJGpF+jgv8uLAiNToIMZ0yMbA\n3KGiMV94ffg0/iMwubSpYhUrr9KCVPIeH6zhFEB+b8Z+xQhOSddM92f0Hz8u\n1JUHvGRD830vcLpZPfHcykgmQF7cqPR9KpeKu9rMEo6QZVJYLpSpnBHkfHpy\nINGgRPCTuKWsu5Pu/MJvSpyubSBKMS1MjzNGVBofz/SaJdAPxwfe6O8Lqv1h\nqUHsIDnj1/lk6LbLFDkwM+uvNyoiFyHPC3DdQhdYwL6rluQ4ZJGEXZZ4YQGN\nnEOwrgGGWvH/t9rjTTUnA4NTbpq5Zd/aCCLvjU8EiStKc7ORmiA04FIM3zTO\nZyTWzBaucos92+xr9ebnO+g6n8gMcfoAlT8Ly6hLzgzWUSLK3QkGuTkJHV6S\n5ogDHTlOjz253V0okKeaPqWNE+nZ4deKq0aRhDjVU1huMT/OciJwBV3/xjwF\nl7kV5mdLWlbWZPmtLcKwSxeRDNcbvYed/fKb/Kx6Yk7IaOAuIfuR/eVBArka\nQn3KYq1zs+GD294zUqblzTtFTx36skSqUH/H4NDDVr0n7eHqv8AMsziTZ6cE\nXd0w\r\n=o+L2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4hEgm95XEFNU66/MvxLVHLlxNmQ65ArsR7TXsWPtE9gIhAMXG9PaubNHEkJOE3JC/2KvMOcMsi/2aCRu28y4N6dIZ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.65c5da61_1541586162542_0.011584174910385103"},"_hasShrinkwrap":false},"0.14.0-alpha.2b5dd4de":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.2b5dd4de","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.2b5dd4de","dist":{"shasum":"a1fbc570d0acbab4c705d8a4149f033cada7bbad","integrity":"sha512-cGruS84AurEyYm9Fh3hL99gBhjCUWfou82FuwDn7yVIeGGXm5fKBuUnZHPfbD6dTLm7VzKFTGrOyL92/0n3fAA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.2b5dd4de.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4r0cCRA9TVsSAnZWagAAzakQAKEXh34V858lnk8YULpf\nrY1zZbicFUDV8jwbOVfVpgHlaQp0wbPjb53Tpsxrru/vu/QKQGH4O3BBdrVw\nrOjFjfRTeB5YAxHTb5OZN6ZB+f0scJnCQyUDM7I0XPhE+qjEuNeVgmRUYbCu\n/M/kYT0fBrykGGa60SyT1zpgo6H6Im1wYBuLZ/I4vDJV54mYwLvmBY/tqhdT\ng/DIM0u4zCk+G/nCPM5mSOHXQrIzfu7OFQoIArA/ZfVBZKBSPGLjWrqLCBzT\ncr8HMSeN4MYGWqhaIZhKuaa78ouaUY1aJnvbarkkN7UAwGG0/yrKGQRjSeC3\nOQABi20uBrdIYcUU3GNM8iYoO9DouODuC0QIWsI+BbzeZQQSqZ0yg9IVpl4n\nJhwy6TPZKxNvrCW8dpBRdziTrTEXOizq8sZ1yawDTmE6nR5H1jAeavV4U8ie\n/E1iht/slb46oy9ApTUA2WfUUOoFsK6WXUSe6UdYKO5gthkJIE82xlK6Hnhl\n2xUWzoGk6yVFrQ0NKlJLzYXBtcP9gPixd7Ce4+ACPNquWpZda4fD22pDiGWr\nPUk2AK4tbvTKlvcmf37WNJESy4jjvQKdix3GE28902d61A2Vg8kjQeZ0wjUg\nhde2OZkfu3ptumnOvnKDG/nJvKoJiRYdCPbjjRVAxR6JSWMUAkMvOfeeG2fx\nztfS\r\n=weEa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFp/DIIwkACUYvw3ilfYhvxy7sH5P84dbKUgtQZIwf+aAiBKDr7ELsFj9+wxY21VRoVC7clVJZiNS1EvfFAvaMEP7Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.2b5dd4de_1541586204129_0.8849650346788458"},"_hasShrinkwrap":false},"0.14.0-alpha.0dc3c08f":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.0dc3c08f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.0dc3c08f","dist":{"shasum":"312910a835dd312626230656e6009e792fa4f104","integrity":"sha512-sTaaMMu2KQCy9Ss7wTCu/LEk80lzcENN42Syx19zwHfmKf+DIir8lTWAyGYGBToU6e2YA5HcNPJ+SMR4ee6Ceg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.0dc3c08f.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4r2gCRA9TVsSAnZWagAAkZAQAIegAEJgeOgt/QQ9KEPL\nKOqFqAMOUX8MSaBrsEsGmb2b7gxDR7hCQybELXAPDZDEHzjW662Wbf5F8V0y\nqg3PfIVkWDU3HqYhld2thNK+9K5OiRYv57oyO88ISKZ+Ed77lju0H2QLx4k3\nr7OdbbLKdm5mvVAeRNDA8X6AbyUS3BdOd0lR6Ep8CrUyqFnZQO/8yIqib+5y\nsRr434mBmIlMA+EYT5eqTpkbLrgoUFpocAONhQzZg6EQbx0deyZHQDGqYNuq\nstpFEPoByCkzbwk7KvkSiccacYBYRfWZuoP0pGCI+S7+uQn8G6VvF3OkMu5O\nkUFtsk0UISQwP9aV6ESnlHedJcsvhvwnxeuUnLmePjo1yIMBtjIPGuSRttBE\nfsWWlpNA2qCDYdTBKiyTiFlwasPMMsm8TFD1MqUfDnujkXOz8DmZq3F6b1qk\nzJ8zRNWj/ugldoENbHKxA8YarEI74/9Pip5J1KzD4W5K+MuGo3z7us03EF1l\nwcI+1qRnmCBpaaM7tkEzXP5x87yw68pr7lizKiJdKEJW3e6HgHpr4BY/RmRK\nX0fXQniPqwAHITWi+SoPBV+hir3HI7guXb92YExkMT6Wgrvy6mf1ih9nI6Gf\nI0r94xawgqYVqwx24ybEgaxqd9ngwCT5qjgtfUwmHPryIOgqAZW/Lt1PdcHl\nZdaA\r\n=gVBY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGYWed2jEQ0DR00lQN/DDIqA0lNsak41dmhdU8+KCtCPAiEA2nXnnV7t+5PJarb7RhfN25bgYtKZSmGQ5iqWiBLTxCs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.0dc3c08f_1541586335442_0.3880353129907339"},"_hasShrinkwrap":false},"0.14.0-alpha.6ec6ac43":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.6ec6ac43","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.6ec6ac43","dist":{"shasum":"5795e786c9145d97d3dc4474dfba2a76a8734d28","integrity":"sha512-3WvHfoVLN7kCSqvqQsQYTgnPJi1B3xIB/IAP2CGwbr+UXwnbblU0Cfvd/De7TSIZxIF9VO9Fp0wuh+Mjyzg2GA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.6ec6ac43.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4r+6CRA9TVsSAnZWagAAc0QP/0NcPTjHMHYY8cg8uWyr\nsRFR4bu9ZiQUoG0u9vOJr68luXmGHVr9W+012XIK5cgMsN81z1Kg7VXDbvTW\n4wKHDAJ6HTe0fxKhfWVAp+Vgg2HDsIzjOLVt8+7d8InFFsi+25/Gj02aYaMk\nsKeCVv6xOcW+UgcV3iO1rqVEC9Kh6s/0gXarFH9Faz/sGUC4dKu2kNXxQIj2\neyHFh5Mhoy+hcf+fJ2V9w0xdi/gWrAtcRiY3Z/M6fZngf4wPR6S9cz/vBGN4\nJaTOrJMIoyPOQbRJFMmTFYTA0oJGtIirA2do7fjl+WSZ1K+FqjafvHoqilx4\nCyHQzmlHdcTft1diBH93zDXweJGkKloPk5teekw1WG0vJY0e/qYEakaLB6rM\nOLDvxGLxTB07+QUqade4A4KgncX6+Mkmu96+jLPTBRdRQyePHzFkWZwfCyuB\nZM6MgZA0IKWKnjd+juPWzfn0AIxRdnyINB3cyZNk4cE04pr0/12E4VD/aGAp\nnA3RSvHKvVrxTzeKM2zSyYeycvHObCSDD3a0GaIG0pVyHTAwn5WbqPn1l09W\nH71XH9nCJIineyDSH9fsu2Z9VQetMHfEE0LtogmsOUyT2zo1qGj+mbSbfaYM\n3J0y4zpJntnX/fcLJA0+XWH3oEKbzQJepS2yKZGo41a785K6geGy9A7poa6M\nNgPw\r\n=Pi+X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB2Igi1dT0PF1BHr1eNL1MTmM+NDdOAhROMePDZXEfvDAiEA0TvtqezvtIdhGAyR5ZcmpmRu6x9eRkRfJKdmg0uuGeY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.6ec6ac43_1541586873792_0.18809465340530007"},"_hasShrinkwrap":false},"0.14.0-alpha.028ad0ed":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.028ad0ed","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.028ad0ed","dist":{"shasum":"d200e4ba0c9e1446909a0d4551a0293a48d2858d","integrity":"sha512-CHN2+I1dNzaqGfC9NsWdH3PCTo2NMCvLdB1dm08FOmsjF83guFRH0xQJKnn0ogxvtuvzCsEIg44kQ+u6PGU4pg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.028ad0ed.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4tK7CRA9TVsSAnZWagAAdVwQAIreuiUQBgF8NIrHuXDG\n01xTYj4qywpeP4VAuSaC4yZqH79pz32XXHzX3+HbtNi7MJnNw6a8EYX60guO\nLZNX2I487JtOaaWTatDkLOm1vtJLYM31WWkM+9xRlKPjhcWOS56/hOpJGyiH\nbpCvy/QVayKkgogsdnQ3Ic7XlL0GxBWkhdD4uA95zjJ2rjXJnis5sKC/dmsB\nkf4OVDrqOw1p7zbPzx5AmAlV+QjJFZtHZizsW3sI6OB6Hic2GaJZ9M5D2CKL\nsalhJ67Q/rLCpKM93pvb7nrraKbG2irH714JZUG+ws/OtrTc/bydWUvVPM7D\n4ZXmnAp7Hvn0zGEoQtsVkWt4cue7eRqL7lM4oDKA4x/NMHJRWRzTooV8822a\nqVAtBghyAAMzWCk+CMV8Vr4OELSten87TLBHfkkSRDrO/4VmSPFtKr4l8QSD\nqHXa69ysAfvPSMVYhErQulz0gyywc+AVIRh533NTn4Nan/B1iD3E3Y6WuwP2\nmbNXg5e0WrPU5atlXFDTuRRkzKeMbJUJAckIyrgZ2IwhPP348gtIa7dTD+VU\njFn1VYFiYf3k69f6R3l/KmqmYgUw5wqv9wz7s7LIDxpU3fCNFr9YD8xU+QGc\nH4tk0liw0JUeZ9g+dv8fMkoRrPscSfltJvAbLiwgZKdnthKxMEfL8g75epMK\nVX5C\r\n=/rtC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDx/uQHB8zSi+6SE5LRNHQb7MOsY8hEpMaolttAPnT2hAIgfgCVlpARXaO/A1aY8WHmz/YcLj5SPkXIGMwsTQ8JB/8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.028ad0ed_1541591738198_0.5158804638964003"},"_hasShrinkwrap":false},"0.14.0-alpha.1b4ee721":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.1b4ee721","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.1b4ee721","dist":{"shasum":"e6e6cdfe2c999d277d195ea39877b451f3524fc7","integrity":"sha512-8XeETVmHjfKNxeBkwGsy977M2kjeohViKptgUlXjXZ/wGcQC2ITqU8Ip3dP6a/707Wyxp48L7RRXvFxhaygZjg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.1b4ee721.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4tThCRA9TVsSAnZWagAA4nEP/3yZwts+PSfIVJiULlwu\n6ByplkUpqb70Y1wAGC8010VaTgTbQquLaeFbJQg5I5Vb52PRgriYRe40JvZ1\nbbgL3KP+rspUGbUvKKdDxYaRYWBNqgnI40Q0F6TuFXa69rM3J/kGsr4trpkr\nhQ2m84qT6rBIzlE50FUs54eJQkuOQU2EAlxynDdmJxIPZ4rHYaQWrkFMxAdo\nNZ9/oJRqht/jd9Dg8j6eg5NTUTecu4Ocs3LjzNePyUfYGzhYe6618uKvnkhp\njweNwCl+o3Huq5zsZ8/OCBWOwMKc72GQowlGxP0Y6pTK8UvrEfgan1yBhVm9\nwcqhu2UE5N/HXlYfuQ/TJcE+caJ2klo6MjAsMT1kF708lOrpTtWQkL4EPbhi\n+VwXQ09SNlaOBrBYk/uyTCywvw17TKGreb6QH67nOM6k9f7SKp03LtWd0Ri8\njy8Gb1nvdghcRF/M2Icbj/fPbDtRpe03Jz4WAi2LNHgG4fe45Nk3tVBeDRVK\n8NvuSctqHHH4mKk+x8mhuZeQPyFBpF27TCZurcKpxNtGz81SgwgqHqjZcXPZ\nYkGXumEljsz0uWl/06PhgJxxVBlDvtpdvu++l5YgqVCW6lH1VBCbdk5Am4H3\ne9cL/srBxozR7Tg8uTVokJEx5WGuljPcSeuZeBE+S5TCcWYdOg7F0tIE5D4O\nBY5c\r\n=ApYp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBj29ScVFlKDPF0RXEEbmeaF3zeNgRvcNr2yPmolCe72AiEA5w5yDwpzfwWjrE2N1G0IBxZYZRJpriMjXRHdbzNYNL0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.1b4ee721_1541592288578_0.789273889819492"},"_hasShrinkwrap":false},"0.14.0-alpha.56eee35e":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.56eee35e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.56eee35e","dist":{"shasum":"9368ae9d7def9ebdcf69d551f181a0cfe49a1d31","integrity":"sha512-t40BE+5Ah3FA+dE1n2icaljgcz524Soddwpxuy6cW6HgQVkRFM77OJimU9Ihqj8Yov5pBfl5OXJd6zU8XBar3w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.56eee35e.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4taVCRA9TVsSAnZWagAAg1AQAIkwWb6z2uQOV6YpEL5O\noVE0UJRjQPjqX4+rdK3TkF4oKbjwBOqsyee5913TXahgeOwdo5+OggzLLlLS\npDWfU8sG//LOY2sUyiW60og3p6fSrHA7+HMVKt5lE7EQwdWYMmAHsQoxN9dt\nnUqiezxfSKwRfMEs0NsgeaNhz7ZAYfAbcydNqgG+8PS2s9AyQ1B7NkDBzNUc\nrtcH1I/k5fLwz9HSC5/HTPelVD38Ldhg2V9vHcWAP6s6LZ2bFRaicuR62jwm\nkT8tnO2Rh84nP5jThhBlXjuNtfGr6DRoc14RuTjTOyFpAYABH5sNBfD4H8FH\nwFvh017GyNcvs0YJAKKCE86KvXqaWn1hTPZ2xvzsNej7svLAsLLhqlfyYlf9\nnYUc3vpN0LOwwFz7v2tUQmUcSjL3/CbU7Ou9mEruQNa5+kQW5Y+uly5rVwlC\n9BrSB4AvIT1PXawHIYBrFI75Fgorl7zDhjskHqNA+rbfABzk1yNF0ZARjWVY\nH97+e2asJW5sXocZWHgJZ+Z6CMCnb7HcED6+nupT2jU1aPxKo1A3OnCvim2J\nI8EqLXXgR3JL6XWhUj00CCmw4gCY3EA9J4LI6ijiF5qszciD7Yqpdr6yVs/R\noSx7uJHgDDklncFLB+ircyCNmkvVQ+WGOzCnlog6P78U8LIH9JCLfkJcgN2h\nh/Hd\r\n=DjA4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD39Rhl2MGSX06/oeP9brMmu8PraiUZfbQQDOAiubLcZwIgOK2GkbfaIvCCZ8ngTTATqTjV1I6Z7bUhiLsjwVVTEoY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.56eee35e_1541592724203_0.6633930221115749"},"_hasShrinkwrap":false},"0.14.0-alpha.ad801dc3":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.ad801dc3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.ad801dc3","dist":{"shasum":"f3dcd789c40514bc2e6b95013b7a08115a5ae345","integrity":"sha512-YIhItm/5Ozsk/SV12LXmqtms95/QB2nED9V0tqgQ7qbRQ3KNJhv+ilocaFuwc+iJmV5Ltd/rwOpBcdsCH/TbDw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.ad801dc3.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4tyLCRA9TVsSAnZWagAA2gYP/24c1UuD5ySmrgB13VLX\nS9P04vacOLtwR00mXbNSiJ9fVpfQ8GEkxJXvf+jsMH6rngBXYxEGMU629wSM\nxJP2Zrzh5ne6Ze0vGk/8f5OmCjj+3unA+WatS979QiPc6Gmub8Bv/FCmGCzO\nEinaXtektWWRISMwjjXM4yf8ZUGOmdlot2r8pOouh9NYnSoiAjmZY1+nONvE\nxe05dI/kLIqohzC4rhMC7/xgsvVvmb8zPbVl+Wtsq0I8QoeL7mDabYwfkVUd\nP6O6ZorMtVT4d0mRPiR8Z8B8/kcmRNcby808xWAk+nYtebljRbVBcfbEA0KS\n5U4SiLMRkoRP2zjwibBWtT9apq2x2qdPmBTmWZmyjqA7PfhfYrxIaJsLb0L2\nIvOAiapoGUOZi7sImmkFxmKKfZqxa2GH+PxcUht8gMXmJukG2bTznKr2lp00\nT9MtOcNQZLrY1yN2HoJLpX+vJOt6vm2eHtwM9UZpJEqm9gKzBzh4IVYWQnF4\nzg6YN6XNAsXQpvP1UtZR0jACdQqCCH6wiV43BfHtz3y8hGdsk82vldXQbXf2\nrorNJSbQ9ena6su5eIXLXYZ82vncdhRLc7OVaX19X6fvfUCSum5a4UKsR9e9\nAWDYULCbh4mxO9UqNYv+XawmiFQjoOUoQgc7PHzA3jZwzJED2e72M75PcCE5\ncV1d\r\n=Yv6G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdELsy4R6kpzXxeGAweFTMbTqwLiwykkje7lT6VZdxRgIhALgyuJQnepT5TEk1QYwIk9iVp76QBlcFU8jIkVlMrxpQ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.ad801dc3_1541594251248_0.3665213371444138"},"_hasShrinkwrap":false},"0.14.0-alpha.ae45d308":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.ae45d308","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.ae45d308","dist":{"shasum":"d3630ac5af770b40a4e1d1b24544506d8cf6c5fe","integrity":"sha512-mIC7D1GWTh1qn4wrGUMIaj56U/S2s6EBR3uvP62IXGDwfKDePEf3faXFoCGCy4Ki5GnIyQi+5Qgvp/qwPRDf6w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.ae45d308.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4uKYCRA9TVsSAnZWagAAU4UP/0LrsN9YhoGd+5f+Whco\nFRrYkGjHaLxP6pAjmkLqE1F7fMpjbuj71Jbt523N4TbuMOZepunrZr8Rz32v\npWrhxClmTYhx/ijOj2vHipT9BTPpqk2V944qonOWjtTnyHl4yPnNNhIKnUG8\nzwbTFaFpm23DSeeSnynIXZnfcYA2Pmrfr4/p5zkTYJdrGnsqtbpfnSEXxYw5\ni68OI6pjQbr2JIrCETXhp14oH0yqwIpIK79Mn+/nve6jqJun3ViuVOOFkd/j\ndLn5aZhJi+psSu8INr8DCltYCchTGBtTNECr2agKDPDfbSc/USZilFj8YZbX\nCtxfOe4uWyL3xF115aoXOnEdzEVtszVQve8XnRNUT+aYumP3xBJ59LGcGhJB\nhHspNplzsCbG/lER0kpEr4sgZSab5YFDTRbhcaZnHFFogEROBxNijDdMlbcZ\nSMSP0GYJ3mwVwAxDsxYxF1lpECf6czrpRGQgMoxUf3J709HBFdXbI12XXCzg\nILWwM9BABFcKy4rsE6/+HrLtdpSaXAZSy6qjVfLggC4KoQwcCplYsEkN0GUK\nPJCltuDYNUsPwjlFaIy5+7hiTZ5Ky7TEhKBMu4GczHyQPcOab6g+VZhbnD5l\n5eFCUMvmaDX1swpyd3L4lLRUu+BWgdiU14nEeudgW5ArmlRKjEYMWSQDI9AT\nQfPB\r\n=pOwA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFDrgqTClLtpGf1JMJWO+n1PBt3OEZDvwp+QUBg8tSCFAiEA7u2x3X2qKjXS37xo4VJSlqjE86FesMXXprrMwn8pvLo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.ae45d308_1541595799920_0.21998959548724728"},"_hasShrinkwrap":false},"0.14.0-alpha.a4fbd654":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.a4fbd654","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.a4fbd654","dist":{"shasum":"b2320df8315bdcb4179ef4d629bcd4372ff5f3d3","integrity":"sha512-O7cIm9U+DnzTUYPjG+Zo5TSZuUaiQj/wyXGE6RzY/uJZe7Q1lgHPyHthOsmJFhWDIXYFaV/m02IucGJGmajXDQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.a4fbd654.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4u9DCRA9TVsSAnZWagAAp48P+QHuCFgHNOhypn+9xEi9\npWUPP/sW3HMePOxawYf6ioLGs8VQHxrZhap84hyYCMca+6vc+cVwtyJhZiFA\n4hlf14axsxhkJAD7DqCCYGHRVVH6kGnhgY2U+9ViDrPZitnE1LE0xdEzqQQ/\nrYvHUyLNHum88ARlGdXD58W6Bz67kGcF/E78S2fiLbQAuZKHW64jyWd2T0ms\nIS8PaBAaRX6czD4S332N0vu15iUbkd+DpW6xAc24r645T63brS2zGyxg78Os\nZtqzWXsWbjd2XwAduv6mLz28Fx2pSnzyXVYiNElzuwUb4eknKU9+Caj3ZoO9\njPHhSSmwJcGXiwVfju5GYV0+H/i525S+7m7B8whyqUUNuked3tlP/56WwmWn\nens1clXuWUk/zpCQ9aHLpHhfO51krzsT+/FX3FINWTwUw4iXnBeMcCE14qMK\nw8lQYgpZc35sDKs949BKeXYc2c5e++AQriQNbR66nQwC4B2CpqVq+4qKjN8D\nL5N09ZFr3EjqrLyist+N90mCYEBrgZak9bbTRDU0Tm2CQCFDfqEs47GzXC2S\no0LgMWKuUPA+myaBZpb+rWWlxe3K0HnK1nDE+FHvNDUoi2Cnjg/xqfPQ4R1U\nGrK+xHe/hrZjh8DNeF27FpZo7Buhw+PDW4gU9I7hpQyLGyIWMCytt25rxIkj\nZkQ3\r\n=+ZEm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBlyjYAJmM62No2PvC6qzLpLEWdAvVd4WSFSpQGD1RCQIhANAXO5k9Vs/0I6bpuL33K/Q9XzvGBVn75lapiJoD+Opu"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.a4fbd654_1541599042381_0.7921423596283643"},"_hasShrinkwrap":false},"0.14.0-alpha.28268e43":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.28268e43","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.28268e43","dist":{"shasum":"c1815affa35073b21fcbb3e032c0885eb17ca780","integrity":"sha512-nyXZFO30LOifIr7N7ds0YZGwFitYvFBX025aIRuZRrAXyrCSG4UxDSqtTIZa1Qp9/lNurBN6+pihSLMIXQVmJQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.28268e43.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4vMhCRA9TVsSAnZWagAACyUP/3pKbSLoRofmJovgNGRZ\netv08HwWnX/Gf/a1uc6EkY4avSZqmnV8SPeZ+MYuJWDOYoiUpyJi8c6fOfR5\nIWLxnjXA48fP3/ZSoRwG6kplNhHs4lhxi1XuU8dnc5R+7TK/zqefWT3zdiQq\nv9KBRaZvWX3nQVFXK2prvSkjQ6T4Ny3X02INNO4U8WZh0NIuY9j5FS7mQBoY\noBc/KrQggB/azMOA9qEfyzRDPYxgVJeIICGH+kC1nXhAWqezAKNexOPdqMev\nwVx4arNAIMKOJsRKWmzCs+uJWJyR76rt+uqe2C08QdmbLRH8g0FwmBFOwYlw\n1wY6i7qzzx7Ti4JWyEdm6yKbFSoNxrY+ldrT3mQECtC3Js50FCcqaxiIikf+\no2nkg4FafHIxUtQ+8ECgKOc+lP9ciA+xJxPrRuqhjTnn85amX84REXqyxnxP\njglptNI5uk0HaSSO0+/IOOPoYhVHY5D1PlR/wT2qSpGM/cf1cxexTgr3HxeU\nDo3HfrDcN3AV+QscITtV/VHeNZhPfq5625pkupKC8MjozrmeiopIdhAIU/+u\nq2cLl65SFdMYfjovPMPbhocb2hzzHbW+kXB+UWVHAiJSba4ZOdujO5vwEWCd\n7nSZrr1ugs1FBJi+pUBdfLrU9/p55pgnPj7TkW/3aK4YHdJslxAF1vE7akpP\n08tE\r\n=Zlsp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfX9HhxNFlL1iMLohGxFa1mvAR8kytUpDF0RXqUbzJVwIhAJpFoNpUaocIX0tFk6v7glKD/OthFjehmMlmnagOBHMx"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.28268e43_1541600033161_0.6343867711135964"},"_hasShrinkwrap":false},"0.14.0-alpha.609b90b2":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.609b90b2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.609b90b2","dist":{"shasum":"ec6703d75b6a149153e2185a132a14e4d274281c","integrity":"sha512-gAAJrd6nPhIfDFt555ZnyLey9GYFzI4aZjilxlXnZqbD3TeUFVPhojGIdQo7ue7WjT1/x/vyxFB/pIQF5QGsyw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.609b90b2.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4vmCCRA9TVsSAnZWagAAuq0P/3SyXl+O7zOV+vSJ3WiF\nLaLabJFCP65xrUGSwsDj9T04GhIKR9J0/4bWyZYJPX5QXCkJXEGGI4nhZYrz\n9GEM3i7lB69lCRCqdBlTLJ76trm59M4JP0S8CxID+uA7WMCMtykFPPPQdEKP\nbidZxWYbDFeEvmiD+zYlA6EJr1qT8q2hsUeuKQNC828RsqRtc5fJJtJ2i6Ny\n2j9cIi2jvfzTkcic0RdiXoLYDjYLYzz7XoOLUkGVvoJOWFYTqHlGVHcQ9gT+\nn4Grq4vuccJ2qEnqWMzgf5LjhD5pbRA1Jt5z5VII+HHfpCNJeMvAHKQ6P1C5\neqDqGLMRduYXZA8Vsc0ThPzDPJ+Kq1eJNRULojQu8drvDHiasDCxsgqWomQ9\nVrj8Qo/+E/qkjR0RfM96EtzrZCxwP0UKUZfmeyudzdisit397dM7a8puKRLp\nHSxZg8QLp35DyW2/yQXVgPhQdZj72YV3y18pKLmI75Z3fDEAuhXoUP06mjE5\ni3DfAX1to4VOFsF4KWOoIhgjRoir0+UeiPAi5AAbVe++7asC6+ZDsGuUNn01\nOowXyt5XdZBazEsRspqlLmuvfPoFx1igUuXkkfXf+MNZBvBW02ZQrt4rSex6\n5/VrbOZJ47j6Vkig6w73J3kQtV7EMjnBe5bQTBpq2VPT5hkxjKcly2IKIk43\n0kUB\r\n=bjhS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF9imctvgGQE/Cy9xW+OHzM5mSgnLgRTK8UAncDe75bqAiEA9mxanpD5EENR10HCd3heMqUGV2GTDo72EHDidips9+U="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.609b90b2_1541601666058_0.9146277882516807"},"_hasShrinkwrap":false},"0.14.0-alpha.c0b3122c":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.c0b3122c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.c0b3122c","dist":{"shasum":"fae7e8851e07ac2c80de07709ea40930a20bd8c9","integrity":"sha512-1uvi21eH0R7IOpngKtirSzUYUBKErjHahyJDW/44A8FlXPEX0WpGyQvgLBxlzx+FYvlpFRMwlKbdx6+X+/BuoQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.c0b3122c.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4xGNCRA9TVsSAnZWagAA9BgP/1U2LI1rdvRlrhyAUVYb\naMVK8FqOH1cJCq1jrcsy+RPkW2N2cr4cSPBpbQpBSAbXke6k9G6ZEfQZ8Sp+\nDYl3u4GAlxwVScX0Mt3GCw54+jmT9x/C/TNQJ2/0kWaGQEiM0Ep8lman4sJp\nP6CInAp2Ocop2v5vT3AqyVGvR4DkBNmgaM9kzEZsJySSkaBW6irQ5R6AeV9n\nJMRUgPgEDvIMnKLtvxfO0c8EW5iLCvyzVgAtWyd+liKJqx/93MyZwgmjIGwL\n5bfTW/kaMlrFTWmYr+KCRan/w2++cvMBLAfR1Sw6bISsDGO6f3n/ffcPwSQQ\nlupF8BdSDw3AkWRUBwnkPbTzFnz1iSUBAafNesTUQ1P93sP519tKX4QXP3y7\nLZliRQI9qXhH0pamqUBMVCKuKr9dKkXhji8ZWYJBnvzNYZeqbeIvd49vRdqg\n9FKw6NRGPPqkjWdJjmLboiUpwlYlzlHSyzA8bBKadSYyxdRSDHd08R3vd4So\nOdXpq9EY3cq4KX3xU5b3ydchParRNmjuXXh8/RBvb3S1ZEcNV9H43184JSg1\njQi9Jc+e/f89l+4J+rEECZK9p/v6jT9sKm+f+yTgGwINLpwtBddRRvCHDLIY\ntBCSLWegAPilpw0/E+7VZiaRerrWEbBX3a4R3bsQ5cXpkz1f2n/ebnYgP94j\nvr+c\r\n=V4xm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxVe2yODod4SR0QNtDjqWVlCR0OSBlJq2RESVkCGXqPQIgD4VrJBOhw2cjuthzr8OxM7t3nXJD2dg6zYSnZYv3iLw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.c0b3122c_1541607820937_0.851700935087744"},"_hasShrinkwrap":false},"0.14.0-alpha.cbd3f405":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.cbd3f405","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.cbd3f405","dist":{"shasum":"3cdf68c7bed4cd277679e41827fd19c6c1348e72","integrity":"sha512-GtsMEsgUZrfQwhlKXSahgVxMK1mD9G2qiM0QArBo0/2NrG/3tLuZTdv5prbBVBkyocyqV01sH5efpwkm44ytNg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.cbd3f405.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4xG8CRA9TVsSAnZWagAAi8kP/12HCFP8RyApJBsxJdL8\nFBLe5zbIc+mVu4h+/eRDNed7fDeD2t05TxhHbU+eTkv9OMJg/TH8ZsnPXNxW\nwUXJAaENARjIpLEBPW8Fb0AA0KFVifXFPn9IGzsXAT0JXeGP0vfM4ESc5Z9H\nEeLk40hoRw5K2txKnx7E0+WkrHPOGK2b5N7uiTxt3LlbYV8118F6uhBSV8LP\nlwzvj0DLeqOj5jSHXaKcRgiUzhexzCcXQXb/29evzrARr/9KqAhkDH9fN6Iu\ncduGsh+noOiSYhSwNBR7T2DE+Tv3Qn8g+4IduEsPjLkaBelpdsWMOjpQO32q\noPNWu4adaknEwWBeV+Kd6tszY1Q9TOmwDLQ/f1W0xnG/yOAiToPoknHw8ZI7\ndbduKZd7bU8w3Ari9KfPvr7eLpFLSSI4zSSPeUN+JoYzmWceHspimqzLdEIy\nt8pHFZnh48WH4HH7RTwLBC3ArF+h8MaALtIow6GxMfoTToFLWi3m6q+DxkNU\nrwCVmZJkOQObMe+do4WtQFQAd/UUmy7KaOGkikhYnmrKNvHAh+6NE7vjoGzz\nzMx1aNZ0aNgrG92wNCh3xp9NvPCuBh4N8VaTsYJBVrEDnF56ePyMd/5xGR7I\n+jlwbEXFbk7KblP6M0ujQRa095KE9QeTtod/eWbcNkPSTmCP/Ie0BaRU323N\nVLcZ\r\n=oMCQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxoMLceslwic4iKeBUTkMAbJ3FtHZosJAFfnbpnkzaugIhAPO5F7wU7byG0Zte1gHUojRicj2kr9cjJtjSjK5VJ23O"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.cbd3f405_1541607868073_0.7667676745832368"},"_hasShrinkwrap":false},"0.14.0-alpha.0088a6ab":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.0088a6ab","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.0088a6ab","dist":{"shasum":"f03a685f070de5892d3d899b5ffd31f38d48d6bc","integrity":"sha512-aHVia3D/apQdwLPwvouDq1bPB7zb3vrW3WX1SUiIGCjDvQXTbEylvchdfy9gZoOwPxVAqekvsYJbZInkgH8h+A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.0088a6ab.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4x/GCRA9TVsSAnZWagAAi8kP/1rJFlPw3ue/7xav2J86\nIVqKCZUX2odfUcsMJKEFenEegie0R3BO5+b3XXcngcsB8NNPbfh9P//r/GIK\nJgLpCH6dDFdv4K3y5g4qN6OOPxDptlfkMhR/oWwFSSG/fVKHatB9cIWq+ccT\nwLoPkXcVIuht2qKrt4xeAyEA31KjkSpVy1U1V2uYGxtRam3H9SfsAqAZY2e5\nl+11IZqdcaLks6XT/h9lUSspjQigiqwznRO8GakMokS36sS6BMScwSXFQCcy\nAcmid0EOnfUVoAaqdR8oBTF6feNigpuTFdGIrvAZsJudNLMqSvPZJylqIsXC\noLHHlv5bvOstmpJ7yZdsbYJwuOHXBq5vlxkpGk3He30x6hHdZ4UA7o+xThI8\nWBkqt2AwIonN2IQPFWpfEf+1iFGKq+BlExbfYfOVT+ozToTbLkjaPZfLrs1c\nf09kGCxPpjIiKdm3U0iTkr9ikzBPLfA4hUZfd3YWR2B53Wkrok+4sS1XInGj\nxwC7mZhyp57bJhSYFofpKOdYIRJJByANSJqLBSC2JNTrhT4ki8Ku/ob1J1uX\nKlga7tk6LtwEeQ3hBhs/Uw8gR/OU0kchy0moTTTQMlpp6pCuEr60GJg6EyyN\n+kvs7Zy55ID78MfwY3zJ2CfszUItLWmsYaCmcZxZp45zzbrLsyDq6Kd+xAvo\nIPg9\r\n=YRRg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4zEbtqb4zBa3B00XlSCq4D41LvL0QPxgVCsPT7N+csQIhAOC1lfpq/jEGvxSau7NBIAGWtLjiypvwQJgclbIfKCnf"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.0088a6ab_1541611462338_0.8068844104083628"},"_hasShrinkwrap":false},"0.14.0-alpha.51ab2f2f":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.51ab2f2f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.51ab2f2f","dist":{"shasum":"a2bf9a4d5321554cf4800a1daf9e07832f70e6ca","integrity":"sha512-gg0omUB7nrRittemQyELo6PPOvvpvDpSVBq7uTA0W6vcjFqHD3OHiCuhQcYnlAaGDvHwPa9McFBNg447IPhuqA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.51ab2f2f.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4ypWCRA9TVsSAnZWagAAps8P/R6zVGlW7x5DUYpsF8iL\nji9jAbB4s+zxMzacJ5JpJtJ8ueRS6hgE4oD04ab1YL7h1cCcoPYwmhzicL6l\njcEwrM71Yre/3sCacnqFxfOtUkIhuKg4REpi+JKf0WY1O2TzDUQOStwMA0tE\nGIiNveuYAe0nuQcYgew5wpW0qk2oMljzitI9CVefCwTF5Y94b209nMFzPV2k\nEKczV9tdlEap57qKPaNShiNRNfQkLB3EXeq70HMoPOvBsRkvO9L1wvbcSNDm\nwZqvqsvBtsDJcmeYNNIodQievJ6rP/pHlws1fHZS3LqoghZadnqplQbLoN3Z\nJT2Zm68mxIGnCDkk7jkaLiEZ+19sUOePHS464/HLL0ZiEV19V97bcrNgoF9Z\nvO3rSRI1jcaEO/i0PTAUwav4YAxJROXlRSXrtd9vxP99ydvWwlXVne8qomMs\nZ0EVTzT4/tX2q21F+XFoHZhrwlDQqusu9Fe8G+MX/ep+7AauaHX6FNhwRBp7\n6gBt/k0087VlpaYqf3ggcL2RjIXxifQJXlirJg1y41nhXL82bJMpNq8do0Xf\nu7Wi8X7KvOj6tdzKrhnCWKZU3hGsbJKgt2JpwVRC9i9WdfeUn0hXsDUHLfAZ\ns9GBLfRfgTrsN5vYTFZV7/K7xBUsJp/fRObgt3qxm24+S0GxCV4IT47i016L\n5DJL\r\n=mFSb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbAMwekGRhr1LX97kHEYLRP/Nvl7rT04LM6dCu4DcoZwIhAI4JtgxcJ6t4ejQDAinI6WGUMGqtVxZsDBprn7TjQ0Pd"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.51ab2f2f_1541614165932_0.9336883583584341"},"_hasShrinkwrap":false},"0.14.0-alpha.9218e2b8":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.9218e2b8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.9218e2b8","dist":{"shasum":"3a259e357a69e04f11049e72ea51e7fd3593b7bf","integrity":"sha512-S2ldT8NefeYetNUKUR8Pwr5O33i3fFqwM6LpPmonNmo8neWwsMD9KeJFuCV3yP3X8IrbPXwPs5pwNyFOc+qkcw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.9218e2b8.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4y7vCRA9TVsSAnZWagAAHrwP/0EeZrI2keuSV/WJIJIR\nkrWzYK2lye94qffK4bd5SJgVtMB4tnmx8UZn747NI0oj5Lnsg066svsQDvsB\nqD3zUTDQv8OjJjXB6qXZtPcqfHnyGQ/yHBsPkkh0lcf51qEGcTOoQ8tGy0VB\ntSf9bSc8yyDlBUoPtOY+F0nRK/Whj30ii9Sc7U09He/Ae70TgIsfe/Q1Lrwm\nSpJ75MKD4iowzAyZe+JPTgv7w+uV48TOvdmJXxU5z5Ni5RkUeqAh/zMJ3QxA\nZzdAZuJvpVqdOpNw0ahCsiHPK8efYHZ2a3QidX36SzPWttQhKfKIHb5N6oyj\nQRVHFItMqdg2vHs6M1w2PrsHp6KNPdGbjnHQ1cEnGeFJ7bZ8RhKJ84J4kXxR\nNLozW/BoeIlqZniVMBX2ERPnjuXZ1htJZr9kEy32Vy3Hl1abF/CEEeJ+EXvw\nL5p7Vt3xVdCx1H+0tkpi45BYi+LV/fqwpxLV8zGmsGd3RNwotHxxnQHZuBye\nwEsHdrPR6fvWaFvlWC6kj/o+KrQknGzvejPxtQF6XOoRMEMPTn2dgywy9+nH\nq6pVGCrbd8pRQFiIukraGsqc2RclQ2kycooI814MijuQWPp3eBKZPTZBVB/S\neadPM4PvlD1ciEVdX0XEjWmAciO/lmv657akg0eIUJB/Mukn2LakW1qXrraM\n2qit\r\n=jkSD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzceixBYzhSun+fXbrvlwqi7oBSLfuERsvrKFh+55e8wIhAKjGJjjYSNwF5llgGrB3q7HlQ2aMm25nJUKla+nDuusK"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.9218e2b8_1541615342623_0.29917762587596997"},"_hasShrinkwrap":false},"0.14.0-alpha.70003040":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.70003040","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.70003040","dist":{"shasum":"6ae642aa1ad4ebc5f26a0df427f1dbecd306337a","integrity":"sha512-IeUH2GpXC+NjrHUKVMAHljs5xop64RFQ3Weaqg3UeiU6NkAet0te1EoxcUB1qoVhVZQD1QV8SuGbv8T/J4uXqA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.70003040.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4zDFCRA9TVsSAnZWagAAjw4QAJU7vvoegTt6JRXLJELa\ncNbcoLvn6LhSAzZi3jCRIK0+mzZ2ZPItUwJyoz4ud+bsW8cUjE5KZ0QqVQYY\nipSHlggrecYwmKm3IOn5FtUwtKcIpYeRkHRjXAabsvv0lEmV/Glq9S1myIQ4\nASHeYKClHupu3kqOjKWLvRTq9p0vUMmfC3cikWmfDzfKWYc1ng+aTkedj+pY\n7J8MH+ZE5q450PdSKu3L+qWMTTQXcsoREhcHsZBy0nBSidk6bANui5KUl5Bz\n3sczgA7VjGH37WDj+rmZ0DCk45JJRgownb3Bj94lbnj9cF2MQEpu5ryWH9qH\nHcy7Rq2h0MXg6IPbrF79SrosRcCPLZtOI1i5dPV+cwnvIAmhRckAIz/2Uw/R\nrVfFzkrKl09tA0gUIS/mwSjjTTK5UcRUs0UeipDwTycmaZGm9hMClHDtKgBM\nwICQuSZwllhxYFdOnK1TsgQPOoM/hQfMa18NCKPgF8LXrOqEJM/RlIsscJm4\nnmN6TumFsS4WekUF+iv5c7uCLokWuIXWzrD731uJ6fz2tlCGctCyFjh977LU\nzcpMBlccXB5ps/SJ4/UuqlmuzGbm2neiXvhOsB+8jwLmO7DSjoBPGdvpVEOO\nPLcg8ix0W3lcECof67y6Z3y8xuyuuFD1lLlU9CQgyy81Gm6HXhy4NPl4NHob\nz1vh\r\n=sRV2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICGpZ3Kpx4QiTgmba2BPF7XK7H7H8NSBhAgmlomvmwzHAiAMdBY04nL8y/epU4PsxQimvjqHZyTrbkDXRpjpj0n+kw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.70003040_1541615812296_0.14791449610877505"},"_hasShrinkwrap":false},"0.14.0-alpha.ccdfeb71":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.ccdfeb71","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.ccdfeb71","dist":{"shasum":"bcf4ba9f157ca6bfe973a6589016c3959fc6f0fd","integrity":"sha512-00kBQ/zrF9vOD7UsSlV0n3eq0IVkMZkSLEbl4CwlUxBfKiOhnS/PFrK692x7xMxrcA3mHldR06E2Wu4RNisFBQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.ccdfeb71.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4zz8CRA9TVsSAnZWagAAMtcP/37vjQ5MjXTQEKqPNM4m\ngMJ5YCyvlU70lPQ+Nlgmaf4te9uudih0Hu+e33fVSMUa4z7f+J2K+C85RCEt\nnex8eiWVovnJXeYbebstvZcNWtyfupd6o2fFrpf9qC/b91H2O8Kv5lz8Gz3b\nseO/6Aie8M5pHTxRm+iTkyIzZxDQ7FuqNLKwnlbKTN+DhYVLYv1RqDQYqoSh\nZF0ase8cCiWrSCAmCqI524S6w/hwG1aYiWMpOHeupViB0RvcqXNl4BmeDTmf\nNyMNHejJgjosX38pmPCuycjT+YBvYz1p6PRsmSbwLWuCiKTCd+0C17R26Ytf\n144IRAaIsy37FMsULkPnqIraB4A5BqOJ5GQGlDvCWJA5B+BTsVKN+wmQ8HkY\ng3aorOroeema3oQvAMN0hOKFqW7A0aLhfaT/+UrG8RGaSvpLpwWcpZSVXBDl\nA/Sak/eZMQYFXYv1D1guLjOogPR8nFXCo+4clflus1lh3ldJvvpLhwAHFA9b\npON7lOSzVL1pfIXu5ch81yLrBdFXSj7LQuMvIAV/ox4DbXToMy+fhbd+TT5s\n9UpCnHlsb58y+ff7NDZTcmPhDdgTNTh3epi0Tc1DV/koPvQ7UY8Dc2Ptp8Tf\nC0aCCO7zJy9R3nFQpRSZdDbidvaDOaTiu2gHsdYsscjdbrdK47K9PFDAR47/\nvvYP\r\n=N45p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBNdlE3tGIKkaSK82hQt/Gh6KmyCJibDg5MGpUHJ1MYMAiAfeWTfp5kPnblRRNGmJFarlknfRG35IENQL+6pTE8MdA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.ccdfeb71_1541618939138_0.7617734985863744"},"_hasShrinkwrap":false},"0.14.0-alpha.a4838807":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.a4838807","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.a4838807","dist":{"shasum":"ccefeeacdb4792fc0e8d1223260f24007de69fa0","integrity":"sha512-05CPu3wx87oy+52FB1t4Es+/et6Lc65z77uZzboy0/yRDYinerEZG6HZFCQD9yaby00NhWCj0DcuGYGgUvvC9Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.a4838807.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb43iOCRA9TVsSAnZWagAAbfsP/3feWC9UxtS+olqZEqul\nk66LnZlNUQjLIXTAhnbcCquOqrb30T+tt7Oolymio3kcEmnkHCLj2iTpzNHv\ncDnh7b/zB2e+AHer2UxmVae/Vyb7hTHWOeCk1BY48LMWXPyO7ksKXQm61kWs\nDLCqGxSHHGZDKO18+JdC5dBksFmbBm8jxZ8mInzCUTmiC7Ubsl8pIlH2q3TF\nVKMxBTziGVvWeotxNK0b98xD8OJp1OOeMs2OmG3ebwAfqaAM1ALmyX93QYxn\nvg6xVVEonCL1eN0xQ2V6FTGeZOQEqcJ13YCNd9MpjZbe4B/L0EEaDfm4oA3r\n1i3f+JaFiuWKykU7wo3kohAtsrSLr04J1jpVabqTHEsjcP8RHe3IfBhnlkgR\n3Hzng6i0lh/eJM7EJb6e9oTKuBdcSp55KrpBP89F8/rSIXEHfg8T17lvQBv5\nt7IPFdbEagcks3lWYa7+EhuiPuipBIIrvw3YvRMRc6iB11xa3VHkLUsYbPeD\nLQNtZny9jKCgd8NQwVCKj9VfgJMkFS2y55JTnzvOIpnYTB+mWCUfcPWgZXM5\nWBa9moc4KggCT9NM60/Nli+NL17KFWqcDgsSvAP2j7ssDHkmhPWPhb5VYATC\nvde8ZhyO2Ihv0Zfol6qBHXp1wVwtkj4cdCEwZ/Dx9s/UQicwVYddxq0YV7yf\niR0U\r\n=kbRz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCztSmjDNSUaqBJIXZRhCrp3cjujPZTCBayaO3Hx0l7xQIhANVmjpRe/DHNNt9DewAYdqnizTa6lLn5+G3WujiVZzdF"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.a4838807_1541634189729_0.8559393307066065"},"_hasShrinkwrap":false},"0.14.0-alpha.ebdda7aa":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.ebdda7aa","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.ebdda7aa","dist":{"shasum":"7290b3d9c1862c013f574e4fb3933c3963d12a72","integrity":"sha512-sYW/cg3DzIYOY2xIM21m9WtAzZzNhcn0Wf+zpx3gffAkOFTI+mh6XFC+iHFVVaKqVFg7yD0khj+imyEnVkHEFQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.ebdda7aa.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4+CrCRA9TVsSAnZWagAAaaoQAJDkyxqiQUUHoQcMMEjR\nKSzDu/mKKWzvoCuzuAtPRTCHQpUXm7DAd8bdMxtSHyvkxtYCKxBVgzA9VX+4\nwB35MUMCBlxcglNjPqHvMoMGe3+O8cw8QR7LFHr3ZQ7Pv7kSHVrwl1Gq/jDt\n5KvWzo5wzvSyfIH36ymEkKH7yTBfSb4U8dSZUY5edJZx4AE39wKZZ1N85JhK\nnCgepFQU56KKVLrC4RmNBUkwWOmc7fltW9ZSkeKWE4bKKeng2fdZp/Tu2zef\n+YZqg4AOg/i+rgAVCH3h40TFBsEtVUQq7nuHOnQptp8+ay19hc4hTuEOWcfl\nBm3U5RaIVIyctsEcwK1wtdIQNrnguizIdUj8ngMgPU98fhNq4yqGzyJ+ZEd0\nKkiaFCKEYhJ8MgWnzMMtDQ2AFUzhfx391hE5XhY0dbvCdwTeWZHXo7otfIgp\naV+ye6n8eYHY8uhoZkwSX46E1R+B1GaxG7yjinU5w+qhU6xYaudcvVj2HngO\nY9zVAK8gZerhXe/pbM20TNk7SElpdoMYzkhE16DKSvMaF+o9PID9PTg7DcPJ\n8HK2kGdASIxtvB19YP3IRDI/6nfp5vgNxqDnLDjwBZFljnq0EIhrPzDNGeBI\n8YzPjlP4LuKURP7WUmLZbw4p8zwT+XV0A1Uq1BkXQawQsa7/Nxr6nWJq/Cbw\n6osN\r\n=roZD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHG99+FKcDjb6H9FpSWaVR3fwajTh4XnpgHfWIVGCsohAiBYESsIJ/u9jQ1qkvkHWPyJBAGiMFUtlY8BW3BJCk+04Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.ebdda7aa_1541660842198_0.4221360290302991"},"_hasShrinkwrap":false},"0.14.0-alpha.8d8bee2f":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.8d8bee2f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.8d8bee2f","dist":{"shasum":"5482b9901deb4975c28749c4eb43ad24fff2d64b","integrity":"sha512-671Sub36pPLIHaVFbsJ+XieoPN/4ZCM6ldYfhVganToQVvqQOrUuCXSZaWK3oWXM39sBP7PRfy9RPbfMTzwJ7A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.8d8bee2f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4/fnCRA9TVsSAnZWagAAPSsP+QAQjnVu/YYxgSGsnmw1\nUSAgSFtKyIn3yL8+3Fl9pBiYPGb1JaVNug4KB3PK2UdcBx5MQqFRA43vWZTr\nIMMP/76yMrmHFVIhLYwVerzwFqu1lyiRg1KqkoAVoqeZD1VAEmHYyGMp1U1T\nPqzBGanMvrhoNrJ2js/D32a5urZKAyR0nRo1IQL6Rq+PtPz8NhkvUMEg2x2a\nJEgXmFI5PiMMmAJRdiQK2JYvDGmFIPz2INiJcQiHUNCeOTI8wD6SgOPEwBwa\nKz3YEef9dYoXNH53cBHbrRQ87Z8t+PTeO275dRN0PxvtWPv76kkNlsp23Z90\nWk0ruVMbqK4+YcXx//yuZQ569stM5C/cFppHd5+ftXr2aF/G5V1w3UJkH2qz\n2kS42aFWjuzOwfsx2ZuYVC6ej9bdjSO42MTxx6tCEdPyQd44IWamUqOafRJx\nFBvd76zEu5jsDsZ/jx2rT3JM4ILf+pnmT9m3QSAeCX6xoKLcM2hn/noGzfE2\nISxIHpNunkWXLYH0+QtG+3enlCcJV3orn47ACvOWYbzp66Resr6heSJokQ2l\nGmoK90JiwlyT9TuRW/QmmZXkg9mQsCu0bwP/yUuGa3QK7pN0fMoHFcO76YCl\ng5Ahc+Kg3ZH9YFeXn1YJHNhbZVTPwexEGTpmWphL2Jsfih8CdRJki2UVs5jr\nFeno\r\n=u3pc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEQ2VrznfyGRWyA51KuN52D86AAWKPOn8czXOwMX+eP+AiBtEO6GFDWFB4oq5ne7Gxdp4rbsPK+o2qkEJYi64J+nVQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.8d8bee2f_1541666790853_0.507226881415143"},"_hasShrinkwrap":false},"0.14.0-alpha.c9d705fd":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.c9d705fd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.c9d705fd","dist":{"shasum":"796d17800b54c9e26d7e51ed666512ffe42f6e88","integrity":"sha512-CGzEdAoNBGBvaq4KY09of4RHJRBjtw5RlOyOk8t3xALMh5tF1ur/h+CZPzR0rfBZrxrwIrkMqmQzRM5TGDW+OA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.c9d705fd.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5ByECRA9TVsSAnZWagAAi4cP/06OMRoCEcoTIr04Q4XH\nHcBri5IaYjnhoe+RHppBrmtOabZy0AXDA/8bBoVorqeu2jkcwO9bJKXP82vN\nqQIqOFXM7JJ9uf7R9EUzuNhD6FwO863wjGwwBVJ8hLCLbQCt5/XeK8nBeFkM\n5FewTwwDXCM2aBlNhRSk1jyKXiHPSId4WReIbYoRQRczgao4Pr65CI9xzzEV\nSU99hgJaXulLMKVlxPTHUoNpY5PSQt7ntjHvfgTdWCzSCmq67oU5z2bzkK6t\nf+b64PqzWecRmhwlj3eWUxZfwBCMllt5tTjAcKCiwAQAqRA5DpJJjsMJ09vp\nMeLk2yZu4xNxbTDTlqnhFYHdeF1EqpPiyNXoSSR+xADe8Ms/tf15FWw2q/TD\nfiiB30ktAcb0QTwgmiUqGLYMA8tyiAROtcHCsv+jCEWCDUrIOp8g3CMPjT/5\nXS4p0mJ7KclrRwBoZK1TfrSFhgMh1xPO3+v9Abf9gB8LBbPK95JzO5sKMJ3q\n+Is+7RKx0ONhFmeRSddc0Gth7TrfY5G9MdbeHP934eL5gD71Lmzz8WQNyE5M\n1oAtoVc13LNLDd9SQtA/SOgWe97OxSQTWUoj0qrzuu3GuBC72q35RQuUKWfi\n5pnoeoIZN4ZUX+FdC7XKpUhnrSPDuXhHb7SmNBXpow37KoA0Czmi5LEEXd2M\nRpki\r\n=rZe5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsaEFtL1wnweQpuhS016M+s0dXhQv0CTWZJqqZfdDp4AIhAKk+fMWzMImNMjgGP5Aihh3qquoyLcGp4WN3OXK5fIGs"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.c9d705fd_1541676163800_0.8297675159757516"},"_hasShrinkwrap":false},"0.14.0-alpha.79f8d805":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.79f8d805","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.79f8d805","dist":{"shasum":"a625ea44cb8356c4746273bacf9015c7d9a13247","integrity":"sha512-koWvb0GMIjeEevaX5w92++3eZwFeJeK7KTxO5JQQuN++KE5VTwxbngWSJVdMQ3uRAE+ckrdYZJFK87Eq5RExnQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.79f8d805.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5B3DCRA9TVsSAnZWagAA1JYP/3GD9kZ9/f2QPNufsze8\nUBy8hA3sZKiUGxOztgw1bEzd8oNNxftdYsmWukzCfH8AP63s8E3pmYt9lGlh\nhAaN/lH19nDb7NlwN4/yu7mDY/ytgbESivUpYpsUbXCoa0CQj9lflUK0JWDa\nQhkVMMCzYmjBHtWMOgFfI5odaakXQa2/zM+W7ryPuC30cxtVmX/YfuHRx0CT\nZ8tdU07AkN9zcjoJi1PnO+uQNEQEMX+1/ulKhuhvKA99HMSYBkaS5Q0Crg76\nJXNUmsM/54nb3AliIXQPR//YkV53aUgjd7VamWbFUlgtzHlyKvyVJ27RdbL8\nvs6x9ss/G4NYB41FhCeZMGp/lduGICF11VGGe8hjyvIULLgYiED5Tj+hxIxV\nEGCO2qPgHCx1HQUi9AzUgvDVaswar7t3+EkNempWJGuHUo9L8BGMgfCZ65wG\n3Mmo2jTazCmqbsfhO2L7kER862a9rSL28clhmD3N0O0OFeLkrg8A7U4OF+3G\nXkCEJezl6OEmpmtLl6QZeAYKwfUfPsLzIFfO6W8Q7aJC3C8yqPx3qr6JzEXt\n48RQ8RKbTFU0mK0LYGfukAEaJlnuKmw8nvEmluDFASCgFAdct+A0kzsgmg3N\nXb4Zg9fFKQN0rY6EzkgbhOeZBoWD7oF+89hQxG5HQlqKGmts0r6kGywK42UD\n5B4e\r\n=WGIq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRCHt3p0719jhCpqhSxeEQg+vdfHFFj7LA5bAh9NtTMwIhAMt80Hn2VOzc8HXWhxDaLa3and2S9mtThswB1VIkOxhV"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.79f8d805_1541676482856_0.5389821379956321"},"_hasShrinkwrap":false},"0.14.0-alpha.4a64f195":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.4a64f195","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.4a64f195","dist":{"shasum":"16ba5a022ad115a5b107c026442cacc07e8bb19e","integrity":"sha512-mxH6h62kvoUgTL6gktSfZkTTUA32memFRwgY10ZpeJpgqMRtnGt9ajPGTtKC2drqGW4MIojEPZbSkvJ+G2J1wA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.4a64f195.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5B4dCRA9TVsSAnZWagAAfGEP/AyyxP3EjMjL/resIFi8\nosNC/RxGGDgA0aRGHSuzE2f/m+0dU9pP9hdtJ6iXUXLNj1giQ8Jrnbo48nnD\nVxVcr0ohndkmj05FLgbsTcZb0KhqQnCaDMEq+zIsnEyCx09d+j4w38QpqMn0\nZBDtNgOcKLkeabnZak1PNHkaKGK9XRu1eRudv1gpRgK+C45Jim1luzyOKHbf\nrZmKxbCUxyX4RlpCPOmSA4K2BCvaXLSfVJkuS9ALN4C8IEbBBSf+jfOzW12e\nwkpleUYfYYswsAUWlVpS1KcdXw/N8VcsQB1DIRuIuSbTTqjb0X5VxTFXLCNc\n4Im2DgipIiNA0mkQBhEWiZDp5rrPNOAanig8SCRiwS1uF3QpQcnvX8drXd56\noxk0D6fhNyBmkCGV5dupWz1FupqwbMGFeFmrbHBKKQfYrSTifIHnMZ0r+ktz\n0kg1G7s1kKlrza8296ook2F7Bjq0Uyr9uAQea26icgZdeh4TRuSCWK9MjqBp\nKhgC19sQUedjz4btR62N9UXdVO7EAyv1oF7q7GLW8D63Ar2/9NAw49Q/mzQH\nZUuJgcbLW65T8Ls/jDWnTvnwPqXRgsrFjTlHooWRH4usOXkx+OT9VatBY0/n\nBn2AvVkrxA2eRdAJURTdM3Hen4O9eAD8q3Z9lkc9p45XIoNZ0OovyGQeoXd6\nxVCT\r\n=qIas\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAHU8YAQ6pPY2UCjgqXK6iqY3wukEPGeOJ+5B48gjjNqAiALagSb09ZQJmBY4ldeHd/1O+rhXFwQAdf+p67cV3hLeA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.4a64f195_1541676573027_0.3777270253241274"},"_hasShrinkwrap":false},"0.14.0-alpha.07bda304":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.07bda304","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.07bda304","dist":{"shasum":"7acbcabac12aad7debab297f74beafbb158f0a1f","integrity":"sha512-p5pDJ0euicRQF2on007prc3fWq8Cgfv4vvBLE2Oo3cV3qqHttuENGXJwHobQ+SbvKEIBiH6oSoyE1afC5iwlfg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.07bda304.tgz","fileCount":22,"unpackedSize":16712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5CkrCRA9TVsSAnZWagAAc6kP/3tu9ns4dF9IsAEDP50I\nBF8tVjMP4sOeOuSSpfFd38b4sHaONQ+wc9HS+P5adqCK2OenCfqOdEeOmYLn\nEDCZp0aAscuB+tr7xwUXtBUkT5pDUMgjsqGASIfP9d9V4JPdQFu9ssRMg/kT\nBiM9DxlU+VzoNRF42JF037wH24EWWPFSL0ZcGzi3BrMT5fzKw04nwZhKDJTl\np7DCtxCnmwEChQqVXfmJ6FvDVKpbpvxP0r8IGKP0Eni6k+0bVmRfWxPo1aki\nVBchEHX9KnVL02+lO4j3WlWeuNub/1YhxcFVJ0Oen8kjdkqEq3+zYTnOjOvq\nr2Bntdc9+TyORP49kudYpolJCSrFO3hrtRIgg8HDPrf5Ca+AAoxzfwKhz2K0\nlIiFNq58uxUWrMBBG3J8E8vQBWtCnzQyX22TEYMCyUJ9/Vv7K4/BeWzg4eLT\nF+anjq+CWpDXxHb0SZJ79XWQpszfKqC/G94doixl9PlU4gLmLLbhA8gnkrYw\nzVD7kPzBdIBRpJOvR5Psel6Pt3Ujlj/R9gXmpPk1n9GaLji9ASFP9ii7Mpjz\nHHYz7o3RZJmR0Y7bZbLe1KJyuAzCXX8RFyubRgVKS9W7FbKjHyYgrd5R863w\nwLHW95PtS6CdnlUx2czH+DeknCLzqjj2zuFV2iFgBV/7fq0bBdR07UeEG0Ve\nuPYd\r\n=wTOH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHqAgG05bagNkEOmAW9UnESWoyfGKrlKD9CYIeBwZefgIgEiTg3vYT5/Q1K77jBN3tO5oNbw651pefsgfVW9fWpaY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.07bda304_1541679402647_0.04013033820872125"},"_hasShrinkwrap":false},"0.14.0-alpha.a71f9d83":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.a71f9d83","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.a71f9d83","dist":{"shasum":"cd09e8f08fe53cb5f668def221053cbca05f8599","integrity":"sha512-Rl6oX/MtrjwMWX1kKlFjy4QzEmUPul8Qa6zo7rwuvg282c35wlRmehb/1PpQlx6TR+DcoZBJGaunYeJ2yL1TAw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.a71f9d83.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5CnuCRA9TVsSAnZWagAA3doQAJU/y5PNBwqCwhjC2xJn\nYSdTmNDqzMSymSwrZMzl9O8OVBFp4hNJSpa6CNtR2kLzpzszcajGC2x34rTw\nzxT1zUY3A4C8BnihJEknI7gePgaxsVYETXE+LnC7ZNzht/3m6XvxwFCINElV\nkMG4xnzX538+m8jkvqb3SCAu4rKrf1crNn3rE638WDyaH2ltQn1/mPpxHMR5\n+dp515Udn9Tk7gUavjmrn7lRpeD4nZtNavY3T8nFNn04n32JMDhXxqu/78dl\nLzwsNjnr8vYNbqvmjm/Btx6eWesgjkjd8rBMvYWOyUmBj44NrguNOvBOcF2S\nysZDePEoHzuSmHQ5cQ2eI/8vwgEerdafAcZO2PV9FrQUTN6YUXUhRaaaZCJZ\nr743W/2h1c6+Mltk4anbLh0eBMkxPyI8xCsCwTwqC1WnDpONqGNSq2VBPL9w\nFE5rr/DA91Iqtg8n6QCSo3YAdOIaC72nGmiH3fIUFTGJynShJeQ3Fb0EaKrP\n84pilIbtfB6H/aRdojSc3aH3RwbWgZqwiECaVQSfXeSsBrJgoU8InGRvE4iB\npZqlntsqtCaMV6m1mzaQUo9LH9/TsaF7umir/Yf3ArVzxyV3PhDVkcUYgWRh\nvnAEe2G4MvyJXAWLemIUXxFQGYs5yHbcE2NIfUDjbAzbcXfO/HUEN2hw1Syt\nj9Va\r\n=mISq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLPscu5W8P5gIRuhLEjr3zLRnDu/N0DkB2xDlbMQw3KAIgH2ulZfbJG15Eo+6DlNkU0GoedSyUFGu6hAHVJAQi4zs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.a71f9d83_1541679597618_0.6028119431931511"},"_hasShrinkwrap":false},"0.14.0-alpha.0d34d7bc":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.0d34d7bc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.0d34d7bc","dist":{"shasum":"267055226ed8e0f11aae7a83af5ee8edc4b82697","integrity":"sha512-TJpg/re99x0WP3eC6i/kB7dW7T3OPWbLmceqdLa6stjMph294Kfy3KAxtaw0mJPjGRolOlrTRswg0ipfd9ED3A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.0d34d7bc.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5Cn/CRA9TVsSAnZWagAA31QP/jXJ4BohDgC4gk2jyJym\nASTkNjyoPGXMtDTcrY3Qoq+tvC7oFISYe5EPr5JtEwv3YhXj/Qn2SM6uLv+U\ndrNHzdX6rfGIhSaYujjWfIX+/zLAtum2XDihewV1Zo+rnvcYZS5gXqeR3Ydu\naUir4Q9LefplFJqhQkNsRdIIUF9It4Au3MgR4vKn62Bbg6/CmQC3mpr1fMJa\naoBS9BhFVCK7WaNx67pyf9fPJ/snTBvr++71UiZxEi7Fse7rYlfRZKVCe0a6\nV2nplDxDQ11DjmzHBT4mOv+OmgcSaHgRhnH4mPK9YSLJfq8yWrsdJ2G0j/2M\nlUi4REN+H0xrRGqiov/pBFoouvc2QFBx9SLDPiOmv8fRXeVml6ychusg0/8P\nV2XoVrhPQgPlo7LVKe+ZlmtFAje5IFAklswNFfA4dS2wc+RxbRE1ZJXPw9iY\ngXAQqihbWSa5ewNjyP6os4I7DFRMM4ijeqPb6b836KuTV5XvbuM4iLVvsPpR\nkOEIWMIp8bBBKxTJohC79ZfjAOUd6P8hXbtvUP/mRaIIeWpQcWnBWEWXcYgj\nqGOduwSKWzo2/Nr8z3S2NIJoIW1QyWsp90Y0ZA17gIvr1Z3G+k1PK8iEBtYI\n8Mo3+EU0WMX0hrrhyw9/shTKqujs+gdFm+nZ/8dN8JnxNxqCILxmlZQ9B/A6\nI2GI\r\n=iQ/v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzetILgZ/bOJuVMFe7MU5PEuDYMlq8M9k5fOwbUZRJAAIhAIOTzk6Gasyf3J4IFqMTvxaNmaznz4ZoYU/sgBLrzo2R"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.0d34d7bc_1541679615276_0.5905479586298532"},"_hasShrinkwrap":false},"0.14.0-alpha.5d14f9ae":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.5d14f9ae","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.5d14f9ae","dist":{"shasum":"76ee143ad9ef49ed7842466689d957289594a952","integrity":"sha512-qMWPSDuSXfYhk4QjF/qaXy6VzBZF/UUGOETb8g4tMh4d8ANshHzUqDgCM+EIKqKN8wq4qmmhWkXbr9ri9zjD/A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.5d14f9ae.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5ColCRA9TVsSAnZWagAAXuEP/RITSlJaVY4YCxgWQbdT\nj1YInSgBqSWyjBUPyztF64YFAxHnm9sG3+UdP5r+tVyvYFS4SVVHZvJma1Oc\nGkUQ+UGv6z/rOm3wID5ypA+KrXc6+AjrFUWydmFELCfCcVzw00uXtEpaEHro\npnfzh/fJjv5KzItMOoj6A4wyP2wPTJwK8LusD+SLsjOTegD8lYErJez0pW5+\ncS5tYd9tp6/1pcTneRmX2moKkmnwclTctPJz8AqbvRli1A0Enu6eWnQpYtcn\nnxDBFxf7g5FcPtpXnv/GX9m76P9vyVlkJetvyTdmBFiMEKDKRZQHA8nmwunk\nnXTXhGD0jOX7WNXOZ/464CvkmjfTU50m3C4y9QWZxbkSeNRxOR+mySJN0Kwr\nyPfWvNYMtUrDk4YTzmVhmRXOSo9iovcb1LoN8p6zoBL5LHYVCCGtqzB/LY/a\nYZ1N6GaB7cmWPS86RIptpvu8Sy+WyWVFJO7dwCvPwDRMwnxUSTsZiZg/N6S5\nUWqVmrVawY96tAuQDoL2sTZxFCQmDap08u+XojEjas7R6BZtLPzfZGE910hN\nrpXCXcFcAHshRHTFNlg9UGeNasVd5ZCsrL+ZvBhr3h7Dxgt3MlGwKejXhAi0\n6MXf5G1Kulhr3jKnj8xFDk5ASL1nycjdhYwldzZvKPorPIpfJidFT2xyVg5W\ngKmJ\r\n=hBi9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF/9zYeAzg1RWz1MKnH6iKJzoyU5x1R14QlMkPTeziWQAiEAlZDA/GoQ/iruqNrbtxNpLffyCjxjBT9eE0/PYmwFjNY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.5d14f9ae_1541679653070_0.8054962189854757"},"_hasShrinkwrap":false},"0.14.0-alpha.1effdd2e":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.1effdd2e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.1effdd2e","dist":{"shasum":"e7e06eed33fb55d71dc9c670575371898f4b8c6a","integrity":"sha512-AkiSFT6m3wInE5T6JK85Khhi/XQtH+Av1Lh5VHz+OL12/4QNDilSyYg1p6HBYgm+RQlSxY+I96HbF2Qs7r2oqw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.1effdd2e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5DmUCRA9TVsSAnZWagAA3GgP/jr1b3FyIz4jDakDjdty\n1XBfPKkSN1O+AxWY1pHLCX4xobhHNE5a8yIkXsT5gCGy++ZlKsSZp1k40+N0\nffetL0d/uIfoqTiccDpw1NKFpUazyWe4odJdrjtlAKvkWG/1jkSQk13AHj0p\n2S4Q37OxbZitGcL91E9ZWj1vcyUTHRrTW7S024KZShBOHdyh6EvYbhlqMZ9c\nCjvRGlSZr6h5SWRyY3ZCmx4OvF7b8MWn/qU06WCoNavyAGH/r1sgVw065ZbR\neRHeiNJv5wYZFdOvIpFBu2RsT5EEWlKzH18X7S3UpFYL3sdf0UIMwElCX7PM\nKKgNB1jnj2gGX+Xh56uZ6pEV3z55lmT76K58udU0x+dOtFm3yMuawkeoU9iq\nClhZp3RV9LbcTdoogtiMMV/zbIPjhWcl+S4wBoNRhtHMqqYreJ3d8fmmVHeL\nhDcTCtoZvPFL+x7Y+BbpDXfpuI3ic8J0ESdKag4YEw5qwZDqdBL5HvyJrbMf\nPR4miRiuqdflNLESrTbxFMpvc3DKs3G/I7iqTC8sWNfVHNHf0PiP+s0DEagP\nhEtKJpC+t7qfpH1LDq4iox4w+TuJujkvvHETsI11iRzU9Gg9AytiUrs3lK/u\n1dlTCrpTfpahk9qPoRcBzeH9SM1cKVjlV59phZpw4W8rmqdB2msCbu3q9XxE\n/J3i\r\n=UIYr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQDu7g3L7jLsjztrR0fLePSd/KxJN3W394w8/N2fcrztlgIfJZVn2DMPFuemf0tEjqkwF3f5CWKV6YvT9hxl96l93g=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.1effdd2e_1541683603855_0.7306814939920114"},"_hasShrinkwrap":false},"0.14.0-alpha.33699d2b":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.33699d2b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.33699d2b","dist":{"shasum":"4afc51e7e769eaca9ce10fb12411b442f24b7c11","integrity":"sha512-iGxRbTXCGS9ByJHnfCnOzuYxq8WXzdaPSyRZy3CsWrn6NYa2AXdsS02Y/PP10ApL5h+NPntHb4WEYYLVoXddZQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.33699d2b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5ESECRA9TVsSAnZWagAARYAP/0VW/epT3JbAYDjJcWY+\nKyf+uHDXHKuIAlWQSyslrEvcze8azp0sjIRET6m8rtUhxkudJV7B8hpn5hgo\niSSkUE0eS67b39hFUzZaVpHwWNbpidNoYhjK+oI0f+bNLdTxf43OhAInmLAf\nHlFSDOlFWDiKIt/jPd43QlAIgHsbSo3+f+R47lBGUzf59lBWJ0Xvi7iCm24K\noP6HGjc575yv0T7CiXYo0QMRQV+wy860f6O+/OI73rREG53bqDplE4DnzoD+\nJH2f5X8hRXo0Lw5vqmcjtCFfLV8SqWG9jd3I32N2S2Rgq0yYdN+yViXoQwvY\n8d0w3yf0MqcNkshSCVM217WLa6T5tRXMPuOZUIz2NLDQcix6F3uFC+1H5Lyn\nGtBFu9URe1OEIjY8PLGvJlJFPxoIYJ5E8zKZ81Lnkz0j3AN6kiAn64XGyvXT\nEjGFvz9SicY4Jbul21+RhxYRZszDGF+X2nlR1ta8QWkHaPLj7ybWMNfiKB7e\nn7irrhEblUo40TcBXsa9tGu37oK74tCcCRYzS4JJ+rU+sC4hgpwE4P3R5e+J\nm7ubTquT/cZScMjxQBz9I+WLz4SHGOmNzqqsM6nBUE77iChR7j8W59Q8kOvY\nVXueKNTuMwmqD9IhpwwIMHe2a4aUxZhDoHfQbwjB9kgmMx2BUoFsOmYh13Cf\n/pkF\r\n=TSqN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHomZzAc2BeS41lpsINYvLUN9hYZh4PiIKeMAK+cvq0lAiB/sROHUgJf3yXD3kAQmIhq10/CrxqjC9RqK9c/Ct4tNg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.33699d2b_1541686403946_0.5770145031889322"},"_hasShrinkwrap":false},"0.14.0-alpha.b04233ad":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.b04233ad","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.b04233ad","dist":{"shasum":"2240e3d8063f15d5b210e46c20ca05dbd4e7a446","integrity":"sha512-z7vs6zxQ9x1G+cllDEOjH6sGDjod+e3Z5okNUQajl604mFrgEcuzQESMyi5sURrlH5XBNwvE0MZJBiEB0Nzemw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.b04233ad.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5EiOCRA9TVsSAnZWagAA3qEQAJPRUvUj0LSIkdP/do7B\nF/V3465PPZo8VSvlmyRbNBQbf9yuzezD1YhfKguQhXdwxqZde5vmDZ9DrMzl\nclp1rqVGqjbHHeP9I5SyhJbBEGYzn6ME5FWqA3tkqsWdv2EOVgR2mGXZtD2S\nrjDmxM6R5rdNft9Gv08LAPo4I7XOZfexnqM1TAolbF2nTY6iT5HnxY5XPCRS\nHjv05BbhCoPqzlDL6W0eZ5PrL3xcfegT7Eucxu6Y2oPMBtUZ7yh1Kw2fYUwC\nXJLDMOnwnDYtD+VNjFjQbbHxuYSEzf3/Fi5ppxROAAcw3mlTQAUgVJSAyI/a\nUUpuVZW53JTsP9c4qZsXJa49gpOCBT22YLmDwDDp2NJ3RP+B06eulj8s6j5k\nq2tXu1dtVlu8W928+1zkRcvhPDS75qN1OOuLIVdrt5P/9KjCc5hoSnX5l6+n\nCV0pJSC/4KqLIGRXt71ry+1TIwAUZgsjd70dace247ZjzazM3jQnQpep6/jv\n7Ek5gHdEebPPgp4jGN4izId2iAv5G0q5SSz2E3jV8YL3rIypBZy/S3hohvR8\nb/nZtFfo/ath/t5ouXl+z7Mo2PP4mJMsQbSitTAgMzetpQY7t54hUGfXDBck\naV6fWZPeqVAfWg7Xv9X9mUhACZMBVlSwbwaKJkngXYVVUu+hEG+v8vS/QShV\n6i8L\r\n=tSa5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtBwqEFRCRGf33aYshJQzw7rWVFJRG0yj/aXZtw5Kg1AIgOfip8OUlt/1BdZcm+4sZ3+SZZ5m/1IhAjKGM37MJR/Y="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.b04233ad_1541687438186_0.15115527702956477"},"_hasShrinkwrap":false},"0.14.0-alpha.deabf4b9":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.deabf4b9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.deabf4b9","dist":{"shasum":"57efcabf1708b70079fc8de54580744e6b1a49b5","integrity":"sha512-5HFHcGLRCwsnZinOaA2JfSbJJSBEkHxSMgKKQRcUzV77HVsVqfkwJyXqfehidC7WP84QYGu2pH1LgNYG6qDHuA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.deabf4b9.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5Ek3CRA9TVsSAnZWagAAdnMP/2HPydRQbMpqROtRDwKp\nBKfaicuo8xuTRzM8RZ0FHOZPrnvKUU8QswlSSyNH3YG5uxdSk6bADNQJlRpk\nlRVQD3kCViMS/ArnPcVOveYCKezDCX61lY53w3HR1EZMx9luqkNv14bGHBdv\nOEReP5uOqjpGCB/PrbjSKMHcm/3nyT3cCP+88JKu/42G0ArEMXwz6V6l0zPy\nqB0R0hwVGLypCGpxHNwv7YtLswW/n7r6rFB+pCpzkD6BdKSvZTqFl0UQVFd+\n9EKjHdfWXtydvQbWmnkL5zwmb3HUcVe0T9l7BH8IDCF+o1j6gY2m30fXbem3\nyhRgs4b37Y6miiIPdC5FVqYX/sHFCQq+nv7UdoQobDW3XQHu4Xpo8jK/LzBI\nshBq6RknekPFU/8kZnAiOSwEhzQZzcpHdxb7HSOogrpKpmeW3CkbIxph8hBN\nUXYeMjFuLNS0TphTiq1apjGh0XbDnSvDLOtSr7xN32+QcQBYAOBJFSSjy7wt\nmnadYc/LRJ27zWmhf8m01Li8MHRRWstpppCAE+pBWeSWanluyO0dulKYOjIZ\nhi9gQ1T6f+69jhey+BGaoRMRJU6oGQBoInu9apszv7zTL9wkvOJh5C0wS/4v\n9y+9beAihjJl5MPaRXhOyOfgWydr/VYapbh2Qgozl4HePwgAjw9kl0SZRqg3\nxpuP\r\n=iVuM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEk48jdNMDFRHM0tiQ6sMn060OCAI0TitBjxgvwWUuA/AiEAy0OQVefOsOhw3RnZ2qgseHzMidjSK7irvHkolW+rKZE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.deabf4b9_1541687606793_0.9671151320849369"},"_hasShrinkwrap":false},"0.14.0-alpha.8db877df":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.8db877df","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.8db877df","dist":{"shasum":"60fd05df8b8bf7b1e703c4fe8d5046d60fd15109","integrity":"sha512-yXtT8z3WDcm9VJUxQJ9L7/5b+laQTVNiQjMZWFIBMpG+gWBu5ukYgBOSH5myq7ZZMEJjPD9y9WnqFI8M8i7aGw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.8db877df.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5EzWCRA9TVsSAnZWagAA1DMQAI6mzqrAP2mmtBVD2FKd\nM5gYKSfcP/JjPhVRHms1qSXr7NPlDg9eG87xOYs5K1+dmJ1dY+c/T6FoXdZZ\nXsqp+1d52bXEbRyrjCxYPDnjnJ4/zSymFWh0egZW0JFZRaiFDIF757ytaBM0\n9V5iymaZ2IF6r9UyCkWRam+Efd0W55fq/bJ3XashdUVuYZklWRCBvLnFT5ZX\nQkafbCRRkYDcV6k9ScTUJgwAyt3Anv/rkl2IWpITZuLu8alVd/O/hteSM7SQ\n8lIxrv8nGPjg8tpW8OYoVT7B46Nm/P/SVsI5U1jMajqWNR3O1hJF+keUTBvS\nPHKBSdLwqNSkt1de12Ec6Xz/eIkw7IBuO+noSbQACc50uEHcjDvkAcGeaCSK\njTQa3GyyyxeD/9VdpKDyVKbYuVrWg7aDux8kiWaAHc2WKEAt8WmxvaNqq4ic\nA19z6sTAJdC9sHJMBvm/6U0LecHaegwkQ5Wf1wCy+pO4z8B49sxSnXMnFwAQ\nDD2cTNlCyhYuXM/NNUUwX50nD6OAIJoS3FO+NrJnT2yOl8GklicMIWGk5ax9\nEbb2i4GlBx2r4+fgrorcgzu0keJaNRxacDYV9cdohv6rgfZbDb1iL41k1YRo\n3K4Hy6rE3zuGiN6nMbyFL+nnA6wrSj1vERIAXNO+xzK20I65d9/FtQ4hRsXn\nhxyJ\r\n=WjmV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGG1+7HFNvYTjFHyOHxtcW6qlNxvkkWs7aMJBB6vaVP8AiBdzAORFrWrmaK4fmBI0HfgGt9plFHLAbyTbI2Vp8w7qw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.8db877df_1541688533438_0.9203888235303885"},"_hasShrinkwrap":false},"0.14.0-alpha.f1e5a0c0":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.f1e5a0c0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.f1e5a0c0","dist":{"shasum":"0136fbdeead9f41028d897d2b10e1ab07918bc81","integrity":"sha512-0nBV5/Lgx0rp98sns4dLJCE3/BQne+sRSCZGRsofcqVHTNtvYbaE8j8tBUZ/Tnj7BtVElIBGimIHMiGwW1zoWg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.f1e5a0c0.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5FanCRA9TVsSAnZWagAATcUP/jCRu5M6qkXc8kbInysg\nAoeUinWDph3+u2rLhcHUWnd+jk3i9FxbaWWkf1q0Gfk4rkoygZRzh+/0vQBi\nPjuM0+9dJIvEaO7egccyvT4hUd391Dew0kr/AQF370MqXkPIc73l9Ds20a8q\nT3DMPHFTC0wiwQuUYSpdpuxDFtU7SObkx6rw6s+VsnmItNaevXcLv7A3//pr\nprV4jBd4SbI19AoL484AF5XmnX9kbQq9rVqc+b5dyN5RKFOAGPI0GsPgnFko\n3xhjr0zOP24apzAujB90DqXMtE0Hpb6gRlHW3bcTx05rZ7mc/ktZ8/EEWP8T\nfnwnmPOi3Z9jr1k05EytuyOvPlDVDvnrBa+kM919LP+wO9m7CRCIpTue4sw+\nUvLC8emaeSvfP29qKfba5wRuxNWJgKkSbV6/siYjcsFypDKvao3H6BI+8suC\nInxVA7AakUPFUynm7cINAocN9aN6swE05wXxhuiMBQ8seTHdNhRIo1E1Sn6g\n87pZLWL/JzTQpkL6blyZqcLI/FnFjZTfCUNPdUk4MxzMs01bLYmBc8nYzsW8\n6mY15M3eo6n5ToJ3qIk6zDrOatkLgZrlsZEuf28ui0M2+R4+B7R1anuWtJwG\n/FIXijlHtux2oVCxCZttBc9Q+8+jEYaZiprxOE0n9mA5LTS9sq5S5JT6M4Qq\nUOXC\r\n=N2+L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFxOZ+TLKrp93kK/6An4w7mu/klBAqVv+wjeECPz7e2QIhAK1lFrQnuOmDGeYuNW3ObBx6uPUd7Ve8CvFd1q573Ihb"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.f1e5a0c0_1541691046838_0.2033665396607185"},"_hasShrinkwrap":false},"0.14.0-alpha.d39554c4":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.d39554c4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.d39554c4","dist":{"shasum":"0be0717aa894840900a7b58c9bc7d6aefacbeb17","integrity":"sha512-ugoSeAYfYeEDyEexzs+igr1aEFl+5ucCh6XfPEuLVdSBUQLcLIFL+davO2LibG77/NLSLA/2Gc4t45QiGYcOIQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.d39554c4.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5FdJCRA9TVsSAnZWagAAKuwP/jP6hqYmG62cEUAZabsk\n1DGIeHhQ34IlPxC/djTZ51WIAPFy5XfqgSa5NN+8wa4BASwk2+dTYLHTNT/w\nyDQ6k+4ZaF412KMOrslVGOkfeCT91fgD2A2oYkMbiI2mGOmd84lkYcoBPPnk\n2MfSIXn8HhjtMzIYsure6x/Kwx0scbcfWSSsY65CFTJcRkePf3c9tf7Bw0j7\nysK3Nldu/FRU7ceM8+bx0ZNISB1t0m64Y5dh8G1d40VMV+0flbo1fHihnXEc\npqbRrucv825X3q4zkmrLMSHDq+l10hZlKnNoxvl7L4KuYbS1mSJOQ5VwyeNe\nWqymcx7BrMANnmnMQxM5REgEy2cmkooA5p27oT4RMrWq+GcUH0wbbsEoxUmA\nXWJD2K1DOmCEaLAY1n1w7KuLJEnUqZxD+zznnXu16SdDikZJI/Yxa/8AtdHh\nFoi8fEqtVy98cRFaBPHXs59EqQkg3G7w9pqARnB0fl+H09CY1wCNsBbzp3Oh\ni1a/IZWzNgor/T2e4CA/rPCk19tA25+ndpCeCykYYMHm5OHI0icgbx23liYK\nsdVK8L28TyngqMdWfxSYQF2wYwLfMUBgkPNeDaKVY5neEsZZGoeM+PNCHOU2\nfcyVv69Xx6lcmYzm3OkMqE9Xt9G9YLmIPyeCy487WnNMBB0zsIl1Fw0xjUJ6\nt0j9\r\n=HpY/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDCLZZjO4uNellD9M5NDDc6iU8mkdo05KIY9dAPQEIFOAiEA8GEf1T69o6LgiYffpNYbHounr3DtvqlCSxTFz4eNZd8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.d39554c4_1541691208392_0.9172463117025633"},"_hasShrinkwrap":false},"0.14.0-alpha.4f6651d6":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.4f6651d6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.4f6651d6","dist":{"shasum":"2889ec7c5721db0ea1b25689d67ae155fccc11f0","integrity":"sha512-zhjdkDUrsTb9eazIHupW2TvU9Wmn9n77cdZ8e+cTY9aUO+rJnCdFsSQWkWm1Ny0rb/4/P43Z5gbe53A2nM27bg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.4f6651d6.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5Fy5CRA9TVsSAnZWagAAUAoQAIB+23Sz+NkZZtlVxCFm\nhBW9HmSug+frvLZznTz7mKkxlErVwobPkwNGPduFr3bVuGWgBEGTXeGf6Q4y\nbeyAdnd7MCN3hGsUtSKfPH+wwKUmjlsSTt0AdEu8wsCBgEQ/OmHqwdCZ6Ac5\nOYwV8NZr0TmRBenhD5wCneZCJE0erXnWXJLIdupPBPqB09iwegfvn7KoeACZ\nzvkbt6HjKVYV8ns07vRYxHagFFR7kb4ChZ88N1TA7FK52EtQ2VImJeMozsZy\ndBAkQTfmRcWffawG2Oc65p3t+sacjz/7I0ywnlWPXHgqWoZU+iL6J3QzrxCg\nCJjFK76T20W5yUcM6fDFVXB2u+/mXBgTQ2F7p3vr49EPbhA9B2FTNEypd/E+\n4BqvEHuIN7IdZ0iWctb5s/aXfsgFF0tAxJbWOsNYvgyLNJkURyxlX+4KrqHL\nrP6oSB35DUe9MKXonwvQ+ySHYZ9uArda6wXsvNOckSXyWXfL0zptAzYkOgDP\nE9F9X0OAO9q2ywz3Dy7icgdKGEucvOhIZXKK/Ch62ezqvNbxlg8nm5z/NKFt\nkqXMaPfk8p6+IjdQwpI/wEqoBEeZEBVg/G5yVt452pldxnnxaybN8ek/FPT/\nk8+YvLsNfLO+QXcGOiQIXeeOeZZBWIxSZWdBYrEPS69uA27CdnKfx/JtruAG\nwQ3Q\r\n=Ygf2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiPEnPbvuaIisHMawW8seFhz3jhjRD64/5Kc64FY0ZbQIgcG9fGq2dpaOZGQfQ7jXbNNA89TvJYbTaMFnPWZp+4rk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.4f6651d6_1541692600496_0.07632765818699361"},"_hasShrinkwrap":false},"0.14.0-alpha.320d80a7":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.320d80a7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.320d80a7","dist":{"shasum":"1d282a8840bb8a15a61293885af5f97778439d1b","integrity":"sha512-30IKYYjZ9tEc0/87gG7AAHrWcDvZHm7JsiP/dCyxJSkJJ2JZeVNXhHKo2Bfboq7H4hdtfvTaR1bwWwtHjgXGkg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.320d80a7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5F1ICRA9TVsSAnZWagAA2Z4P/i5iuATpsVOA3znztE0G\nmKms3zpgBQXZmGkUKOplfDhvsOOJ5SzBJGmlvwrKZodzGOqwjlQ2Yttj2UwM\nAhpEZFf+8adtR7AB4kNuJtxFT+hRYbpXiCXSe+Arv8fyEnVR6p2xgN8eQ7GM\nv/jfscSLpom9J57Q5REcykpZnnoA4E+r7jQCLiGUWsQpDJS2MbuVYKpehKQw\nYAWnkkEnedXS/LI47SBogATmp7U7pQYouMKoTA5xL/tOL30YVvlyqNiEDF/d\n351V8UquZ6taglp7LKHYD0JHdD2vRwOKc+EtE4JnJxwHL8gmqN7V8WZ8Dmvk\nyyTo+B8550nxHsZpEr4TtdeXerMOGDz1xvoLy+I7K5Pj35d8ZM1OLFUxs5qo\nNwtfyK5NnGLbRawKhhoQj7V1lqeWe6BwWyMiDZ5RyWcZVFYx0030BXg0QXYC\n04JOBNiJkmch4wNgJaAGRv2bpEbgeCGFU0IUMHIcEnId3wTDLkzJhGrXKmiQ\nY0tuXQXZjiuGRxWLZ2aNUIgRww1EGZaVpDldF+EdCRjQpj2HHNQjRdepJqe9\nmtsoBTSYTEwbF2jAbM43HtZ95t9QG2zgHm53Q9xKC55zvFiOGVWDEk9Y6R4d\nGu0rFVZIUybjxVY/nVtFwJGGUfP1Eq9UZTPG7O+ob5I+T0P9tNDR23t8MaBX\nqO4t\r\n=h0lR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICzat1fILd6uOrzmSm2EK0xNVqTSv9qsnMRjx+6iFqM9AiEAn3pumCSluiKnu/f3l6KYdYvR+y8nBt45LNn3e6es+pQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.320d80a7_1541692744201_0.8048261027579384"},"_hasShrinkwrap":false},"0.14.0-alpha.9fd01297":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.9fd01297","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.9fd01297","dist":{"shasum":"f5b16ded05a422b9d8bc7a04bc63686510a9c0dc","integrity":"sha512-N4d4eyWmJ+RccgZ9JF12nCJTb03KCMJTrO2VbbWw5nqvT4wJlRi8MpWhKhjEap1BWQMyRdS561yd8+i4tEUPHw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.9fd01297.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5GUwCRA9TVsSAnZWagAAUM0P/j4yqIuiSLWUBYU5wpzf\nTtQbQKzrrXa65wkKh6uzXSSppTnG0OluPwv1faBY4u62CmuXLUWPtEr9Kgdr\n3fC45WAmxpB7p4WQw8h8eKQto/wdZQJRKa63rHLo5DwESpgACb4oiPo0L0ua\nzOza27uARE8seykVULZdRW5C466n/5Mffzpc3GMQbaX9tjM66WBGKP3QYoIx\nIpTWNajDMd++y9iMiZmG+Id7HZxm/zcxCCDtk0rBc7xaDaMS3CJsYez6+OV/\nDIRauIW7AtgAFPwupFSAxQ5niSRli7CNLj8sZLQHVP/ACZOy/mqTV+qnVFgv\nPeBvNgxSk8uOQeNA2Ki01MOdvFrfXzvib/fBOAn4qvMHJpilhs/j+VniaRwF\nrkX/YH1jf0oUzk3lIXjKb0opS0/iusvb7H7Rf6Efvu16MoE92lqsR8nNxGpp\nTGSkdb1Q3oN8SmC/VqH4fol8gDZKS/hGVp4W6+j/kCc51tMJU9ISiBDRRJmh\nU7ynUrUrhBDs7ERtGKEInmOUR3AJZvGbNYCcxqPRhwf0aD4Thim2HC9CDrWa\nzg7CpK/Nfvekf40PF62rjZwu1zTbmF0oxEdWOOpKw6tsffLajZXLTq1P2epL\n9rpHvDslEnnszGhAsFXOfLrLAVl4RA+s26pGmnL78+bWx6DXU27jsTJjTIqf\n40on\r\n=3bfG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDP3TRyA9K9l+hGwyXKLBFn/BoFUPLQ60aUkWmm58L/GAIhANfNz3xivpa1f1yjB8UHeSR7coXcXSFrOcw6Ekq4/rqf"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.9fd01297_1541694767587_0.9621817720789854"},"_hasShrinkwrap":false},"0.14.0-alpha.73107458":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.73107458","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.73107458","dist":{"shasum":"206a9e19382c7904ca690c7237e233bcabf3757e","integrity":"sha512-QXh2D9E1WUnYaPWXadmQMh0yTc+xPYLNTtbK56MSJWt90+CNIm2gM1j9N6c6IAwAygSKjCPtyP5hZ8Cr0W7S9Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.73107458.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5IMSCRA9TVsSAnZWagAA0SAP/izszz8Nl8BMMc07zPiW\nSptr+Gj8K9+uOn6yEYB+EobeD1MQfA4BhZ+XtwK+qGQHI7OSUknjTSl9kdND\neakVOWCFcV4m4CeVrd5AzeTl0Kix1YIEls9i1GfVZHie49wNtZWV2rcGTgXP\nbJy6c79aNj9ZMlDIL8RH1EkUvQDzuQ3V+zejV1xAJ14obf6fFNLw7r4bQTmV\nNlxY4QUkUItrEad9N7W4+f7eiiVVKsUb878tjCmHXhtXmAiIdeDK+ZI1RNWt\n0o0D1h+6z82DMJtNzv3KmY9Py+PH7bTnNkTW6AjVAmAAKeUU4RHR2TmM35J7\nNTab6uDmstN+j4KbL7h7sGYwnxfXwenadZSfUiM6WmWYotIaKp5tkd95fwhh\nJodPAlv6fQ7tol1a48mjqkInA2HeOTRIqf/nUmDishHLqpcQHSWQIVD+GReH\njj5nu1ZgbcGVvy/Jq2LNppnHLK+6smsk80XtpNA/0CcH9G9Gj36FqF5IRHPq\nUN+X/+6uKh+0IDjoaqLXw8C3v4JbN/24LKYhhqRbSbNGgG/1v5UMg6EZI4xo\n0zNSxJTPusyC+tkyYB+P7xSTHxa7n5V9mFPfYR1Bxtbx8l6J/UeCzSrWUbIK\nYYBbGbi8SfxWPFtnqbIJvhEpa1rer+bPNEcaLhDwCdcNhH3WWcbar4HyiCRk\nQ988\r\n=pCFN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1h2e3Z3gGwkDQlbUNfu1ZRj3ubu9NHn0V46sh1IiDVgIhAIZ5gymYgJFG+yLAenWUuwDnEiF1JOD6lj7DRe3iVZUh"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.73107458_1541702417728_0.600248482443239"},"_hasShrinkwrap":false},"0.14.0-alpha.9ae230a1":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.9ae230a1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.9ae230a1","dist":{"shasum":"e29cda36eec4eb1d4f49bd82d477a995fa24d4df","integrity":"sha512-AwQrgVRg8hlpOOkXEU6MnbcJ5Hw0DTMN1c/dZiq8VSLXnksa46Wrtla7yI3AcQkCVMLQrUIyKT5XF2HJ23ctzg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.9ae230a1.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5IOSCRA9TVsSAnZWagAA+nMP/R0sFlSJq5FfT8iJhGRW\nexzv6m2CVMPAxd8Zqg+tVmpwSz58Jj/3fA52GvfhfWkLrIveOONxrBDN2V7H\nPxuSOskiTuSQuWFrlCj/ueMAkuxdUybEXYARYxsJbi8E5Jz7s8ORAgAeeAJM\nu9RgyzaYysAsuuP9477KXh7Up8zrPLXQAJ9OMHY6LVc060j1OU3M3JSr+2HY\nM2kkMwuWaWLu/6aT891AvT9i9qde+3XhaJxiIhUXN/iyLGi9M9dOLfqugHdz\n+BHWNwN7Zt6K87JG2myi3yzWjXPQfF36JF6sS6QgvCaZIgdK+1zLIsNKS9v4\nD7wQfPuiQiEc6/4SsEdEYAlFKe12i/UIFLHVPXUWNFBr/4LyWUXz2Fx8dFdX\n6j+wymFJ8WrKlADzXaD/cqvTu2XqFauvi0597M7R4Zx8zx88zGOHbZ9FXl/2\nHYXWMW6WZaj/O6n3w8FuutA82mEpc8UhzhXXrs8Jq8N8SJhUewTRRR5fZSNz\n0PBjWSGI2EWqYQVuNU5HaX5KhMO3dOnOqkkb6A/unqiS8GCM0TR/sKEvj867\nmVggaewsmxIBwC/Mivhe/JdrETdUOrSfzSLG8S0NCde5Rl9D5H0LeI0eWcn2\nzIe68FFCQCp7m/DcdFhpZGSK9uziDyV59p6KGt4dDtdNnoT6EPt0IPvnM1zC\n4eNO\r\n=cvw0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE1VOe+/sn+q1WRFzQ+RkWz+eWmQEcW56cJT96/9mW6hAiEAk9MlQt7pECj2jbvKXu4EQ6X2r/9ydvwDlSWwBamkB0E="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.9ae230a1_1541702545771_0.7402065196207195"},"_hasShrinkwrap":false},"0.14.0-alpha.75231e89":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.75231e89","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.75231e89","dist":{"shasum":"e97724f6565376b64ca561ab95b6ba076013a024","integrity":"sha512-L96SY5VKloHYJwzEdXT5V6As7XOWJHUJDjq5TmzXzmNRjO2Lxrsrta34nNfcLDdAoFeYMVbG9jQH3L5+RTirvA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.75231e89.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5IhCCRA9TVsSAnZWagAAcm0QAId9kfAxzvCPcVdrI14P\ntfOhMuVdPWTKuO8+2+05t7YCr9XHqkXuVQN7ZYIzlGwLzJFG0el6qeKUhY87\n8lQsI63OPAIWqzsWNHDxoNBqghgr/J39niDAuR+7BqWJykNro/QbRSNQafWt\njNu7+LtysqcHpM1snGWsJCPgBoPct/VTgPbU1CspTcXaNWz9gup/IlQettXn\nOHEP9Fuhy+DI6NXN0XK4p5RpuDuK4M37CAeiwxIzm4JizUZ38WzcoBQuFEu/\nxK1C0JQrRfCwCSYa5ioirrm50adG6ktZz7IPfRM61ma4G0O89tXr3rO0uscf\nHdVIUO0eQ6AQT56vJZhX0JVGZww1vKH9UobQ3KjI0MiSAzv2mlVpE51yytTZ\nBuQeDPe07D1H7nISpVbJRg8tjYHRaA6zgrIMiHK3RLyucO88khU5y2f9fjue\nGbNyMNT01G1GUU0QnpVCqQi7vXyy/vzhgrbcDZNyDdo/BpBUaM4rWwIbeXPj\nmm4N+3YY/kFdHzJnVL9wlHLAckk5am2alJ/zaqJeswfmvlD1hEKQUbe+HqYa\nHPidSytFi9umuhhnz4gmE5BkIreqfPBlLVGlo6NniaGMYacAUbCQ1zgde7la\nGWkuvqpMlduitlgoLzyyGQs6u4+vNa69Nos5jJECHTlifFXMDVG+W6yow4Yv\nVokn\r\n=785h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5TuQu07xCm2v9MpzKwo0kyIJUJxIT0kV6XKqzW0uPwgIgcW9fSYUnn8iApNko53ZwIRofE2OnSg1H/Trokf0mLLs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.75231e89_1541703745957_0.5043281771907766"},"_hasShrinkwrap":false},"0.14.0-alpha.f7561c79":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.f7561c79","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.f7561c79","dist":{"shasum":"d4f6ba758ba71974cc5b3da369bcb94c99cc59dc","integrity":"sha512-lX+ka8CYZ/QMjF6jbK6G5eZMYT0pGIcmS7uBcLQyoAd2DE56fBK++r2cbW+gCLJhreVIeQFLU9Ha5SVjZ7SHAw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.f7561c79.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5JD+CRA9TVsSAnZWagAAEaYP/imALhgvwTKfFhI9yrcu\nwGl1h+2+yytI2b2uV6koYEdS3HLtQrcvcNIIL2jj/K9oWOHWAxvw+gQ6tIn1\ndjJBDDnlKfVkJ0IQXsXKW5O0vaGt4koe/VVE3AqnpB/u+kH/uWeCzU4fDjdP\ntN7LXOroBibArodN5+RCO30I+3ABlBhJ6+1UUqZ0OkYtgpTojePkR39oI2ny\nHwOwM/ttjqaVYVfc4gURQf8eAtrX9ArNhCdPfYWykIf3plvaT1GKRFh4lb3p\nftao2yc/TK7BJVExUJAE3TsVuSee6b0MpiJa7wBIqUOdSErxiC35VXcorau0\nusbnsJGmqmcFeIG/2i98H3rFO2mio9OMiKAXfWyUMRBQT9OHxprt8RlYQeqU\nUXYH8aBgj+DDKPqvFyeXHPtDcyNg8nrh67g60D8SfdxDFrau9hHdDmStBBac\nYMk3AMJgTKQYhIbUi5WxkHz9L4qyfyt91oW30CA+WFkz0chUtQXDbztuNIKg\nli2tg03gc6YuYAe8L2otKTZ5YkC/MMLMDVYc1rxEBKibv0/4Xs6jgWpKXLNJ\nzH5fMXkcHcVg0U1GpZvUDiauOWrMu+xIiwVVwXUxH/Lqlo6yXbhyI/wOyAAn\ndsIQKh0YxCAlUsg0L9jpFnOQPH4PQRAz59jGYCLgJJEfu2RAQB1rBWY25VZ+\nskgS\r\n=4HJH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHzmaM32BjGaEmIGm+S0EWiwFOm9WTd2FLqSNPFlh9DVAiB2vz3I9FcUBLJRkHPuPfT3obNK1KETE6aq1Urys2r6Dg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.f7561c79_1541705981200_0.6895079983796395"},"_hasShrinkwrap":false},"0.14.0-alpha.b621df0d":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.b621df0d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.b621df0d","dist":{"shasum":"f3260523fa66746292c5b1acc638831a0f0ceb75","integrity":"sha512-NYp+ALbrUUnOvWCLwklsQy6ujgogmKdu+tE9dYA1/D2ihSBMQHrC5N1vOVjnN3bBhzAPU8BqCISaDXuNllKG/Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.b621df0d.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5JNbCRA9TVsSAnZWagAAVZcP/0sNHF2+22B0fOjZUgYI\nYd8og9UAIpp9eQo7ukJwBUD79nasoQWQsR9NnUt00/W5Lql5pSUe82EbZ4em\nZaMz7+PW0ud3B/V0dRs7G5Z4gtfZUtfVf9rpY20NSilw9pzFoEDNAN/3F9Nj\n9vZCcleX/abzFOgRkzteY+2NV0kyrQ+uV/29dpxLYikuotkIrVnuz0D2ghiO\n5DVBJQjUb4CuvCCzGPJVwEK6l4V/h/a6xt8kuJRfnXgLtodUrEkGMWHpweCN\nMnF9Ug7ia2ktZ4ay5AbZrjRV0afbSau4F4qM+VQ1TNLexKbyKMmwudoDjYZP\nL79xHYJ8eIm4OinbLsjI3t++CzDKabQ+gzaLjLkUl4NnIzVwJVhFvSWHRuG3\nUydt7nZpL6d8RxiXIN3udClcX3+7LG1FAKrbHPjqjjeEwFaJ0HinACn5M/5Q\nwwRfIk9ivdX+jtqkT9J7HSr+DOPJMS2Kf9yF27IHPRL0WztFHjhP5o2oIoHy\nx3MH3HEvFMWh32v6gng45E4DXPS1aJuX2kx4w15slAsDVeoT14NPirQNDhy0\nVXFv6S+YxIgAdCLfLsl0KygDHNZvd2HccWYi1GFXSjn7ojCJLIyejLnBpLrK\nu+Sd21Xb8rjn8RTaJNsKKW9aSVj5oqGZm1r1NHrAiY2NGgSz8PmDuNJGO9qk\nUhAp\r\n=zBPv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICg+F+7Y4SCTD1qD8GoFH0jfAi4nGsAekYz+3Lt1tRfEAiEArqYeNvm8Kq275wVugXJ1HfowLTVCrmudo8fX7FqfiKM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.b621df0d_1541706586389_0.6616543902675536"},"_hasShrinkwrap":false},"0.14.0-alpha.d940567c":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.d940567c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.d940567c","dist":{"shasum":"1b850f22e240d71d183a5fdca0f1b5332987a667","integrity":"sha512-GuguKNG8ebUqG+CqiPy/zBzw7POcNaUDetfXJmCV7Ra/zkCASODk/vhGMbNZ9By3uBeg9fbdC5lMSctV3y9Iow==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.d940567c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5JT/CRA9TVsSAnZWagAAz3AP/0g02zl2j/4ACXviPlfM\nIzMmONeM1HW6U8VGV5cSASkHT++TH6He88o/74N9sKcMrbyf4WZ4ZEbS8fZM\np2LmIbzLXFiZIVnzxJnyVpixZvXDuUi/Am91Ku1ovi6vn0Wftsv5MFN8Qla7\nWqiS5NRVqYJQLXkbAO3MEkfrTsMQedI573j1Ae4dJ70Rn8PxyJUBomoyBP1V\nB6ZSOZkpv0dzjGubJdpPEWf30gwpHagFajSCyM7yVPrA05q+YmHyjrk247Pi\n6zK2X2WVlYelQpLECDpHdypCwAtzIJk+HzEPGB0QupZViIVH9Px3N4ex9lik\nfBLRJstmccR0+0hh+VllOoeG0UUky1O/1iyzqDNdWlhcS/0wucVrD53fbJYS\nupW8qcNJOmkWrsq+Ys8hbDx9IBYAlKxtasHiAhThYzbXtrwBantBqBPU3eW7\nPE5ae26bd6Xj6H4eql32wn8fTAgC9GWQE2gGO179NHLpO4XjAJn/g0dVcU/F\njiSIf/CiyiPMMbMAJRzTVlLFyEr4XIQVMLW0b9gujhAys2SCX0ltqkwZ/6fE\nM+K3lqV2RgqtLUSKxLskzjwhlhTQKoU6VVX5nFskq5koyuOuw77a5kp+Q/+Q\n8gXMSCTezs1gBsk1RacNgTDdsGdiR3yLyqDQJ3l3jp1G96a2rgVBU26rm9lX\n5TTI\r\n=nNFe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFduiVP3/vzo6CrabaqdzXxmXCwg7TjPNdhIvpptOXHLAiAY0aIXBDacOfe/avAQnhZa+IpqaX/iiyE8mXVtii30XQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.d940567c_1541707007209_0.8336801196062513"},"_hasShrinkwrap":false},"0.14.0-alpha.d4cb7a5e":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.d4cb7a5e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.d4cb7a5e","dist":{"shasum":"200d257c59953ea47b485ad02b35047cefe80189","integrity":"sha512-MmcK+Fmp8L/HayTR2ab3HTQYXOX1zHzOzQ/Qd1Y6brsKtMNA/c5sETXjmmyQWV7q7H6padWuUU3PhlGArwNRcQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.d4cb7a5e.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5J6pCRA9TVsSAnZWagAAiJwP/A7ei4sBtGJe6ZSmtANL\ntQ7W4HebUt/jqPgVAiZfEYdCsJ3Ru0qTlgMJKXXdBNMlRm7s7TWgVdlK98ua\nqhPdBl/g9xqOItmsGQ1gOV9yukUZw39wxDY+p6qTC8ZwfW2c7l2hz/Z05D2F\nW4nylDfcOf5ArgdEC9yv/o/KYRivsLboRFS4JPCNYk9V3gdtAKBZS79UYplw\nj2SteRRADPVGLwTC4LZdomL49x5r3KYC5M1pY6dkY04kAEm1h9IfG2DslCLi\ny7elgoq9zp7cqLkNPjK+RiMRmH/Y2hCDSl8QcOz/hachk3B7o1Cen7jX509B\nP2W3rtmXBXl7l4WmxfLVXhHL4ZftzLeWIj5C7S6N8g6P/CZW5/XK3fuFHxZQ\nOzv0opPs+wJ9HAnUEUGPjvPwIo6phiQPxEbtTFnN74lkWQ/gBSwofNGYaR8a\nYCoRCXANEwRisTwD8WU0x02ymDaIxNoARMduv9mSLl9GXUBCS85IyTIkQbtz\nwcZ9OowGVJvHNeTQrVhY+S94ShxZ0EfAf2JmVssHd0pXGFZZChEwly8+t5mn\nPdWt4mxooevAldWweM/zV8ZUIq6HXlfIC4pDUU9TMt1F//HuRcKVk660G0KI\nkGEHh85ryUHNrPj8p/FZrV6RbTyRUCM+hcyqp+V2kOkP9xQjgEC6xqPWOmA1\n7jD6\r\n=B5Rz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFdo742h0wyG3Rcyn/8Ci67ddOsUeklcALE/nR7BGbOGAiEA0Ed0uEJzzNZ28QYxTSVOlgp4iJKQcJulumJyIZ4DoKs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.d4cb7a5e_1541709480712_0.63178664309952"},"_hasShrinkwrap":false},"0.14.0-alpha.7b52c5bd":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.7b52c5bd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.7b52c5bd","dist":{"shasum":"03a72bb356404817dd7d93898a1a7c180bb52c4a","integrity":"sha512-vfB6U4Yag1j96ilDa+h6mLJbVGW+KwMcMwmxmME8oIXWzOM00jYICoQquL2L8Xq/OSaj+q2l877POZ+k8EpSzg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.7b52c5bd.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5KGuCRA9TVsSAnZWagAAi+MP+gPy1+06p6HbgXw15LIV\nYNt0BhhUMGasSO40+DNHA5M3N3O0SZQwCxrEjbeNLvQLzrcUHSENF68s9z2L\n4e+KWI5mPtvnDLZkqrGfYVUPLF+FNeBttaXoWjntBkBRjni4TyqWHgg4wwI6\nU0hjCI+JkUbfSMyUbztRuE+en6lgnjDyvFxnp3FvqOssTk4SYsyZWPzNkR0n\nDxLpru8W9R53X95APCkfW6eAjBniSBT+mqK2byYSxqFl4h22kCMbD51JWcZ4\neFWis3VKpejwxhm8ZfMqTaG61lTz93XPj7M41Maw8zJ4JoFDSho3AyJjBaYM\nth0LPQoY2eg7UdeahToCrMWjF2/hICMKJEUvcDBJDRZsIj42b7SkfR9dbhv4\nQJx+sFSZdSJ+ogaACNGftz2EOfeZed8wpUSfvWfbyfQQJ0SLEzSiM+XVNj5W\npzXiSk6DYVRzCK990G2wJEOHE2Ecm3e974SZzZXlXo0Ti9qvIPEQJVFB70fD\nObc4GqAAJRyaR7DsCjyCzYFdAY/wVGj+xwOx3CRDnOxEsn5/KlyNwLCOwQJf\nGpqcTv4aaBwbVFkqKzfH0prUc35SGpypifbhkuS8x1aDDlxW2FnA114U2LnC\nEW/jTdv3VDj/BAl0LO1duAmkvM+aqEQeytYZxC09DlX8i22KJe2obNWaykhZ\n4wEv\r\n=e+BX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHLwWe+KhyODQIn08oZnxy754+aBhCX+TXC1yTgNa0ZFAiAQasYjT0cqE9jlzCzpxKwGrNmfoucExfiYOz9kOx71Vg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.7b52c5bd_1541710253366_0.46134594518970573"},"_hasShrinkwrap":false},"0.14.0-alpha.e1d2272f":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.e1d2272f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.e1d2272f","dist":{"shasum":"3ed7122a22cc70e8e21ba35fcc64483c90fc4fee","integrity":"sha512-KrlCNCfuM7Osi/xwTx+RRunVm4oQZT3uxAt1Vcrl0+CgFbLEwwy/etAFYg95sxztKT0eTuuXv2ieMPX1LjrJCA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.e1d2272f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5KMyCRA9TVsSAnZWagAA7ZAP/0zAi/2bfxX6ekO1Idcs\ndMOUQReL9FZYAOSnyOERLuMqsujIpa4lxgQmwCmzj+yzAGODQ9Y8sz1RWkBS\ni7bHQ607E+F0t48yqa72IsUQMFeYf4HRCZkTLiQe0i/RReUuD3f16LKVTYdV\nHCqetDSAnRsCk4ur4DpfJk2L46p2niEdgSEaEHVCjAUB/frfmhtNjCGGcEy2\npXWI378KJaCpz0mlHI1ic+ep1CVS23ym1uUzQ6KZsiT6t5OqrxnxAYKDV3al\nUtgsPp1ld4kUd/SD6P2AvwmQFtFwdEzD6yiDxULl4FUfvMK9/BQ1dEU6vVCk\nsJh4syVlJLcfV5y6xkapcrCU+UVQAzd+kJL+grQMUP1GAtaMrw23a69ytrRL\nKfIziJiPljPabhvnDE3JtWFaCiLYdnP8ohyQlRy88RnDcI4V97kNIZfIbrTz\nt7uKy3XfLRWir9XdSkbsqaQ1Yb2d43tcCLLm+FW96+NTzYy47D8JmQ8ruBwh\nKhI9Ne0aIuvRugAE8t2yY04I4TPucaJHWBpErhIyRRTVKuowS/Dohi9/+AH7\nLrE4PFoHWlwD/br/obNdERfYOdi3S/oUsGsfiYNaIFTG3d8UT6zAoBXf5kL9\ncTM402ALdablSdYsq5HaUkB2sVvG1UNG9heq1NqiZyXeW1tMc62LHd3so/yX\nwKjg\r\n=93Cv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBlbZb5YviAIIhEdhQCHSoxHOu76elOMhgYFOMTAIxdfAiEArJ9FUH08KwOqhHarQNhj9C2huONIRynx+m2oID3aQlc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.e1d2272f_1541710641785_0.2868117006254107"},"_hasShrinkwrap":false},"0.14.0-alpha.10b46622":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.10b46622","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.10b46622","dist":{"shasum":"1ad8c3fc1dde67cb7068e54dce66dab9dcdb49c7","integrity":"sha512-xGDUm6/FqoAa0eeB72clZwg3FRyoqlegQpdC+YoY9/pCbnY/2pT+7pXnUHo1VL3rvvnOrS1FhR9aunJ7TnFDBg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.10b46622.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5b55CRA9TVsSAnZWagAAghEQAIWiNJDDPV5+byHJdXEl\nwb4DSPJkUyRAA1iK3yon8MeEGO8OMjZU0/OUbJJhDxT+ffZ0QTrMq78SEqno\nUUFIZa0sgM4STKgUbA/Uprx2kXg7TyvaozjwPPSdW9Ks6Cfi6MRYIr8x84pA\nQIOhlDxvZtpzVjJPIYps/Ia5xywrPOFt2vVEJhEFhRVIsPXWjO05w9/JuEw1\nPPk9unQuNCZ3Tu0sQlArvK2cpSBkHw0D4ANKxGBSljpHY67qXUT4/CjCXVmu\nqOPJXLPwy8oaV+nyCytp4JFD/Ykq+WOEYeO2Ufirwf1QMf6iaSZ7XVrUEY7Q\noKWz9GQPKbuxQxc8WNMpIGFAetVwe1aDiccCKcjCc5SaXq6siBAaIFeVgcuM\n9/mIZ8JRif1q5zKoYbcDgPghnx7PYRK5l9IkpuNIpcKRbF0/bLOcfGuznZ8R\ncqO5gRk7sQzx5TxpSTFvwSQlRR30FiLM6bMzh2qk7dUeDWI3LGLWRnryeuSh\nBTTGrezSUHGvbUhAN+wJWMZeAOifg9FKPxhf0XmqAzCRnxPtJ71+nXJGsH3U\nvPK/Icb25wnRhGzDHrkDogA3JSpc8M5jyoGaq8OX0SwR37qwYpw4+PPALFWB\nceO6O1DAApAsYjNemG9JkbGd09EYCquJ8/PXb4/I2sTKblH5uXKlTQT8kkuo\n0ZSG\r\n=eh0x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEuId1hxP/OnT7URV90NYPHxDZPoJDDomubkyweWcmCYAiA4s+T6MYEuG3XB9PnkVGcLnBtpMgWkkSooaTjhzxsJIw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.10b46622_1541783161034_0.4898063950385567"},"_hasShrinkwrap":false},"0.14.0-alpha.b36b8079":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.b36b8079","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.b36b8079","dist":{"shasum":"f1543e689cde28215fa79d56eb9e5ba2f7227883","integrity":"sha512-lPrzry8Ew5uigxiP3/MMwJtXMR8o/793vId1UMc4A6ULu+8NOoq7cWFCyjdA3IE3EwrqeCN9+eP52bPyFlYlZA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.b36b8079.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5g1yCRA9TVsSAnZWagAAM1kQAKUT00o4flcgYl5yzqZT\n/H1XapQl1g0OObnEgCNkKkX58PLyZv4FcqUCGnyKYs5rtpD9gunKRQeN0uAN\ngJHlj/wvNOKMLVPFWLNq0Ztv0Gc67M3pwBoGr2uG6GuWHfdAFOIxVoBss7KH\nlcy1kwh+Pgmn8TtANac57Gnkm7/i4R+bdMJGY4KX/J0gs6IUKnkEXvjr3/ii\nKNNzyK+jv+vIoK/UdIXAY4Gla1mWP42DPRUUeFB67bfsp4jF6yfsH8iF5jK6\nzo2vHORzSl/SV3pneU9aIEhNApO8vQGHgfi3qqKfI6o8H0AzuuhUhGgeD5ih\nQNwaO6e5KEzkU5S02EzkXVrnq2frd9ixqljetZKICiXyyb4mcpRalHRjTb3I\ng19tj9EwpwDCYGlW2r5fieovrsv1M2+FptU0p+6+DfuF6BJjLo8fLqZmk6eC\nNwIgPwRCtxsnwgAMkh2E/aWC6qdL6RGL/u7Y9ccct88+6vLSSJd0BRL0yioS\nVL+LTJ06+mpuc3dSyc0TQMmZ8lyvOSjQWvmccVo/dwrcGTmhrjUmFA9Vxkha\nEORQVXH2jdPDuZEpFwE/Gpdac9YI3pSoK6q8hIojg/v56G5QRoZ3yFsnKQop\npLpa2p+/7MkTT0GSkfTQB8Gpo2Csis3T+CBVVe27eLd+ysiA40Pu91MpCP1i\nCdA4\r\n=uoHo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIARqvKk0Tgx/zypN4/YTqOwEbwSq5yloKYZS/Fgg8IP8AiAYPsaWmhQng1VQGUfbUgUCxVVAg/c2KvG1nLfjFPEEkw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.b36b8079_1541803377100_0.9311515089336384"},"_hasShrinkwrap":false},"0.14.0-alpha.61fad1d1":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.61fad1d1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.61fad1d1","dist":{"shasum":"19c6cc4e80cc6566917eae91b2dff2d956fe1e46","integrity":"sha512-rzTn4GzM3xGQcHfXZVKjM1E7STBPRsBxpnbX9ou/EAt0/XK6yZjWycjOdn/ZZKtToZba/bTQJMukE3VkaFc8LA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.61fad1d1.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5jjRCRA9TVsSAnZWagAA+34P/2uqb5EnxIIq8MqSb2s+\nx9najm4wvysyJ4LI1LiqYmxBc4ap0BhzT55d6UoFuk/76b49Vk4f5j4PRg+y\nb+AnbQMOHF2ATIMs8mUcANk5zx2l964qrvALo14mgCOEQFU34j1EnRylMaXa\nj8qfN4O1aNg5XOg8Xa+o3gUSuOcFaLxG9jq2V3rkRoNtj4Jc8nFWYUDFjVUj\nzgzwt37Vf4dlUr0eceJ16DqyyK0OVzxwRKYeOr3CWGKThupUt46b1hqNRdyE\nZZ5fswFxHX7eJ+nIPf7uKu6Mv/VN9jK3SpIQPu7Jdb0mwA03BVNDO5kC/4yp\nZyh7MX147Sd6n4idO1F4IWHAGWa2G1E8O2N8GP//VKWmqdHMX+IF74w6N8yQ\nJMIH5tldjOU1mOw7ISnrQ8Lcg7EDB3TB6AXiMjnTn09ZJIE/NQGtZFPrURxg\nAzOSScWMzYRrfYzNRO+YoZHyxO3Hb/SJuj0auZ3q0LFBlMCDlZmnNQJwhVT3\n4I5pd5rxPYqPIp9oqFOeivjHvDarKJELzKMEkk8KrDwBGxczMduRGM4/xwSa\no/94AQF+REp66b3p7Gls0NNpkcciuqIGPeZ+mZHbEvAUH+O5LJRld5bP9clQ\n8gHRxqD0jCJsbgFLz8TDJvzJ+X6+2QWB/pGpqMb2wz6FJ5iRR6HjtiXT8UGf\n+8fg\r\n=9LFq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHUQfFu3yv7CbDrN5Vq1shJaSKG5CXMXmmDwJQwR4W8pAiEAgUJbviL1zGKFc4sClhk9rGwdMXFdFDxFGUlV8gCXC88="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.61fad1d1_1541814480206_0.49411743309655054"},"_hasShrinkwrap":false},"0.14.0-alpha.4e941c37":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.4e941c37","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.4e941c37","dist":{"shasum":"77e081a9dacc95326511731f700562b0443be599","integrity":"sha512-EcL08D+K9pD+LysrsdhaJU1uheMcl6ZsPc9cBsT2ADXMf+dKG+jpw7DKm1jW//SZgZFRyt5ZDPTsUVdGQ/8vVg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.4e941c37.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5jkdCRA9TVsSAnZWagAAOcUP/0Oh0bXEY5rVZQc9Bsil\np7HQHjnCG1ylI0uavHRTr+aqbcIA4EzHuIJ82TM/c5xwy7eFZoCw0l9sApQ2\n0uMUM1cSSTDdH/UiHoMPzQOvnKuDC3uhvBI7SkdjxOx8QKt3YUk4SApWgkBY\nvtuZcyC60DWZQrha+9erjYOKF8E3XHzDNYYg3GJWk+/nnCc6S+Ng8uGdv99X\nr0xry79HgK/vthwO92wEuvmUfF4TlMeQnTXJVNV7GlqBWQ2c6AcIr/il2UX8\nasGuZQB93xPAQWuQBh0FlbdMx/MhrhkDdAe2Sw8TgeyvwVKbH/+jejit6Ebq\nEtZEuwwKyGeXPF+P3ztTxYp1DZf9Ur736S8JUdiu/VAXGxmTicPIAu0e7VL4\n7EMnmM6JDnK+MV6y3jwr6hO2QZDYSMV3zoEOhHXAQW5ZOfBDt6eRvDrUG2c0\nf897TRxJIohJNqJDTFaXHHzPIU/cuNij3MjmvXTE8faYRfNWsHxzIrJtpnwo\nn83XqmTAiv7mLFNX0dKrlwnkmImXa3UTF/bBmpEA4D4KQV/Y1i6LWVfjUbEF\npxwg5W8kIzCp/nkAmKMV0KaHZtzPSbnCnla7elVLEPI3Ro3fQns9omk3q1Kq\nYsNOEKREAficxeNRzDFiyi/npmrWreFVEIDbLx4COzXkrV/cIx/YD42rSZCX\nUebO\r\n=eeX4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDgbxpGBFBVsjC+a0f91hpgBC0K11mPujCpme25RiABUAiEAvWieqQOpUoVSyuQuCLpiDviI2WTLdFSVuv7+eo6SMiU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.4e941c37_1541814556868_0.5216922165707416"},"_hasShrinkwrap":false},"0.14.0-alpha.cdbaa3ca":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.cdbaa3ca","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.cdbaa3ca","dist":{"shasum":"b57ba5fa24c2a73b8b7a50e84ce1f6f9ecfdd639","integrity":"sha512-t41r4t2PnuQDZgBNkRpl0gYvBQogZSuxAYlYSDd5Cv3erNiSoXhUQHyhg09zPT7q10VikvdGXT/1v3OIHunqyg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.cdbaa3ca.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5mCtCRA9TVsSAnZWagAAFYsP/jjOKUuWwsdzX5nv/S6D\nRs2iuCHrJCerQ7soYq38AgtCuxWumZoTTUP0djEflPNPvqZSQGuTaCq00vig\neajzW1P0anl4SvmQBUbIiOdfE9HVm+E3mtJvbIdd60rJdifQDKqS+CRDZfaH\n/0F8HAnrXG+KYrU2ZqNcDUT8VsPpvc901j49uPRbOOfmMDsZTTfwKBdvPFoh\n6IqIGFO9+Fue1hP6OT88fOowRamvDy/C5298QJOwqhu7Uv4bt8h3wUpf/dB2\n3RCi84ZyNzqx3q91KRP95lldMRQN5vJSn+FBhdY/YjszHp+Hg49B6+urxq3/\nTpW6tKXuoa68uh5hnhNnQTn6deXmv9r9WIyF7eRxrTM9nrMkJDgDR4w3qu/e\n/NcRecSZDAOOHTn1mV1E0U7JlpZ3u8J/ryiUYTHU/OjbEOlmBqYDwCX6s9zD\nr9Hl3Cytl2Re++d8c5hrAYfYyzvFMhOA8Pqt8M30wuAFfZDiUXffBMkPXn1/\nNDbimUBzhUF7/9IwdKGxKR7nOE+wkon9BFoPgIjMeLZK4/VwoutlcFnQLEiD\nL5hHJc+sNMHQXgZB2nZ4+QojhDlQsHG4yRsOmGT33r/0h4lo0OfUjZx1r/0K\n3RZwXOfbIa5iA5JKPB3OcBaTWXdSGc/ikylkRIb+BTT05gYfzUDL9vUBIofA\nFTzP\r\n=RtPW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5o8QmfYvct7bNhhiktpJ44/gXROFrGYOWQd/CgmY7fgIhAKuWT378sds9BlfE25fKX2+HIvSvY8flYVZtP2v40x1P"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.cdbaa3ca_1541824684387_0.18234668477272953"},"_hasShrinkwrap":false},"0.14.0-alpha.23ea5a67":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.23ea5a67","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.23ea5a67","dist":{"shasum":"bfc655878a43c8775f43eccfcb640e6e068db249","integrity":"sha512-ogw45osJbUz1Ic75k20JCmeLAdd/KNaO42D9inDz50cu1pHH4+35EnQ3LINBgEWl0AUjYmTsXlQ0htsqPwodvw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.23ea5a67.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5xmmCRA9TVsSAnZWagAAH88P/jHClW50Biw8+0aqKnKL\nwFVNIw9gJoRdKM/JT7GRNhteXXpyhY/Y7jVfo7nwuM2TEXNdbgf16/CYp3yk\ngVbg6sbenP9xhO1FM8JI9tSIp+s8Axqz9W1GUvyzgfij+O50aOA4M1Vc3Gs7\nY2YWK5JHYwHOPtAl55g/P/NFNOoaS/GC0AHnHzvvOjfpIKaq+eDGLme/yDQG\nB1mfbsplZDs8uGXPAFtheOw19/ZjT6Gukzlp22GUP5SljqQdGevjsQe6umH4\nh6nZxAjQh6evEeHmrDgYbuJCopWHMp5aYskenHhtn53qvq0LNSbw9mTHNN9j\nVc9DIJxyYMQY3kJkdiBZatUG7sShYac29D5tiuBNYO7JYvHnmxZ0L3en4ZBT\nz3dSadOrf8r0WlJmAXCCgE9KyXGEI/Atc/V0DSHPjNIatd4mlRxrRzjg/MNp\nUpI+tdpkgJUgM9gKCz/XKGnCNBYNoYyY+c02EQm8HK+qTOkY+0tTjzpv/7CW\nGiumgcvdmxGkYOtt9dsZCvMI+eNFabWNBcrOaV2faA4Q8R1btuE4TBspI1Ux\ntsnZRK1HaoBvQ7CkKvN+wL+cZUvD9Usa9b8LUaVJmNpvex+nDwVl48/8jCnz\nFX8gqUc4ESXbj//b7RceFGOsr1tSPCYToQY5TsdBWgoLRiM2v0w/56mpGAHF\nIz50\r\n=Jqfj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFmgUdPuAVq7QUcRUZPKmSt+2JtbTbamm4JkmZM0YHuvAiEA3v2XIrp+eKWXmHPYZ9R4E/7Z0aPHhdzW+qg2MWBO3XM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.23ea5a67_1541872037324_0.7373630534332485"},"_hasShrinkwrap":false},"0.14.0-alpha.b838ee10":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.b838ee10","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.b838ee10","dist":{"shasum":"22c319344f4575338aea2dd66e34ad3257685725","integrity":"sha512-xf86wHfuc8yPTYyZraP/qTGabWwDX5aZ0/DbfZP2cNzT+WYuCgqDu7zFA3Iu+JqFRzlaILsQa1AU8oN61IgPuw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.b838ee10.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5x1iCRA9TVsSAnZWagAAs1MQAJa3kucEkFwXUYFbzwAW\nRz9hsBiHSlHfgDj5IR7KOYW3xF/X1v8gFfgNrGNfUcI1IoHGUAXUYDTgfGCj\n9WkGb0qhoFj+DnYrXgq6FefcM+2Y1hB6jplUUYtBrTdjNDqMKWpSRdKXNTnD\n+gZpmQzcw9IA6ZicOs9wRg00E/+rD1yQe6PtZTLJEWNDf3phLQvXhmIzoBIn\nkEJLy0FweW18temv95GLCYQIf0M6suIq3Wa1/119NRwzxFc2NY57hPuRJjjm\n0kqgczisimrr/iWmyc+hnvbaQKIrXHI0Ou+X3kmUI+SMmdsLCoFhXTOdiG+W\nfTKRZHPTP/B5FKANI6K7ODmgaWh/UCy/riWAjSd6sNeC9Qu9BpcMkYlHkJam\nabaFriluU9+/4DpKgfNx2MA5zvXDYU5033VTak4niNfOtX8jIdPnNmYWDH2t\nK1l0NZTK6Utz+vVBpR3v+bF/guKIJSmx5q9AQYg1PHO1W47rdyMxDYAWbIOY\nvaX7fFQdkgPMdvQgdTJBz7KMV+DrE9NIEx0pIxiScFP24Rw4R15UhOHKwozb\nnYm7ySRDy9LSKd8pC9UHcdwE8rtyGci05EjECFaEF9W2TG6uk/dpSibkaPI6\n2tOjm+vk9GStxqRLl69I+291yGP8Tgee/qrUuOkcnXMwvFhywe9uUnrm4vRP\nYZ6T\r\n=5Kqt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdDwFtLBLICES+DRaR92v0j5piUwD+Sq7zWS8ldkWACgIgWps9soc74/nZIwU5b3j3mD1vQmEJZ7AuVdfd93gIdUw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.b838ee10_1541872993410_0.7876727250323494"},"_hasShrinkwrap":false},"0.14.0-alpha.ba87906d":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.ba87906d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.ba87906d","dist":{"shasum":"ff0aa27607b91163f18c7a42738ebbf2d407c924","integrity":"sha512-XsvrrH97mTZy6P1mZh1vkxK1SsSA4v247VkzaK4lFwYSiTmWMoelyC+OWpYom/VgP3K/e6+27gOgfwo3kZJLNQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.ba87906d.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb53sqCRA9TVsSAnZWagAAzDUQAIyd/bod7nutdpikRdJB\n4nbeqAAywWwrKFx/DrWNa2nT8xWfVEXZ8PylKIzAuYUuVc+MsMkAMh822jtk\ns5Im47L7mSWyHHzAYxwt8n3n8yysRTRS9rbao25diOij0QVXSml5EoNKlSV8\nCu+b5PSuf255GOCJlxMgZx1yVOhe7ZqhAPZzVtNuQ2T64dfMX2XUdAiSeQg4\nEyIG8UvyBIBvk9EBBVY+TDn0kbvJScoMAs5Q+AByeBWrxyWfva6keCzr3cMF\npCcr+Hv0M0K/M257g6YCGNY+BY9/yfOMbMrTl01DXV1IJRihRejavGy/76Na\nHKTPp+jatnk0MW28/EEjIZ9rPvRnRZzK5I9NFfGHOOLSIYY35LakNZTE+F9D\nOyq91ZRFA4Xo/xGFuaUPY8y1hKqDbEH7PscMcR5B1CkwGHpx2kxNvCcrrzt8\n9yGiTFuW0JHHkfBwOdOnA9EmOCs+vpWLbSm8jJctr1X1g8WU3YsmT51QhgIy\nps9RZ+wP/j46vrk12gpn6tM3nv10yGQrV20QRasVzNK50UlSlB6B/hXKKynh\nJWv+6U2ybOLNYuQ2iiRjSlve8sEibO5OT5l2OcOGhkcMwMtPtsG4Vi+osPHE\n8j9LhUj8fZAgI+RbE0VvpC2U0J92tGXyUZGYtM32AS9aphO3kOumCNNGu4+F\nNjR5\r\n=Tyg8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEfZXPshuxnC35iaKbYsxeYEzbv3z46ZzdXdVz5CKcfwIgUsa1tAlu9vzlIkYGxXwz2y+EsqnvabVyC7kLYCx2beI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.ba87906d_1541897000997_0.8376998254035186"},"_hasShrinkwrap":false},"0.14.0-alpha.3e8b9116":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.3e8b9116","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.3e8b9116","dist":{"shasum":"2bf6d05342c98ce79c388bd18f975de15b5f75a7","integrity":"sha512-FHaQaIS7rJaxV40lnIBWwi+/zwQuhpJlQZSGpAgMrSoRxzyYLqBvabM2WSzUPCbc23TO6aMgHsVkOCvCMqDGEw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.3e8b9116.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb54srCRA9TVsSAnZWagAA+BYP/1KqVoZ4Hbazqlgdj9yk\napMU10UlGRvSst1r+KU0QS+lNeugFjN9VVu0SV6CiLKoyQDnRAr4iWuIyGik\n9P9QBkJWqxSCe16d4eBtK5LwedV8OENAdYvdwFcKqaw8M0gc0y0nhk1/Xlui\nyPaO7uxE3UgICMGY1ZDnFhvlnH7uZ0scY1eDuw1LiAxA1D3Os39eMAC+CdAy\n/a/4pKcKpn7sQc3F8ExKxN5rybmEdvdV6K5hJhh4aC3N5OnZrX2wbV8bzdyE\nWcQCOXF+kO0qZHEGnfMwqI49PBSA+MIcO1wMNzoHFdi1/v/paEdaeP9EZCNc\n1PnOBjXD3aKc298fx/OtK55UqMHzTEf7oO8w/+b57aYooVtT33Z47U3jJ31Z\nczZqz4JRxlponQ9+ELyFD4a2qVVFiviNxXCZqeWicMTaW6eQPMway20/bUVi\nath05KBpV8OCnKkY25Rq6s87n1IuafVtPD08t5xijLNj8r17DqWXS5jMMUmc\nvWoOv24urwQVed8PWYACmsXJ0zblXs5pEok6hqYzDpf4Ay/tjkqIbLxGyZLw\nYb3IvJgtAgt2OYrDV9HLDaIRu5D0p74PV39Z+4Mq1JvEPypvnffxLkF3loo/\nMrEuFIS+m6BF0p0reCD2rU42TcKWYG/2dfA4FW0ld2vt1QASXkhWT1rLS1gD\ncuzZ\r\n=1qPy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWm3DMwXWD6LTdGaejx8HiK7edbvqqg8MR+ZZZY24HEgIgfhQACjljnd0L7l5f8mBvKjJyIsP725JSoEvaVcfPiAw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.3e8b9116_1541901098231_0.9731860647649142"},"_hasShrinkwrap":false},"0.14.0-alpha.d1abca73":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.d1abca73","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.d1abca73","dist":{"shasum":"aee455be296a86dc88f115a542b6173ddead6e7c","integrity":"sha512-PrLo7t1c0MCSXiCIYfLT7ldFH0fNbfTi+ru593SjnXvaDimr+k0ZPdDXcxnoV9jhMxWdfxGjrNVKTAQlFwLvGQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.d1abca73.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb54tkCRA9TVsSAnZWagAAxUMP/R/ogsyg93r6ulDHiAhj\n/EAHUvaliWMlKexoDegcvD2M0nK+EbhKDkH0f7T9HKLUEe4PoCiv+Q5ADGF3\nCywXKhWPjPCrhzHs3gRUl949zXSaItCsSNoajn46uC5fTbuGeTD96xlu59TY\nws8V8rDki4HUUA9lVNTDXNhOS0kzDTBdsG0seSXNSHSgXpd6I0cYyF2BMSnr\nSjGhsb1+H5m8sRarRz/HQC2CneBdJOgXdLzPnOMzUkzfuGlEPZXUCTuAjgRX\nNhLiP1LXcHtcloxT5ZibcWABy4bJlHX2MhbT1FeIt3/HkWuoRJExKaUuC2lu\nU41IxGnpskhgfPIRfi4TrXfDPUpECNeju5lIiK/T58FcYM19cXQV7v3ga3Ej\nnwbF0disM2n2SO9aJsMx6gWllWTftMQJK9KLB7XnEXSv+pZ3m2Wi5lDczlYt\n4M4KO+jpbyWQLWSvG0IVHOZ/mYiGNeM67R8AVDG9ouZsQPrtvK2XPmuCGTdl\nl+6QgEJlaxA1Q2fwLJ5FXRPgDvl5xUb7LDw36Ivcol/C7/lB3oNI4gxmrNj4\n3A0GLHJkxHb9ekoBnNYVeM+Qzsq4S0a8Mnd6PKISxfNrTvEYi4kLN3Jsg6Zl\nVl4ZwFHurHLh8qDJ3x2I5f1mj25ZBvOn+8zuD830XrCZmc6BS4AcLcAP+jz0\nLrct\r\n=G3iy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrOb0C4xA5aEevs6BbnGD1OPVKXu69md4X8dyQfXuIhwIgLZQ9s5E+hRxR+e+F3jSgXddtWh6Vxh3OqDqMwSJVvqc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.d1abca73_1541901155329_0.08831222455381793"},"_hasShrinkwrap":false},"0.14.0-alpha.0cd5095f":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.0cd5095f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.0cd5095f","dist":{"shasum":"0726c6a837d1f99faf6a2dc548ceba55eb0b5cf8","integrity":"sha512-Dx04xN/X22SiIvvJoEvQXbONOWwLw1+OAlU0wzdWtZM9LFEA13ZZqU+G1FUoChTVJQN0AgOQYvwlXqah2bL3sw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.0cd5095f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5+pGCRA9TVsSAnZWagAAlCgP/3il0pugyCTa7G4RYLOJ\nZ7gN3Ng6H2y6z38jmsev8wSoQ3YPyXVbcz7GQwGSk9q1At1ZH9b9hFqwqiof\ngOx0g0dodu6gD9l1XJB/18nYBSJTTzgc54RIvDeBLvR0IsmuoiwQnz4ShCB2\nwoOdgJvtyxV5weSHUchbEtwB8KO6ThRLSbV3o0CqAPsrjdE9dEoVT/rxjGg3\neYNOWem/teHVHfvjXXMSc1iMyZHYVD6o10zpeMqt+DnV9/G/eZpQj5MSzVx1\ncbS26N+UNBW87WnOhvVBkJ+b6EEG6GLyUdNH3pY1o5JuHTaIKQ+FUK3Qfuzp\nilOKg2YWYTTewLeLqVzkdaDNprUG3Gd1lqMvpuukUbRQV6YiWZ0U/jTzPvTv\nS6u+wo6DqYwAOTrptYgcIeLAjOktufRO7XBWrLYDa7K6QgB5wcFwBTHVcNTN\n0RjRqZivwa5/4RcGME6FFmAU7YjUAcpW4IW7V6Kjc1H2NhC6OjpYLAeeWUW9\nkOTQgDUCztA6N+oyKIQZNsqqAUQPtWxgAeVpGOaKP/VheJPE0VtcHdIyciNq\n7x9Eqmg32/mIi1aSQFmgbDYTjd/JQD6zgn9eraKqB0K4GaGyidGEIu3DwNaG\nzAIwB2noTnSzBgE49/gz74W+XE2z3aEVxppGgwnn5YqOKdv5P3wwUOyOzoRk\nfV8E\r\n=hwJ8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPpuXoQ2V9CyAB4Gmsqg9NKQ66kxwDqEVZ+HyXNwNN1gIgN6mXEcpxBISYkbMhGihbCj4mh5MEfETIMYHmLoxLtFA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.0cd5095f_1541925446146_0.607647815405445"},"_hasShrinkwrap":false},"0.14.0-alpha.9703fc49":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.9703fc49","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.9703fc49","dist":{"shasum":"b508dc34091c358e7f85f5f02b4c487c294cf406","integrity":"sha512-8NsWkVYz29E8Jazzd06vYUt0mN8Xww6wgRceg8DR0LPuqV/xI9rEE+PjccrxFdTi/skvPxZQ9lAP30Sr+czMOQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.9703fc49.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6CUHCRA9TVsSAnZWagAAwMMP/0exdvM3Z83RVd/E1GM6\n8nwIkHB3NfcbhcvSFec2oFi/yNb4aatJRdUqDbvy0j9ztkDKcoVEOn6Gg3Zf\ncSZc722N+lbo2cLKMjF0ECmj4zCQd73ovdOpy4fJdsMys61PNj+YgOOHzAIp\n38+IfqgktxHC5fHe9AHIftmPDiIAUK0+xubuUDic7YQMW7Ooj7BUvbEzqPwO\nPEnc5dicHp/KqH+E6MGsRnb5bpVnwBssgo9d/1aQ/RqujrSaVjoqDPR/N1I2\nhm+Gp4Ic+TRXt9676chTZKYNG/r6g5zLdChPR7zJ1JrlXErmBQh+88YdKD7M\n+Ps24U83tcC8uSOMDc9gmVi9w60v9iC6gWf3o7MlNRo1KiuJfJwnmczIQ71p\npKH7Q36Pgl5JsOMG9JmUIEZnLdRVlwjbqKJAiH7KUBPZSE5STbP1/OOhd9fF\nNujJAHcw88qT3HvJqKMSVp459bQGjeRn9+B0JwBzA3PNb7TXnMFX5yABAt1A\n5w+JExN5dwPFqO2QY81u2FpFZsddJuOI2c0Ak+j1zNNpx7KC3LDnZkHuc2Xt\nMw3bzenZOLUPILxhnJ2JIhdlaMy+x6U+vErmh5oUyQVrarTZVMrLwmuUmHMw\n5GoETwBRielip4UoQpUfs4fnu032cekLZ4wU8NbkufwCfspCj77Bi6zmUYx0\ncmRG\r\n=xIVL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHXdZbRHrjbQLg97gglQYQmOUV/oeu6JiOgeb6kDWSJMAiATyh8rYvcTpkxpXt8sH7CRDLKONMhw97vhEW65Id1y+Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.9703fc49_1541940486372_0.3683857089524676"},"_hasShrinkwrap":false},"0.14.0-alpha.fad16cda":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.fad16cda","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.fad16cda","dist":{"shasum":"a526fbfead8e48599eba059ac1969cf8aa9d5865","integrity":"sha512-a0sRjb/msVediFvyt2WjoAAyGk41/DNq1hGOyyS1mLehEOaFCQvYZYNShMwhcaOih0L64IC3s9Z58ggoD8iycA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.fad16cda.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6CWXCRA9TVsSAnZWagAAOxwP/iYywHFO732W4ktW03iF\n5UjcZmZjzPz2HnNkAnuUfKQDiqNWmGRXPU+hWKnZcfhCRyRYyorrfZ51atz8\nymxAq6jx9Y/F6VNNAUwVbMw4MGNPliYCa6TzJN9AhCVUbRveneRnGxaxoFIG\nT+XK1PDwHLgfdPUtgzJnjwerXRPTaqFc5wDmL93HEWRb0qx3v37h42o9iPBc\n9ZnNrgzGOpbKRs4k8CfRg8w10axeIwAOgO1/wcCeZruPzyJLscvxts8KD9Rd\nwxxhuzlGeEVNEzJct8szeCnzRR2owpuPltYyNNJSmYVjBaKr54O/5r5pwOAe\nCpCqqxVLOfvyLhjFuZYirVlrpZprV2GHqQlhR3WObgvIaV/qaqDE4NaV/Kpk\nJw/s8xHOZV7nvGSelDSwP+X05abrkBTV16QfMqKEnP2a9B+8S9Ye14Vszllb\nvAO2iQUpgGDN6RrEyHJqWVxxRAb7miRuQPFmJ/JNnR+QLj9NDYrphwG9Uff9\nl7detYQoFqKEPmnwmhd6RCSZulpCutrS+lHqmaK3UDLCGWf75DJUewZtiOUJ\n/2XrrDpWvKt3FB6Fd6TdYqUO3WWCz+R5hTRkEWQ7oltCcqjynegYErcVYLGt\n+bnCCsNjeOzLyo2AofLY0YWmF1zCN0hwa/nnPv67HFkIYouG0ggn+dGKuJ5n\nqC15\r\n=0yvE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCi1S+mFKtXvLeM6NflpRiQRZMT+LzBprk75WA7Ge5OpgIhAL8xDbgaIomH76NdOy8zU6FEmUmAqN/D3QkVJ2Zjkuxk"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.fad16cda_1541940630440_0.9712110511751406"},"_hasShrinkwrap":false},"0.14.0-alpha.a14782b5":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.a14782b5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.a14782b5","dist":{"shasum":"f8725ad3f44e8f2206e133344dcbab04b9190dcb","integrity":"sha512-rSaBUZlrNgOUaJAqhXwKMhp8Y/BqG1XjETt+9jJcuniu5uDyOOqB8I7Gb8eEagPgebXi99iNqmVJDhInkbpGgA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.a14782b5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6OgpCRA9TVsSAnZWagAACh4P/2tZZiH1W+s9BvOuKUYx\nnubLRVpH0j7PB2yJO9k7d4ZI4oxg5W/kVycHcLW7TUfL5dZKfrWifKL39Fgo\n1B8bWGD2a8oT0lRyc1uDZodevrEZUJoMtqXZsRe7uHn1Qyn2Woajs43jBrQe\n2DnGZNMzymAvj/OMtew5uGA9Yuzve9EplCe0c4tkSNczjuu1oyk0wALc7bPL\nW/y9QrzXm7l1o8sJXkzY9+I++Hr3WpgqkhocMublfmOYi93sU4SDxkVCs1Fs\nrSdTzcACQMgodPmYnzQKTnTq1AsQpdQ4HcCI8LKnBM5s9GIxyxrBz+oIYZ6e\nphPjUJM98lORv8Atzr4ODA3F9S7WmoynVQMEpWCzHE64oc3V2doFpKRCUKgq\nLF13sUGGaYnTXufB+C6C9IyiKu3Nya3wjWoKF70rn1PvdimfN7Xisi/Vcwnx\n5oYmA2YSffAXYCyUeoAqM78s8OcyiX6sypxwE3A2Rlb7Azg8jFir+c6sMteg\n0IXES01g0Z26b06jJ3X7ifRTCe6jQLX7PX9RQwhSkodzeoM+2UzqchmzeMo0\nOAxhcw3UsyluHN6QSu0OcAhrSXfcJ47i0mf0f6mh8aoxGp31upwRVD8w+oOl\nYASxRCm681fi4IsCigo73fW+aKgG03sDFAX6nF6jmjkUOly0bQCIXJixUZIh\nKzoF\r\n=16tT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZB7Z+G/q1CxXwSECKrg7Ig+Q6GKZaH0riKmWQj3/gxgIgSvVeEnzZetVZ5X7EK9KLCmQM1YfLKWAqO5avW8Wnins="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.a14782b5_1541990440371_0.7512668944357992"},"_hasShrinkwrap":false},"0.14.0-alpha.5d1122db":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.5d1122db","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.5d1122db","dist":{"shasum":"e5139cf1ab4d6271833f2cf5de4ed0da0cae3644","integrity":"sha512-gNQdPsUY8iSBFQBffbgLeBlu91qIG9vANVURtPxKD2SGbV+F+MzW04ZIPVoxO7pAJgEjpHa6lBlwusfmZ1CCiw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.5d1122db.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6QyhCRA9TVsSAnZWagAASpcP/iwxINlV4OJLQI6ouH3s\nXSDD7QNWMuKQPidceNOYw0OnbUwlvIYuaubS/gHmFDjKuEyARcKuM3MmUp/X\nzL1kqqwYINrCocPr4qc49/aNpRr8v84Nub/ZLm62/F13cJdhfK/KbnGmdR67\nvtR6wlDOgtCngzEhSZG4/eYnV9ETULMP8QzzUNONqwqE4tUdGypfj8ffNenl\nd0qW6qL85Gfyec1H5XVbKqETZuJAOovh8gyucNAjWKO8gk82pQsOf7LWKpjq\nuC+ROSI/oIJzhxijnJJTVFeNBCWYeeq0CJlfK5FnbCEzwfQ8pZTK6jwbV7tS\nuEs5NqLaE8SxdnFvSF/v8KkBxp4mcaPxIkIvJBs395CITS/CTbLvfxAFvmtI\nrBaoq5yMQe/0zjWTD8tkCMrD+nSKUKecs+3m7cOp+1eQ+0nCQM6cVzugbueW\nexRI3ngLoay0JBI8rrqynwSa+mAUUpZsFxJO1Pel3368AdHU1/X03jcPgLra\niOdl9LPSH/t8gkj795QnbV2haf6H+rMqxWnuL7zUTTdU6uAf5XSr/2H/7xGv\nIa9CfuffHRbnhYCwkWmXPhsvWC8a9XA58CSeepHCFV6zJwtpwwMRLJ9FbdC2\nb3CLWcwogrBp4mGLpY3mRThvmhRgYHCyQ/DaWsKfdiT6sw+gK4jPm1WS7Y0r\n1GZQ\r\n=w6z7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgazsJobadfEFceEfbHkRU637D/gEkr05gowaXJnmZOQIhAJsj68NtxmrFPvUhQ79HswCl+I2kx+hPMqmxrXWvS5bK"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.5d1122db_1541999776368_0.24726395372690835"},"_hasShrinkwrap":false},"0.14.0-alpha.8406990a":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.8406990a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.8406990a","dist":{"shasum":"e218ff844314ece7725ea9d48f5234318eace873","integrity":"sha512-+eBxRJXbOOTvBZlc1Th3F/P7cl5f8fTI2PTogDaK2haEAO5NXdJIhPPjLYnHVoUrk4zjME0I0k4A/7Ojd6hy4w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.8406990a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6R9PCRA9TVsSAnZWagAAVJ4P/2T++LWy+kZStxVBucL4\nE67kJ2ciSM4UPUuGp/nGYQikM4LDPqWEYI8ZHbAajBftuWYLDkqHrcrnWzkU\naH0BJKpL65sG1VUTPLLS5RNYHDBLS2U6ZcSj7eeX6hGJOAXlip5YMjuCtnJw\n8hxXCUsWmkl5snkzlpmGEHmz42f2CgYiXwyR6L6zp4U213JyJYkcl4VsK71u\nbUj6q3fgly4BAyud6IPKGTElPzVY+92KvqCAoqcMBlW3ztlnN1wWX2TZOTB+\noAJyjhQ/e6ZJ5co5POTKsrzUCOiRAlezvdij6GAr08lnC6d6rv9Jken7ZUOG\n+PJqPrdPhTf7KZhWN0hwMzgX5FoafPYm637SXIKaqvb0+kmgukM9enOqJO7T\nfZNFAF7qAqApf0X75vM/PSMIh/5FNsZ68+cbjo9jjRY510cHsWflGVAdcsPz\nnr4NqDrL37pU4HWMTJI0W+imqUUSjlp12ACEILVHqk3XWxOvBVdZEI6JEi5y\nzBhPGewC7oaMmJECcedRiT1pmJjPQo4wcPTebmb6nrpZmimWDo9lt2rNhEoK\nsdTP1jSOV2BUSlSbeJRS/fuDPD/cZltxoDOnO5kVHczOMHE4lIYaaf0OES4+\nnepdvsy0BoLXMk8eaPhYnP3Stl3rrrhmXQf4oXkv4a8bgoFcI9wxqSERCYBc\nZah0\r\n=Chps\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBGIjE4ocPQqxXoE42AZk2MUOGTr3BgzDQRhDmxqLGdtAiEAuekYJnQbzM9mz6JmqoS7OhDYENy+0ThogQtbFYEVNGU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.8406990a_1542004558561_0.033186129117715124"},"_hasShrinkwrap":false},"0.14.0-alpha.a5bb75d2":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.a5bb75d2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.a5bb75d2","dist":{"shasum":"2c24ffeb5b8978f985a2181daaafb0b6ab8a6f59","integrity":"sha512-3ERP6zjqF6lM0TFKG46NX0mrIq7O54suRG4ZTpQGumv9CaxG43aMPUr++UoVYOAcwnFYXWxggfUvOz6JdWomEw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.a5bb75d2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6WBKCRA9TVsSAnZWagAASl4P/0et6jLY4NMHgiIkP8xB\n3dQ0heYKgGe6fd7UDNlw74pBpydZP158zfa55za9FAsYe3h1oWC2woTcs/PY\nQqER68yf0QvZFXG1KbmIrIMgIBYv41iDNl2CXlG0JIQZW4oyo8191tQQj5HW\n3cyTLZiWIDXoQCKvC4xFc5rITGGiQA182rvc6ZzdWhDTcvX0/0L0w5RNdkIp\n4wbOOzMFTG5KaAgJw6PrNDrygoDf/9wWEf3EYfQsImqTv6j5uk3e0qBUFMGe\nx52VNr6ifbDvkMtWlRVRHMTG7vnwsxexfHqZ01gW3zTBcf0HMJIIivFZ4fC7\nnYdTupcD4kr3GXc5Tw0PXLTLxaoL6lw5h86uBlBdbAf9puwazdSYxG1PV9NB\n6Ty4pVkrAHRcZqVO7S++YSWs+7OEDPZ3CbFVGlj+o3MkagtWteoZKTUhznhy\nTcIS9YwhEOfOmOW6+5DHCRs94FIUUOyJkPMNyjwlo6Z7hOdhkXWuxPoWoPnO\nrV3yus4yNksa0aOhTxck5aQUy06rz3m0O+l+AjIng2eo6OAb36sjOUquAt8/\nhEdagKsLhf/hWK541nXQbMLXWXmDlDbeoqrgecm6Scf5e2dkmJi8sX0QabrB\nYZ6DmJUFTVgIChilvGi239CyUFeCfJQjDRyhjXg5tAVIQddAtMLTccZixaxP\nQJl6\r\n=tv2Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDKHXunZH5m3qPJwcbj64Kpj7tOv1dUV+LoHCPrEq7SjAiEAm7Vay3Z53eBUrCwLblrew+tpkHX+yCIi8tSrbiPVJLs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.a5bb75d2_1542021193845_0.8270088088754124"},"_hasShrinkwrap":false},"0.14.0-alpha.de781063":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.de781063","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.de781063","dist":{"shasum":"d603472a141098a3872371fcc8ee17a094f861a6","integrity":"sha512-9SdZ4efn99k6UXG1q/LVhkT13Vz/7i58MNKVEPcXo79xxw/2Ein9KSVk8JJ/fJ1ai3ubYQrZcO5MXLIqYYKZWg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.de781063.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6Wc3CRA9TVsSAnZWagAASuQP/2h16pI59xELHk2F4/37\n28PyGaVBDsFu1L5eXa/GIa0ajON5Bn7oiF+/T2eUCT+ztQo5PWjfWnWt30Ln\nk7n5xOvhzLjj0rThWTajuOALgLQzXYv+6AoC8K4kDeJjJukQb3MhW2J7Re22\niL++SEhTZhau1pgO4oo6U8mFVSv4cLZxX+VIZEq8G49uASGo31DeTKTq9wcI\nxCxGEejL0Z8QbTTgOcx7yKl3+J2YxGpWv2dh1U0coWoXGOhJqzcy8K4Fs0i7\n/cbIt/SLZ55P9A6ikDTL1Q4azMG9S7O7AN9n/iHNxhNCvqaDV0NXpsGFI74C\n7etFSRR/Rwvacp2/3nCw+FXCfTqw70Ur19RCT1d8INEZPoeP0IrOyEXqZde3\nG+3USlTGptEzz22Tojhkt+/ZIxjydAejMaWrsrAc3bZOOeKLolA8d+fL6GzD\nI8w/1iUx1m2+aPFtDGxV+HVqT+GaiMB/cMEyioxPBndp6kG5lthYtYKl4hzY\nTW96eTd33Hl9RmOudXLLvIU5S2WxcaKOEpBaO5Ge6s75YGX/lYLibtOWo1VC\n7KcZ14Vy9hUC1MdZ50BAfoMhHia/UT1lwKIpc4q7OYoCjCCJmDlTqhn9V5bT\nr3Jl7K6koXhcogg2RRwJB7wckkQqNm0SErypHx/QqOnuVVCM/e8EXHjGZLWa\nGt46\r\n=bmZ8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYKzBFMDNkF5n591wVASowCoxTpE6Ua4Rny/NfL49xaAIhAOxighzsLHV9TWwi9MNX3QFFvyNBxq5XzVK9yPI7wdmA"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.de781063_1542022967342_0.3727334650190963"},"_hasShrinkwrap":false},"0.14.0-alpha.f015a1ee":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.f015a1ee","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.f015a1ee","dist":{"shasum":"44ad496f37f14cef061198c4e772c9994382e2f9","integrity":"sha512-DiPXl/ra7q/zoF/Nn8AfLXlXrAzaWX0pN8TlvYgamd9nWdF1XHaXojSE6kH85Ha1+PhwyeQVXAos/uV2eF0wBg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.f015a1ee.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6WhRCRA9TVsSAnZWagAAv/4P/RZlhS+9ugKmSNhBBZpJ\nRX2I90SLta2YpP8uTNIulPAKrS6889QdqmcJToxjTChKqqatZABKKpFtAKFK\nXrEQsrf8q1uOlzT7hlyNRSLoaz0T35ZyPJEXg13VBI/3AzQ6YrSCvK3HwWkP\nyf7Zl/958etb93BCE3rVAlTPUvgC3hpe4MtV666zo8u1PUxlqhmKvGO2WMfK\nxtM99uxD66yn8fUawaEjpv0QNx3/95JUS2SPjHiVVoBXQXNCvFZNzU/6oy22\nceZZZiKXssRwPiEciW8S/Sf+I9eJEHmD8uiVOgO03FiGXP+LNLG060XQrcr7\n29YCj7apjSPUeCHiPsj7O62xpoyfzqt7LzJxTSwSNOY8C70SJWf9j0cXdloj\nBdSc/7JVQpGcpspspvpTK6koPXdUXZL7l5P2la5h3vyAf9ET4wTusv2x9NyZ\nMUw+EetNZCGKC1Y5EHIrzWXz4MzRdeWusZGGTldn0iHvtQUi4MWHpUkr3li1\nA0dAL+DmhEZCwEfjHCmDPCVQlcWAlhQ0HWPs0zjVFB2BvZWyvVt5+JQHPxMH\nnuOXUuG5TubJMxXFjuJi7uGO8i5UnedNmNw7yWNegQiUSl6UtMfzSlmN9DiD\nBdtC7IsyFvUpeK4FuuFc3ddncgYyPpQxrGGrTrPR8VlFuirsmk5bnEN4QOdj\nyTUn\r\n=xl5N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGjvmOQ+MoApsO8JDHE6aGn1a7Tvv+ihv2438i2qzCrUAiEAqeC7fMQt3zCHJo7J/E0bLYQIEZyBwQhghQYjL721XcQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.f015a1ee_1542023248739_0.8912004459650782"},"_hasShrinkwrap":false},"0.14.0-alpha.2cc3f625":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.2cc3f625","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.2cc3f625","dist":{"shasum":"5de49cee542eaafd0bc3679f2d70ea0567b5aee7","integrity":"sha512-e6ZCMKRx6it4pdm2O1DqMsNvDz3+2ZB4RCKpCR+Ol8LW9YqK8ZYUUZ/r1RSoLthZ7bJOGk7BubVnINjaSA6o8w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.2cc3f625.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6W20CRA9TVsSAnZWagAAaJ4QAJ7t2GrGLbNr1eERcTgP\nRgkuVhbZc3mgr8n+VB2anXSE2VemxOPEHfS40awC5QeFX30KnjFu5HnbegE3\nkEawmO2ZeAWHGF4thj1nF0pg8pKk1oj76/uPbHpl3hgOr7r6Xx/dwDso4nHW\naXSFHXAKVOcrupRowPZP0CMkAkSHjPeWoTCcw+EPI8F9owMQh9L9XrSdoRu+\ngldbatHwh4UWf38H2kWsFlLhYBwGv+9TvU95KYaXwxkLo7+u9gtP5KG9GuGC\nky0mmFg3NwHGkzXWk2buoG8KkaxFMIxbyU7ekWSD/41fy0ceS9et6a9Hdhc1\nn1nS1NsQMSS8dFMeimC1vIc6GKatFENyb87BD2aGQVkTptIIhg2x/9hLz0Lv\n/dSH03uqCoDIR6p8N7dwFKEzwIA+CCvZUHTCsX9S2eex/BASjQqjzSgkRaNw\nHtSf6FVtpOPKhnIds8bezcoArs0TX54BWsQdYZxligidp+a3GH3z4rqtShN/\nm2SwDOCCFPywuwn5oU5NLFmX0KM4pnMgnkSgqMA4XPFoIn5Zzsc4qEIh/qRJ\n0KXmftqM2T10d6OERKZnNBnE4pGhy0EQq7Z/r6ke8LqInxC/k2a2YvyHrafD\ns+LC2n8Bz5TvtxIGDORf2xP+ePDQgmVbkLlPJzSfysYj8ONve3r1wrcKEWl9\nxqaG\r\n=yaIU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH+RQPmPqofMmZeb4KmMGZNzpAGyqBTyBbda2n2DphACAiBtg+p8vbXmLNNhLg2NGg1mLPzVowByhah+oHP3TQV7pw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.2cc3f625_1542024628224_0.7935599441999075"},"_hasShrinkwrap":false},"0.14.0-alpha.c33a46b2":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.c33a46b2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.c33a46b2","dist":{"shasum":"ca5ec2890951e05da2627ea982557465c3946daf","integrity":"sha512-6xXXTV6N4p2Xto5U8qJ+XloTARbVdRsYQQ5h2100oDmUGkBO8ycYQAMTbiOfQh5SQpO6GVnkxCspK0Lkev7dXg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.c33a46b2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6XxGCRA9TVsSAnZWagAAnmwQAKG163I1Y4mjcDZ59ueL\nUwGHXUqwcd9YkO/id1v3l+94fNTJX9vf8oij7zuoQO+AGs83nXzlNoxmxL6A\n72FqQJ9/WIvgFb+5BJUXEqSG5tCs35ox4HX+i3b3S651zEQ7eHKesq8IXCEn\n0s9DaNJxckhu4SJ5hQVTf6FanOoOgOQGLPPThJIB3ZME42ekXgOloJzvD0ic\n1GinA08TMKPnWJKKqCDEdTdo9REpf0Z4oCrR7oknPoD/Y+Gz/Bwzdy5w7LaF\nNkI3e+tFmK7G1yJDundUklpwGWEj6NpB0V50S8wrUqvQbkQNGqSXP+g7EXs8\nYOO/nlCzJD0aNeN51ZTMwJNEKtLptZ9DtOyvZPD79cnhGOVg+Wz62sMryLy6\nk4XOvw8lOIsgEWzjF0RNthsvOyWqY9Ec3Y8OEd0vjT1mLuM7UQxGNsbZiFa9\nBSvZieolP1ReK8iH7EC1UxB6z5NdHbtLzUobHQ1mF8Om7Kj1mPTjnBDTCfvr\n5+6k+IGETuqDsTwGkYmRF738VE5f6C5SE7GFmybglX542yFVQ7RZ4xb2bl4N\n9MJJE6agD32BmdrlQncEAQxBuY5WVXD6x2JLiJRhNGZnHIRnSTZFrDLhTV2x\nZC3yAlHtG/gGEjeFdJSOcufCNeh46a/1zmyAwEIQ84Ua4JtOy2YRX+F/YiVS\n/T6Q\r\n=Uprl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEdtynt8H8Rsv/B1RU1JlqTn/2gYJDZ+161gheIXS9QgAiEA7RkhBTwAzzMfItAhZkAOzEt0cFdxmybjIm7c5O6mXgs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.c33a46b2_1542028358023_0.907735186584991"},"_hasShrinkwrap":false},"0.14.0-alpha.0b00bf89":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.0b00bf89","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.0b00bf89","dist":{"shasum":"aac52df718cfec21ffe32382a08e3c46a3855aa5","integrity":"sha512-HoSJjLyJ4zo9XAeZKSX3Iat1nhIROLoOZgtu0CoqrFSHyb3o6NnErtWHP7ki1xs4B+e682KuGHhThwcH1uPesw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.0b00bf89.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6Ye/CRA9TVsSAnZWagAAr5wP/3hFFELPAeTEsCuHHrYH\nMlu4lV3mA1DqwVEsykfZG5TmwIiyd7S70ts7naYVnniCaMCtnMFg12Bv7S2X\nbWUA47PPHa5L6IHQRLPCflDGQv+EwKMajDYSjQ7JOFnVsdZMCLJlJwJi/N8w\nDGSSrWDre70xnPv7FjRhqDhpscL0KM1EuXHtjuMV2OWdyzBD5aQfhDQOo2cG\ncMWvpLhXIJSqw+cug2gG4zduu0rRddHoUNVb7U8uazWrURKYRQam1mMyEwz3\nWpxz8k64v37F7PBW+gdp2QneKX+z3QxXPOHR1hMyi/5g3av+5Urrwp9mOMoz\n1BR89aufUo2KDwnUnuBvnd3FkQb9mBmlWrZFF02FFxv1j+iE+f2sUTLgLWyU\nWQYANmzz7/ZZbI7kb499II1Y7sKBDfdL2hwZ4CVyo04Nzt6isBe+1BQUfa4s\nKivG9fPurrwA1NpCMaawVCEYTx04klVPxbLQg671Vq81qoHkX2IrCFhH4VhH\ntL2db+744b/3+HpHjv8+jotrp7uZMSCeIvu/oWxgqxvmGkRwJgIsCH3zwTHt\nZLr8IsqnxEr3y839RTwYXOtK6vmBa5cPFu9Ozz1+Ybfj1jgcau6VrNF/5C/3\nVqZ0AVjycve2WtoT8oGfTqhw/dDG7Ig+eZxyV/x317z4Wwfah1fFkH6OOkVb\nJfwF\r\n=LNEt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpXohuvbbFG3hYBTc3yJjexpGkNbFhMJhkYCoovZC8igIgJrkPgTHL/VyZcicQ/Vf1hzPNO8KJp6dchp/GpI4PhUY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.0b00bf89_1542031295106_0.6772165152828038"},"_hasShrinkwrap":false},"0.14.0-alpha.0260ba30":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.0260ba30","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.0260ba30","dist":{"shasum":"cea7e1df0e9877ef85ff5d50aa5a325563a84080","integrity":"sha512-bj12E7UO5pe5ZxjZgSl/R6Q2TZMSIbbqVx/rQVEo87PstAfsnmsKbF+LiW0XyJXSyoH60JAug4DtsEy/n0jwrg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.0260ba30.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6hVECRA9TVsSAnZWagAAuxkQAJYjo1B2MPhRE8BzuIQ+\nRhcv31FiMNb6rU7prd65FS4bPbmll6OvJDW2w8YbwNYqcerRNeys0/wp/tQi\n3KUUM8PF/UDvLxeD8PSXVJ/kdxzq8urMp+cF78fKu4/eFI9200wZdUA6H4/2\nzwwCF4DSBHn1AYwY//uqlRT9FxT9Z/VOwgYE8drU7wuFhCQKep7+rcz/6mC1\nM3QM1jiwb9CBFp9nXLdJsR+SfYrUC1pBco2zNBi1fkN+F1MFy7GsMZpZsFnL\nWkaoLEoIL8keEjXw2VwgSRtBQzqugYGkFzfPCQ+7bqeGPtLiaVMKDpYMxYRh\ne+K1/tKAxGHD7bfsX6c6g+zjgH8ZUFRJaH6CgT7CNTy+OZycrCoYmZ9qtsJo\no3euMG98Q5tKqfBaAulfKsVRDQyml8aKNZa+I4x94p/7bKNYv6hAKPTcN1VP\nPuT3yq4NBfyWdKHdDOsQ+rESSwhouW564nZZN03CZS0JOD5PMBMg2AJ4vSq3\nBAp9OwezxYBu80ymNO5FkAlr1K9FCE6rBG/JEU3xZxldDX74dDJ+LcQ8Ds2o\n6UJeV43MVxXVfiO+372kuAJpOb70wRpR12EcNmjep0CxijXESKvupdkaJOeT\nEbOBhOuMU8IW6SbPjA6gi4zrLqCWDOu7bRcaPPQR4pJnxWKugfO/LQb4IYqn\nDDku\r\n=7alX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDiorp5YFMJdOiLak3SG2xNqm76af7ajzTQAbdxAUjU9AiBR/D/CORaHEXtCrK0Sc1SPar4ySapE8aZrdJcfM7xM5A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.0260ba30_1542067523762_0.4103480197520586"},"_hasShrinkwrap":false},"0.14.0-alpha.1bd7b5ab":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.1bd7b5ab","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.1bd7b5ab","dist":{"shasum":"41aa96e608ab0a57c7d104b68cef8fc0508c555f","integrity":"sha512-xDtSCo9tcbEcI/jsyNJYZrr58qrv+cyKu20VgVZk3JDolHsnuzDL2HK4HhY04EUvJZYVcuafW6u7Y17DPZ26AA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.1bd7b5ab.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6jYKCRA9TVsSAnZWagAAt8UP/19oPIyuJDHKDXs0+Nj2\nxdmPJ1+Nu1HYTs8AjCMtZtrIeqHAKlD56ey/FphCGdLMBuI74YqEN91TAHhe\nsmouTxZPYt08y8Ei+OVshqo73Txf3Q3IyWEgybKPjS3XTBIfEiURhTO+dr42\nM7QJmjVPrS+o1ZWtpQ+PDOfjZYpQpMTsFSjviY6nWzYGwnwg6mu1nyIFqSjs\nHypsSBsdx3AeyXFYIP2wiBVf+1LNMAcki8v4l1ILDdAL5rSeX8fjk1VEMhDe\nKTvqsu2i62PzoenjXCBAdw7OdY1oRzcqmuDpPXysB94NweqlSgCNCUJWecjh\nQEir5TpCpLeJ758u0UOPtBKtcrDKJqw1fsRl2q42iPqT7ZhbyMIyovHPBYfq\nhWwod1B202sXDQhgJmh6hJ9M0W2P5TMEM+cZgmtW6D++oJ7faghGsq1dvzfV\nooTRTu8QHJgEjmndQzWsadyXQNlaIZhWgI1nY+RPeV2P+GoPApqqLZqZW2wv\nP07WSaJW49SAeeGgn5IUHqJ/R/NXxqSW59XpzkuO5e/tcRP6QmYsK3NYhuhG\nZtZeQEkn9yveL0TSITfBYQN77TR/itlY7VxWZBITs2ZbvKdvnYhohVv85kKA\nEvnYMYHpE+Z8eUDQf9Y191bvG2jJtX4rQwN8czf2aHWZ02Oh+95er9WCuNTM\n4ewh\r\n=tYDJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyeZ7BdRCdYVswwTar/rm+9RKyUivVdj3zvDIAc7VyjgIhANJ5EziDzvsZFkaVL7rpaRLLhnEMODPe4IMgK4NOgmHH"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.1bd7b5ab_1542075913664_0.9200104203553927"},"_hasShrinkwrap":false},"0.14.0-alpha.795d213a":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.795d213a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.795d213a","dist":{"shasum":"73100a58213f7b3b4d2287ade9f86c887d5bfc42","integrity":"sha512-GkhSgOkVgXX6jOmepJZptfVi9UjAlEsBf0SOB2Ot8sfvrnJ2NqnY4c9RTVZv/nOtBsdwv7vNICmsG+c+C5AYZw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.795d213a.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6m/fCRA9TVsSAnZWagAAwTYQAKUawOH2jyo3MT5i4mbf\nzyyi2Xp5UCvADcRfIBymv6HBmGyj+fVuyBaG590aS6vKlEbVymUUkxp16lXj\nVPZBKRzvxUt3XXpZJb+ogOxeCnvVfXjk0OtGSFgwgnRQqiahp/vDPKaTwUIV\nNyaBORpRkA+YLvTQkHxstBIbxr5DcRqppini11qADVxm47re0cB9Wf5ngRJp\nkXXUk/jbu49mkpenz3+t+lJNJQqO87pMv3pPo+Wx0QjwDN7GECbgw6Hd1nQy\nbLFNgEvpwp9El0ZyYgEM0rfdcY0yBO6wboozhzMYvjZEkfpn4XtcruiMQci8\nPzR6GCsAJctHAFhwEWdwToYMBlbFTxpmtBwSp8XHd0bLFPMKNewa0xOLS+vz\nXu+Wb0IdPhUThod8NcTpkdPgm2p4wl7xDtjsIMVAGu14SAeohanVzohBhezp\nlqjaFJh+zyK9yOlfQdQBG9bdLBLzKMLd9O0tDdKB6NvUKJ7GG8YEL976jlPq\nuwhERZONEnxd8G4uHE6WAg1aTsEc3D3lXYBzhFGpnCxi35tLW1pei8mRDdXJ\nFMnxxDThSlhNE27gMpYGZp5OsQxuogzNCPT3ETl/UOtrmKf+f53OX2S6NuTY\neUIGxCyL0KuiXV1ZlWhKDKeJgtvpJUp8p2PqQjR1QUWh0Ms7FTccKs2IoMW2\nadjd\r\n=hVD3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBKeHM7yBqZq+TXVWSDL2WNrGwH8iQItXWkoKKVMssGtAiBalqtY29f1BOlt4BEJHpAmmm9N03i9zjX/w2DC3Itdqg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.795d213a_1542090718399_0.6843218242863871"},"_hasShrinkwrap":false},"0.14.0-alpha.efbcff97":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.efbcff97","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.efbcff97","dist":{"shasum":"96bca5ff6f54cb2ea95543bde08d985df767a946","integrity":"sha512-2KOh0j9pTgy5ciuW76LODJ/WsZtoKyuJx4w6jLITeB5sR2x54Iz/lSahIfbm08RhyLsvZV0II+XAVdHXYl7buA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.efbcff97.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6nIQCRA9TVsSAnZWagAAstIQAJvm5Puyl6HHvscupFtA\nUHhMbGx0iwjKPhPgHudnMbwrZtMKTkfsttYuHFLPM1S6mjYBg1Rvrwc1VMSd\npoWMK1oCMB/iflD4r77QQ/pJeqpXNo+DDXUF4LOGawvaFeJ7eOPZOASNniH7\nPJBcq1OZb63MQy2PlGx49zVYm5AwKaq4dekGxWzQnmj2LBu6Huoin9kuNvVc\n0DIw/b4Y5nTf/jyXvv4jxZv8zgM3MOySgJLRa2s3LQsuH613Hbakk1+3KXLz\ncJ/kO5mGyoFw6a4Ae+029cAO4ilP9Dw8sQPOMkJ+PIIbjgbZs0zkLvAJGLZN\n3UopO+gocWW/W8t8D3W1E+UHvIZXzggvkXTtdOLBLTTL6pS1UpyXvFqKvdgg\n5GgsLNg6o6sdqw4HK0uuAUpe370G5lUIxfIzNUix9k3lgJUAKsL1BAF2bgUW\n3FGM/a0LbH23Jkg082oGWK1noWv9DtWUnh/8PYJwvEMN0myVv9m2yejBhEnM\nR4xNsouTOHJVZU25sYstp1i2l7BWmcN06gkZg2rQNjC34fm5erhpDkoS1tLq\nh6101A7bsyBhr7CCEm1Ewdy8n3iBlKfOP9Lqhq04nhBg9zBtycK3CbuWGoUX\nVQADM0GOMT4u93GXrgsCq0LaRg7xuQ3cDhD9LKk14J45G9rujk5PIswilLsO\n230z\r\n=z7XW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFVoXlTrOLueeqJCDcl+r9C7Sao8tpFyLLzn85n3hi9IAiEA+5zf8ILqNHWlGAF3S/vZA9eGcl5R6noy6Cd95k3oomQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.efbcff97_1542091279389_0.5097901686965021"},"_hasShrinkwrap":false},"0.14.0-alpha.74ae98e6":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.74ae98e6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.74ae98e6","dist":{"shasum":"ee6aa4e6070fa02b2b98da8a75cbb5e231aae2a3","integrity":"sha512-DQqNudWYk5iNf5XQU45BUzu87k5fWoAMcT1Pz7zfPTo3abrBMJR4hNO1Y4joSN+GK7FE7AJdlUAR4M9XVCVNJQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.74ae98e6.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6nK5CRA9TVsSAnZWagAADskQAIIR373k0o//8+xr44iY\nlLWQGbEdCD1ED6yF6DDIeBQWz5W7hR+xDfZqx0yueH0/NjYZTGp2yIn1Y3vp\nAdr8mEAbUfgV85q4bRV5V/nGvQAueK/FQDSFPnjMCsT1cd8coXNDyeH3elZ1\ne/EezLauOXGxKxOvdpoH4ri8IXkPSbOY+FxWyREvQVn4PeE8vJUvc0J5DBKK\n5KkNtzDvBjt83AZFtjshnFu8EJDReobeVCvfEUOJA64VjRhE5X0mQtdoh2S3\nmOujSyEzzvzrOdzxbZ7yIAd8mDMrO9c9+nC1DPCttbIYo2ICCrQNQJG0D0Ak\nxOb39KPDYcVniGl9hBJs4BV5ea0rLij5TZmgt65WBKOGkTDJzTkF+kRsCOs6\n6ODnvRedzoQWtW5uENmdubkP6znR/VxRmq646vwHPFyBJr5CvFc6iAkJ+Ny2\nFxd9bgPdj9OXzyauIMvs5Gnu+0l9S9HdJAEAH6N+0bmEuzqedKRao5ZIadE1\naVbAjNf7us+jybTiM1d/58CX+mQXP4Ee3D4Aar/kWCFFTyuatIRLk/927Mnt\n+hR34UmVxcU57FpFQ9Sd1sb4yDYbrYoUyLXp1PFLOF/uzs/jca1x+YXbArF1\n0hlWqV6QaUfDraI8bVPBa/lLvFuzlRiQbSCeUINRSTOLCTnNudVgkhL1c8it\n/ZZr\r\n=ITDy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7E1QwEd5dbLfHdkyTn66bxOn2iLNgF+QGzlfozsP0cgIgfxRzK432NCqscQICnw2qGfj8UteRE0AkqK0uL0rFIdU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.74ae98e6_1542091449044_0.2424153121961652"},"_hasShrinkwrap":false},"0.14.0-alpha.57fbc491":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.57fbc491","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.57fbc491","dist":{"shasum":"f549b4c87843ef55544f8d1738314f0cf046ec67","integrity":"sha512-AilHDqukZsWe2yLcb5Bi4JGVzp1slcv+5C4gJNhKqX2YLqXocqV7i4+pT5zNyEQUiuh/NAOuSlrfucSCVtVh/w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.57fbc491.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6oJGCRA9TVsSAnZWagAASMEQAKLFFQUGC7q/3JJ6npZu\nDXVEH6FyBqJQy0jAupoEr3OTH/xPC0+w9C1Znznzvm5trwtEC2gGuOGL4tly\nQ6whRcdLz9pg5+WYfArurnR4b+L3kpJ6H7xvwCjdE2l87UBNtvLW/fxuore/\nOKRCl371LKJIWjMnB9yzJWtSs7DVS3V+kY18qk5BPjL9nnbz68NWP1nAAQZv\nj39squBGBEpheTR2f1+OYmqSpiy30/EvRxPiFeeBlT3gQWJu4hm6WYEb1Hmz\n+2djmvpQcUJo0OVeLeFL6yLpdhnrZo9GgnUeA9VajDy6tIuuZYpEJoUExqTR\nap37tVJT2/Slf0fDytUYMKtzPZ2PfViIEHmqBFEfdEdeRIqZXcU0jv0J+3bL\n/3zRCAnU7LTIhWSHZ3QTWsZSMyI2xnTWOL9dtA42nxGJaKANyj7FDhLY7yAD\n6dMz08kNC9FV5sJLk/pb17iUzOUWTo2WwfX7EUbjzKbsuatAMJXss9V0dbY/\nlPlFOLrk9RSXkP+aWLxMK6mmNuwHZkMWGe6QR25UdtvlAIHMEBf+bbGVOAIk\nMGbIOZD8j81WiR7L+sglx4+GaUNpASAI85yESjCIeqfdyQJusCX+T+4vkfUn\njInGY9m6QL8BuGAgkkHNQAX7qRVhW/0rkKbWnsIvgWV2/gxIn5YVGj9qU9u9\nGxPW\r\n=CA2Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBb8OcJ4A4QNiTU6EeRfznIyb3k/TbpV1yGw8LnyGFVQIgfEKR+5tIdk0STAKkbQOkzwdlaHLKx5oyrT1truyO1Qo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.57fbc491_1542095429610_0.8222896331623457"},"_hasShrinkwrap":false},"0.14.0-alpha.860692ee":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.860692ee","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.860692ee","dist":{"shasum":"c2175b728be48d1aa7968a917621d41999841479","integrity":"sha512-wk4HHHHRS1jK49kGIhXtzblZKRmxtAO6UfG+UvhtH3L1eNNYpXy2jOcO6JV7FqMgvTwUtByO1Ju8KKYxuOQrrQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.860692ee.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6oO6CRA9TVsSAnZWagAAnToP+wZaHepSyQsShRS38nIV\n6CN7l8sqtY5S+MMYVwx4aTJE9g+62eiTmKEwo/rK8N8CYEN8vdPyV8Ge07Xv\nzTXmnuYUnDiQvp+ifsIsn0hlzU6hFLqMHLMom+Tpr2tJwb4QfIcxw+xQCc5m\ntUkDSjsTyv6ZR7p+Tquc56Fhz1Uq07Y4I3RzPiwVZ7TfovnnBZnbXDLCQoFZ\nd8YEaZrjlzeBk5+/nQh7rYJlhN6h1xuKSKOFBR4sjFnTvoAs8VJBdj9CtsCR\nmpGvAMeSJC0GgZ94sb5Yr+HB0KCx2GMiWfwGFZ838f5yOPDfD+RtKm803I27\ngUXcE3miUrMH1ErEj7r+0XwOqBLOwGmoyh7ViKDsdsRtDn+Mzb075vtK9HYi\nE5i+M4PYFz/CK2b6Xc625qzc7MuAGacsKOKyksBBXDVKMC0ScDEkTnYHHHg6\ndvLeAWYpeUmR6JbZBWdIeYN4hmUvUwM3xUXRn4lIgT1djaFiNNmUNx762aC4\nZRQOYzuO5zjX8JKS6Ol8MoZ6RZtc4rh6X2MoBSqE0FDydQKiNABaAlhnZ6HW\nxhGLT948IsvzUc9tRlzBAaoa6jE+qJ8NkJ1ie6yZYo5Svi6sJpr+taGGZCg1\ntX+yhuhCgJ80RqO/1uBg3u8DF3/CuLttxbiHrDQZCCpkiBJdQOB9eVn++nyj\nfWY5\r\n=rg41\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDS7KleHvNDmhZy4SHrNxL4D4skUBYqimeqOcWCYlto4QIhAIgbWv6OxUqHjXiqIrWrlz58XbZjGcsibuXGPsFD9mMc"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.860692ee_1542095801335_0.6171855144016105"},"_hasShrinkwrap":false},"0.14.0-alpha.d40fcf9c":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.d40fcf9c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.d40fcf9c","dist":{"shasum":"2c5e0a97d47c81a4bbb2777bb20ad4123c0d2653","integrity":"sha512-UuNPqjmk0Ea0JctLOjLPp7lu6Y+rTSbrg1HHlo8MORlJTaVofYu4sXUt+l7YxxKVm9ikBF6+JLvHPEAECnWoXQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.d40fcf9c.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6pUDCRA9TVsSAnZWagAAtRQP/2x+0fMKgFl9BPb9LjI5\n2BPutt5fU44wDY4Cz+Sn6eXHGdjnnJo1OPKRaasFanSBF04T/jKCkeXUN3v7\n7Hjh/7xziu3Y6tqvM+K5VGruJ9ozWZ3+fS+/fqbee0SzuEeYTX6puzmMnk88\nxhXYaOYT3N+9iGid204rCTvLT9dQrF5n9DD9cidqWkWPk3RCmolRddrVJFB6\niDlQ6CK7DyjR4/e+3DlA0kdRoujrOS7+SjHb73jp2/0GH9p+Xpp/nD/3EsNA\nxIoVks3Fj0bfqqI/bKRgX5oQY2/7kvIeOJoboAx97+4x051jzICHsweMbTSj\nmJZzYbKplWbZKQWGdirEuMdmQDSBl/yxoVvAfJIgURqkBi4aDKX7NuBX5QDY\ngaDVYQbsUVqeP+tio6fimrXmhWWTNfUfyK9saALKLEUglJ0zaJl7QT/5AkMx\nTeam+NNOCOIUcA2OgzbG8tzsoWUlTd/cegzYt4pMjTlOsMP3JrkCHPM1BYFN\nwWCXXNPc2oHKdUik4p7vQHa1pMAfVjZ/MT5v6lwL4lQM6Miu60ucBQWRZpuL\non2RPIO0FAHppqEzsuPPsSYN3GWCa4TxyWVpQjHL2EhCvLjjIcJxLbpvd73w\nWPOi9vocdnnJfa7tSGM2r+A31LfNdW4Kc+c/hWl/F1RZX4TqwqEuaCLLlZEX\npi/J\r\n=O3RY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICsykpd1WKWuNN97+M6eofHaBYkXsKUkY11DFc6a8EcHAiEA0mL3s3XYXidqL2b0/nVeFUiT3aaAN6UxTEcuf9xhoy8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.d40fcf9c_1542100226272_0.9897667317201688"},"_hasShrinkwrap":false},"0.14.0-alpha.75a033d5":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.75a033d5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.75a033d5","dist":{"shasum":"1f328782d53f9a0855187f8e7d33d55f5f27343e","integrity":"sha512-vD7/d/Jlf0qrej962tTuzPJBrd6Wr6qEYL3nNzzyQmTPebTEOLjWcvhOuWbyA8/AcIvNNiqukBPbx/SKwuxx0g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.75a033d5.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6rFGCRA9TVsSAnZWagAAYR0P/iYTlAZmuAd63mkxbKrJ\nOcPxVF0eZ1Hh/HkbjrhPhsxORjBsoSdLxzhIrI8Tx12UehECe+U/zJDcdBGb\ncS0icF/cp5J/PfqytwYTupRjXLLxQ6xmo668rpFHdkOLtac9splhXHsNmzRF\n3iiSPTbG3+A++ZAJIj+svpFpMqwzeoYgnY1QNB8r8tqMGhQ+szJIRA4YYZbf\nsZ6xRFtPO8soXVOXtp0we+Zv8q5UmIC4K5N1fTMXQGnUxU4SyHxfOyq0Igoc\nZRaDfa1z4mc9u8JVbnqsl8IXOBD7uwhAmEXnfBxS/xagbhfo8cuN6+CdEZ/8\nq9rKB+y6VlEVulDxOmfuxy4+49+boP/iCp0aChGr02rMqhcsOWNojORpjUn9\n0Bg7LlVwAi3xXUV9TCHz1vhKMu1Y8wLG5TupD5xiu6cwYl94hO93lOA90Mwx\n+l3YgnZU5RTWNRa51M0QCRdu/OvozBmAvKNsrJ3bh77t/0kewCfXNPhUqNV0\nSdWsS5cryRqkrKvnvuHaevJEMjLojiXb9IMTX3zcvPKCiynZEO8aUKHtlzoY\nO5z85zm9HQwFzQvKe10poYafHnCWgRy2gv1594NUXuNIYU0vU2+ft+2RXwdx\n3I/sYotBZYmzPjj4h/k/7ZFfAZvoQdnqXNuA29nsFlG6jTFs2ZvtfyJ0qJnC\n/OiE\r\n=BqQe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZG49fJL50nT3StuScQPhva69BXVlpeDTMZc1RGaXKLwIgUlZIU0WNAkr4RshKiacyxDlJDhFC3axgtCsIEPM1IiM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.75a033d5_1542107461539_0.7799879638413945"},"_hasShrinkwrap":false},"0.14.0-alpha.38e06f3a":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.38e06f3a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.38e06f3a","dist":{"shasum":"07c7c09c21decb0c8d056941cecb52dd2c133477","integrity":"sha512-buYU6KmqLalkEFXMM6ofIOOj0XDKN+1hbcanvw/nGRo2MTjPs7Lpe1O5fHPRvIZkg5J3yS1GjDYpc4rAoGvoYQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.38e06f3a.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6rMnCRA9TVsSAnZWagAAPXoQAIrRkRZxYSBPpzJ3Wy7y\n5vNZQWBJyUk29PqlAp9HrpfNivTANYARZ61mmNT+iX2jRJg0H8x6bM6xzNkD\nozQpqiU9oP5dVGPsdl3kSWvaLJetwdYgbRV64hw/TV7U0JlgZUlCXnipWSrb\nnvq50aTr133+mtrSfKACXISYmqYUuFFCX7kpTXEWN4zcNYAt718isACYl8FQ\nUQACrHDu2nmgz7R82D6kwNTB8JHP1jaeaxJ9GMeFHgAZlZmW1hm8zoxnlXge\ngnYzgAG51kAfaLCAkIk1+0M1cEenuIXC6fMJnBjR/9XZRAiOS4kQ52V0yUEc\n9uulE4QFV/7Q1RmbOUTT1d1pJFsqMLbgOUFbfvy9ywzYQjQT5LJ5X4nysJ8l\nsS1CUt/Ic861lYp2aloegB/pGdj22cUPlp/LuyMUKpOpj/6AIH3K0/tRvdvB\nITef145QUBnnPM5A9z1UaMgLA1yShQU6G+dn7VMs22DkZUJSaKQlvs7XHqye\nD9nretHqEf6ISF6ygNERcI0ESsp6DBP0C8APT954kRGUyyb40MmLSMUoNtzw\npvsEoceJSRxzpS3+/OWlh5C8Zdfg0kcfOw12l6x3BrVxkBsR6H7VGRioEEWh\nQJQgjrVXYmOIfFaROvWygc9PcjKtArBgZmnqJSc/DUOSmgXdN1+VdVoYOFnO\nDNPq\r\n=0z5k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgHVzGYfoX2BoG6g2pcKYeku0cuOv7p8iturW9fXzi+QIhAIjJc1ZNv8L1MCGsws3867tnjsJLWsVQIyu/psG70yrQ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.38e06f3a_1542107942510_0.95775269927835"},"_hasShrinkwrap":false},"0.14.0-alpha.abf2abc1":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.abf2abc1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.abf2abc1","dist":{"shasum":"5b94f77ea3a5a39a0fbdfc046f4188cf954ae960","integrity":"sha512-jmZMhBcvxKengq5s+Kp5zCEPaNgH5M9FoBS/07ljaP+xl/h9IZ7OfqB+XgjyOUfjlfkrJapifmyPmde7xcHnSw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.abf2abc1.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6rMsCRA9TVsSAnZWagAAt6cP/iQocJqmwQMgeR1RljNo\n4WA8rddeJDPUab06/fYhSNIZq+p4B1Txxl+npSBb+OgRUelatsTjZPd9OrYt\nja0nv2ITbnQ3kIz+ltkocDqYrstVWtzMIUiZTPcauAcselcxFzKNGTizAfyI\nbzBLYcaDyUOgdo9O0EnDlzqw6XGsD9LxqMrDfNSq7IaMOVrNtJX3cU2EEXaa\npRJK2K1H0EvYK8mkYEGO5JWVbh+pVoOQ7tiDf8FtHUIi58L7c+LrflJSJce/\ngHnq4qSoreXXUeD5ydUfy0WhlMaPfNY+scRIC3X28Y9h0taT8xXQWn7mtY10\nBafvxMQdPTepsgd6MIS7Guqfs8N/6+0ERVm5dgeRF7CS+neRHPFuSMxQUZf4\npY+FhU6FwM1X1fvUZg8e2Gk88d8Drto9+BT7shd/dKA3JLVsXVB2/J0iEzMF\npcepu08RHzUDqjpIK4Hc1iVLn6e5Hgwgj+Fie/I0c3p7y2k9fIiZYof6lQje\n2QF+Nvkkm09DX7gwQKmretuqGFBQJtF2QKf8PN0YbN8vPgWaxvY0VoioMReT\nPOHalgr7N2YLM7nURdVJ9nFUO5xt+NTjBXTyFuSDPLVV4G6nUOrOj42+66Gk\n9yb8HCE++bmyR/aHyvNMkBBsmmCfVEoW2k4WZ/rJVqUpvXN4D+sHNA8lPu3E\nqPNq\r\n=4OSd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtE7B6MQG1iA6J21jMtT4ZDg+Z6ljRMbS3BzhkMM7r8AIgXviXyxdX/geOO41ApU6pRkRVuYSd1uZrpSK9si9JEIY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.abf2abc1_1542107947581_0.4269961714684771"},"_hasShrinkwrap":false},"0.14.0-alpha.d97d93cd":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.d97d93cd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.d97d93cd","dist":{"shasum":"4e3f315ecc574a3d8b5cefb542e67beb71ca7925","integrity":"sha512-brVbpxfkj+DIkznCnABA4TectUIbA8o85I1Sc6fpo4L4oMEO0zlwI3937rBVP2JkfbxILC5pjrN6nF+uFnw6nQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.d97d93cd.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6rO6CRA9TVsSAnZWagAA41wP/iycUsr0qXrK+jVcTdqs\nv4z8pOIhLHa1ZALVs19ZwnXm6pnNPE3y1J9Myex3ez9+0TgNTY7GjuHI3n8K\nF7UR5+fK0SRBjRhcAO9jrm7J6rVMUjL/u1ETAfbh0npXxIltuxihpCRsh/R9\nwg0EGeBfNpdWGSU4WMsVnMqJDKRlYJ2aelo95CJSPGCtJd1magPJJLunAbkr\ntyHctQBPX9T6aGsuU0KbKGeXxON4dV5C8ia9ExR926U1THq/ISPhCn4+gRFP\nOEVX/sPD1pfrb3Zzt7ZgLxDblD7G7ul8saae/b3FTiE5MDdA1RyuBLV0cy8O\npTl31HbME2CfSx3NLbfh3HiF8ORPzcBx07Pyr08x8cQlSu0ijYFi//RsuiFx\ndlGtoYdXt/9lKZtz+SV9iK1a1P+520CLzj/hfDJyWPF9b32d7Iz1lUqlYlfJ\nGvwhwroHnf/zA+xsnCbwOr8DCC4MNMUHUFgLUHKLNTeCMjctWoob22Ft/NMn\n/LcRSjxQS71Cs/cAa/3Lrm2/XBKeG2XnlhLk5DI2fimrEy0NdDYxfT8FOJjB\nyB+DW+Cj3gJ28gyYmT4yygqlfv4u0YDAirhZ5+QvLpqhBGJyEg9GfnsqzsKY\ntT9zk1aKzoWoA8zBCN2fIo2OuAUZ5/9kNby+uU2BQG4zseH3u9IDneoBJy45\nh+kR\r\n=ny2s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICve2cMK+gLIBZvtI8qNtYlaLZ3MiYnPVCW4y64gLC+rAiEA0p5BSuUN+tlJyDTpjD4rQ5RQY3HAjh5bE0PtABerRTc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.d97d93cd_1542108090088_0.4888231905840352"},"_hasShrinkwrap":false},"0.14.0-alpha.23913af1":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.23913af1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.23913af1","dist":{"shasum":"d7a668231195f6add0f1558ab42f932d19a0e986","integrity":"sha512-4Ntz+UZj8f7ET7wq3BTfNe0fSjVSim/BaS8TRoWKg6oKhAAcQUSXnn4oVWtlpfOBXwo0Z8MsHznTY5ulrjdddg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.23913af1.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6ua0CRA9TVsSAnZWagAA/E0P/jprjuBhzLTh8C/y31bd\nqTrqwD0Bn/vFpVmpZhulnAhzELyQjgfnCGiAV+x41iHL+uvMZM7WJgskS6f4\nbAEruJrbuIe3vAzg0Xv7KULrXcShURgGLHlSY+6QzZTW8jVikPMOUXmClOI+\n8sitBCaeGj2JYkw0bu8XefSjQMnY5EG934SSRZITWuhwKesdqJQsSN63OPK/\n9/R/PP+PDJQCpfjauUJYMWAEEMjNqvTgiC9ahXY1NxMP15nmUxtfQKB/EmRM\nDuQF/jY0w5P6W2J+0TjVfdDPTY03dnudpnbXcEinr4LodlBmFXeoxT72uojG\nCOq7/4AYIYRTPLjQamrdtMP1arRnJfn9AE/3irNw8f0gx93I0qwpKpgBXxEx\n67LbKZed3I1ooxO6m66HAN3QxieUC/UvyjlfG1to/jpH+O4DikD+PumdGg91\nckHY3eFzU1Pw6dBmla2z6z3gXy8Wt4pPWKDXafZ5QIKu8DePAoe0YP5WOaSb\nputZNvJvjIdEu37yoQHBuFjwI4OPD6cwI20KGRsRGkOerJny0QIKftZy+sXW\nJYtBYUuIr0WltrTqtFNfqdTiwbkrR09ybQ/g193niSiZCzgLhCo+j8/Pq3xa\nqOCdZYvZ3uPAK/Msb+Hw+f4G8KhwEGxX0o7/tdF5F+/LrIwhVV65PbLsaPGh\nh9+E\r\n=9YoW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHE7+GpUgZhy7OihyWgpHvyHzu4d4LDE0lxM064PIa+XAiBzT9EYm96z2TgbSMgU+looVuZHH2Ub57KAPJBGByEcCQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.23913af1_1542121139179_0.8122769028568202"},"_hasShrinkwrap":false},"0.14.0-alpha.992ef1c5":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.992ef1c5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.992ef1c5","dist":{"shasum":"b64f14a2abb7d4ba2b0bc2bf1aacdd85c370d59b","integrity":"sha512-sXDMFIIVWzbQ7h2Y07Qd/BFK4lbn8CTR+EP0lQsU8Hwtw+oL28Yb/LzW9hbSdLj4EEdM6LO9v1oprmTs0nHKYQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.992ef1c5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6ufGCRA9TVsSAnZWagAAqCoP/1pI8JEWlQ7W+95hos8Q\nqpBPj7VUgJ2TCf5AviOwF1aG5yMOeKkkM2jfwuBFavsOClbr0TLEsXQTVA6n\n1RhwwOigTqiWpC+yP6Sbc5XRpSFjyf8lsQAWLKwQisUHWH3wWCiLp2vZ4xno\nhiOYg3U2ePw2O28XgV0yG+Su+BfxKGOdF/gyEgqXWtedpBJ2Iry3Eoo90cK5\nzEAdue3btC4qoEksziQRFVr1GQTEnow9yW9EFi+cSlROoJ//wagOwHFhPMOj\n0Uomyh2A7/5c29kDOLO9xJM1xyMC82VS7xVjTrlqTom2Z9z8JEAucZAM44f/\nuRNUWIe2ctFXIsRCfK8KCcabzIBuN8M6vza9G5JyfPj98YyWsuD4jIq2sK2N\nTZBn1n5fyJQj9rg3GGKn4xj/gnaiQKF9OO7Cv0L9vcfy9YO79e0wnEcihXJi\nJ9gLdtk9oVnkggTEbmZdvXaMsfVT4ihcjQGdGTnsfCgxNXALQ4zbVUSun0iO\nEN3FmM2kHFtJTlRQcDUqTfmk5MxjQa95wLrJi5a/jgYu7hxtjKLKVUa85BHr\n3/P5j8Ax7HeH0aQeQTflAM1VvnE2lDYqKkn8Yd1R2VwLBM6GzzAsvZR56DPF\nFvKdhfHdK+aVGPSBC0sBMaecHfIilHpW/8MdjLuHs/Fnf0HviC3qeePFzTlX\nzBHY\r\n=r78F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7kHm6GrzmH7WRxOASdpJB1W9eXR/nlI9IW3aBX232bQIgQvTzqtnwry2z2xcx9yFRSB12XikqC/Ak+vmhkE+te3I="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.992ef1c5_1542121413853_0.9184530848870374"},"_hasShrinkwrap":false},"0.14.0-alpha.c2951130":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.c2951130","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.c2951130","dist":{"shasum":"7c5d864f61615dda3e8e6c11ec80ea2fa5fdeb53","integrity":"sha512-HLVILUjNFpUWw0DedSBG4p/OSMJmlnn5dwEkEdI/AiIO7+s8wF6TZli33BFYVixyAKHV9x0VcauorT7LncsXXA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.c2951130.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6uwACRA9TVsSAnZWagAANsgQAKLn7E11CT+rOX2KBRg3\nHJg/yZ1ulg+g2DfA5mIegq2pU9xh7FsbUZJOwLiFMnl96XmIjXN1CLeq6bQf\nwQTA82WTpc4poOIE7nIpPZG4TUyug6VLRSOWeufRMk41uDYYaQdo4+aMBUuC\nWZDql9S61CLKPZnX82bniYBIhJPDPUF1lkVZzuu+DnBa/na3ObHNYBnCI2jE\n61qGQyiZxraqX+wH8haEKnCNKLbPPGsYXE4eUuwpZ8zsCqJs53JGWjLHKhYW\n58FDpVTzripFOGNJE/E2d2uHcsWOhXbioJytWLeQGe0pKUgFxvik2PPq0c/n\n4p/imLbFNbl6/RqP0TZ/COeYpNabvU95jAfDkqeEd8p35sISgn/Kep0sAe6L\nYkrkVHCuLKqQPyGBlQqpOmVr6YkZxVVbKXhjb9gvgV17q6Rl7xUb0xDTjf+U\nGTNsQbUp0a74G4DXS9slOmWrLKGqnyRxJWXGCrvTrdi4nQhIzd/Nnd2ZVVIj\nYGwNd/OsXTCaheL0usP4/v2l8khLETRWCmGBl4j2nTvJtuaEyf36yeIfK13l\nY0rLjypD2NYRrSj5JlindNkDxwN0S366ErpfyABPYCZ7/83H4gTNn8DLC8jd\n7O3uUVyIMk1F+PE+6mkJv4BKzAFm3tr9ing1ytBfIZq6g5jmmCGJME3VfZNZ\nfuh8\r\n=CNaJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFrLHhjmwlNa5xc/Iv821xb/ueJh8+119HkE9XusaNwsAiBCh/GJ3r3oJQP2bT1MX9/0XODeFkcp9vLEmFTQfYr2lg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.c2951130_1542122496155_0.6839175641931885"},"_hasShrinkwrap":false},"0.14.0-alpha.1566ad27":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.1566ad27","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.1566ad27","dist":{"shasum":"df23bc48e6210ac79fa172b3da3178509c0b1c9a","integrity":"sha512-4ow+aJmW3+qT5EL06mDW0Mlf0/ljn2nlcZBBDdJtBMdi9u0tz3kMPAXYjVipUeiO2TlSq7yQS9f8R1VZGgHi9Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.1566ad27.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6u74CRA9TVsSAnZWagAAoywP/1z251M+sfFAxEgtCNAo\nPkJJKsoOQafkr5lbYX/710Km5d1aofWFuvp8PfwMoQKpaH2WydZyGFuDf8wx\nTwV0+3efbwfnRNPTloiRuUiz1eKsoCKSTTW9K2VKyShaMit2hcShHv0c1ZHh\nGJNCQHkmyT5SFhGWa2XKZiEGg4mokfw8twJeezzHbYb25zrA38h8+A2BAnlc\nfGXpIzBb9T5fF/hUZ33HKfsZtoMlbEeNnx1NZ1erGu94eqHJf+jUt4lO2Ukk\naogNxONNnaTKtsycQe05HSJLNNqpkPacdUDdew62ydPUw6RQKvIc/a0iZtN9\ntoPgClex9ddY13VuRMdHKv3FQsw88PSF03SsuLSf1Kv12F+ZyEvD5YGedhS7\nAdkS/G9x5uHjrW86e8KqjNO/LUpGnrRCZpMXRjoE6PJAlbMtIy4dq6rT3/Bf\ncS2Dw+lZOF6sZgJJE2mh/lgG4CPYRa6zH0zP68st4O6vWXIFgNxGX2f6wRJX\nOcBLSnmJwO3E/wYiU/dOzvq1usr9/tfCxpQbROAis8FUB9I9SUhf43c2NfBo\njZbACNuo9YGqSBWs8X/ldOwUWHgUVzglr74dh9yUA8ChjZBzhh5ht8tSfDMu\nJ+u5TsjURUqQZvTOvMjO7LeiWPiWvpP+Ke3orrJvTAjFYpZ6v8TDEfUD9SYz\nKvnT\r\n=1K1y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRZk0eMfC0VdFQi5hpyOBoNE26jsXrh9VvpkWOSQqkMAIgBBcDpMOv08l0gdE/x2VsdwCwhBlIvPu5jOEBEC/gCQ4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.1566ad27_1542123255388_0.8087690675323154"},"_hasShrinkwrap":false},"0.14.0-alpha.c8e44dd0":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.c8e44dd0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.c8e44dd0","dist":{"shasum":"f9d54d0dc400887241caf1d983e4cc4d4d844494","integrity":"sha512-e2Cqmo4zJ8dJEsAn2hI5uTvHOJvtoXnM7aCRPbITQLr12uNF5odrYN8u3VjnuRWFr4ATJeuJxTAT6Mz3uXPuzA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.c8e44dd0.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6wZnCRA9TVsSAnZWagAAYLwP/R8BGOdPEtM1nVYKSyuK\nwj4zw89QdlSxG0YkfmNYW1WRbxbxeZPpluI6EFOQE1P/MLBtm3RUgNC19e1F\nlBi7diPTWAtuDx9seoO9tADuoN5ZzYpOcMIfbduO2vQ03sNfCdFy3EZQ89/v\nAs59J0Os8AmWzNw11QRSNKagfRn9paUeG0gfffohkjh5UrLRlo6RiS980uVC\nqpuiBjJM9xft5DLAQf43p3UG//jBH+W6jZsTSW2NMr1f9KlqlWXWIwndIV/Q\nNT48qF1iRXCos+bwVKKPDPFEXUcxHOoC6q79pHatMXvmC9DQbRtmhavOona3\nk1HS5zz8wtsZfYLZ3UbGPTT1u84JLCVtdmr01wV1aUvmuHFYXy5QF4VpLvMq\nuZw6osKdbFlIZXZLe4do4vJ7iZ3g2JikAzBl9p2Han46HukKVQXIEmBfvVH6\nAZJ08RTNrxXJSiC82RViVkSwd2r49L494Y0k+WNvhjy/xLf4Ac3PHMqc4948\n6ASA7LoaCZwjL+dY4Vnm/Q2eT2in8J+GRECNVg3XN3jvDW05tJvTKuj56ICg\nkEI89kOSWFtVGkJ/5IEFkwQzbHtJd3TaB5IVyu+DkFbidTSkqRqUtk86y4t9\nEl+cWm9MnoWLTmT6mNpaT3BzwQ2cJpFQQuUdiqE0oG24GvejGyzuYf0sB0pF\nnniT\r\n=mO8k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3/PsCeKdQfDDKkpuiqs939yy20XmnYC9K8+SeDRIW6gIhAP5S4RbraIbwHgy1E4MgWQUUrCXQ3XvRz3TjQdOW5INW"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.c8e44dd0_1542129254902_0.7518421564506563"},"_hasShrinkwrap":false},"0.14.0-alpha.6a8b5cfc":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.6a8b5cfc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.6a8b5cfc","dist":{"shasum":"0d3f46a2a9be721dd83e389abed0b9bf85335713","integrity":"sha512-mLsKeBXS4PQ8WfaPL+2Rd/znyu3c1LLvObJGM8mxZmP1m5KFYBn0JYawBv0oIF3T6gcwk6X1tIhaJPHhSiWWNw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.6a8b5cfc.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6yiACRA9TVsSAnZWagAAgokP+QDbkytJzW638VJ4BI7Z\nDQqbnJU81xt96CsbzD4iq5sCavzau0t8eY2xSuxTRh6b/Vm34sme/KGmyLzR\nmYKmjDrhesCjRScshDOh3yM5ceQXzdReXXp5hy/HG5c03eyrPUonLMylcYA6\nSbCsfwXvA/50YjNUOJVFuoBbTT5AmskwXN+N2uNQaOXI3N7od87cdwE9/Kft\n/7Ftl47qQTUMZ+isgrJE89upAO1yBIRZuXMkz0SAXCx8DZoY87b5vRgbjmb1\nvp/YUgD2qYp0P2nNgfGHegmYIjol9clA/ZeuhBaWiQs3pKJmEsO5PDsxQVMV\nwy5ew0tKNW9qhBz4evFmvJdXXk6q9v9jebIIKvwo78kc7MzqvR89N++15a7V\nmkUttA7QxtL5RcaPgZBkhV0ECezoELNNTakMgSkvfKy8Op7jHiEOuNHQjwCi\n8vUeU32vuhKhcloeHCv6fAOsIKgl57epFOzrN8tBlvwta4acIbYnj1ORopyT\ncMWMUNxIybFAr6qJJm/HuD4wPJPN3U20y0qZoD0bI8UPT3gUq9jKUayDyzCf\nG4LhbYB2QyebYhOXI3ZkFIUODjHqptQma0usH5VV8ys5b5IoMnEI5+cWL2fG\niz+OpD4kBz45W1g0Lk7WrA2C83ZfkNU5w2+dumXxA6x917IGwJ7krY/+f/tF\nW9Q0\r\n=Uhp+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+dux6V7cjA9ve6R1XRyFFDf42e96IgjJEtJ0ZdkxfIwIgQHGCbcjhJ4uhz44fBV0lU+bVVGCF1j2LfW1PY7hPXAg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.6a8b5cfc_1542137983950_0.12641537487622245"},"_hasShrinkwrap":false},"0.14.0-alpha.a4171527":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.a4171527","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.a4171527","dist":{"shasum":"f78fd9365aeeebabb000890d490ea2e63ba51e23","integrity":"sha512-h/MjHgWawgBnbsvu3LpzV8/kiF8pLZLZu+XRobEwkSbCziTCICx8rV/K88IAYayybz9gGV7hPJdst2JOeq1F+w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.a4171527.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb62f6CRA9TVsSAnZWagAA024P/ROjMbiRee9EVMxcDNKM\nWD/RN8HFkYUhhg5QFC6CLpnXlQAZpL9mIoF71bEwH6wi+uyvr1cQ658gY/Io\nxAivGwDOf/U5mWTnVYncNNjNmPSvSPjQ8DOH2piAeyezQVeyk3oa7OUm1U50\nDmlbPjX+OOAXZ2FLu9xgj42FwSquMiTmYgFnphpWtNGUe6faWaDOOE3V0o8B\nqAzAZzfkOmihTSVos8/wSJ85NblP57WurqYCT9YU1Jt0W+93o3w3milRbD9d\n28lW9LNm+z39VvIFsVBMHanK4uwRC3/cCvIYG6e1baDr6E9rQvvgql6n1PcA\nsiX0tlZH9Kf1i4c3ZppPun5ftFLX5O7B0SSj3yfOfLAHBLJ1ZC2urAn6fUFy\nbLhnqsCE8+Jurri74GZHjvtOxUDU5LBkS1lXAtHzgI5+FPu8N6fGIorcGN03\nRRIKBsa/fFAzdHTrnSf1vOUycc8GPYevLH2yRy4HkiThgaRd6BCIvUJJawKx\nQwBV69NUKpVDPufPl1AOXeeQ+QHxuJrmoqJsrzCOqsLexo5jgOEBfUx7Dj4F\nfVxOoxNljxKZcN9CJVXuT6uuWbPFBHR5wTicmMnU1bXx7mz+4KoYPnoaQemE\nwA3lVeakkdxKCkEfVjoxzCeC2A9SwD0eua7MTssoxLKWD7zZIga850XLYUD4\nyhLw\r\n=17Py\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnBKEhMbLW3ICF0gRt2R+0pvZeuKQ/JWLP9OpEV4CPEwIhAIVJclHYT58goMLDCXMseLJtiUP2Xy2ynBJXG9PnLVTu"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.a4171527_1542154233409_0.5681714533641491"},"_hasShrinkwrap":false},"0.14.0-alpha.e3d992b7":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.e3d992b7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.e3d992b7","dist":{"shasum":"71b370e8c12f72ba7ab957a62b3f104efacd652f","integrity":"sha512-yEnSVJJlijAzLMkPmxU8nfhHDNgBq9QVxLG9oiTxyLK+FwyACaymbXystHlUJRpR5zLtJs7rNS1nxsEDVNTIMw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.e3d992b7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb68FpCRA9TVsSAnZWagAAscYP/19x8cfxhYXcnthlxwKi\nj1qc0DkuikEMJJcgqE5W79YBn3Jm4LtluvRjLuTyw0Uq+ihT/ZaU9FhaTWdo\nne67bSEm0DWRP/Sv2XQ8UvkCYJPkT1nv8RE1lChuHWgoT0J32Aao4D/MfPAZ\nsapIvX+Lys5XjhX9BSVvSy5HKrFt7VBie+WRGtMF8AA2wPswk+QBDrzVzTpE\nuW1D7X8Mtj8huwwmEkIt8yOzLhX5JcOdvHZOSvPnqOPqzHj5Il60KWoQ7X5Q\niKjoX/1znvilSrazdFYR1wG07Y4dYeyaVKtGSEhzVKZCrHwe2zZ2viirutE5\noQ1Tfz7hQuxG35JSDzjFdksCqNfhyLm97OCAiyEEuKjr0rL5TvjqFDtxlmoc\nuTlLIpwz3WWHzTnegcS6sGel1uKDm1Au3GECGO61E2Nq3bXHdTK0L+7uZhV6\nKce2M64Rbp9z6ZeS7PjWguwHvDxjU9vbR0LndvZ9oksNqRh1UaWTVL0io/tR\nX5E1AExVCY7o0O4KqKjW4Ds+TJWaNX1zjZwqeVH8vzZIaW6wrIuN7WUdXHO2\n1+hYAjxzvDgo53PBgdftwouClQb6xU5NqxfkzwoExVn6KzJAWWUg7A6k/8ky\nkXr5fTGf80sCk1urMynj0/+a/T5QB02PNLpkuLWDjaf+LJLBisZGe/j/BgUl\npKot\r\n=aZ+/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA+5RrcaKAqlmdtyGY5pDqZlWZqzwFXUCiw2Z5s7YNPOAiB3dRmyCEyECERQyJrJGQXp6XBj/VQ4vr6TQroEX1Wr7g=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.e3d992b7_1542177128634_0.612088124135487"},"_hasShrinkwrap":false},"0.14.0-alpha.f3fb8b6a":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.f3fb8b6a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.f3fb8b6a","dist":{"shasum":"d50e32b30cfbd1619a1539c57cdeb529cf4267b1","integrity":"sha512-pGrHdEcybAqXjAegaXn6F1zZ/0O/monNSyP6laa1f2WaMX6BFzLuI04fsjpkW8LGpJ52Z9h05dCFUIwfl7q+Lw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.f3fb8b6a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb69k9CRA9TVsSAnZWagAAn2oP/0Fv4XfHSONaxz7Mz4Xp\nbrURKkTrI3LZOAkJkC1w2a/XfVimWwzam/3DgD4tyXEMhYhD/D4yVnkYvuO8\n7wnktB+NoYxoXz5lOoK/ECFlRYg4CyVKLkKFu/EUekYjcFvw9i6KqArCZywQ\n02iayJIGtP07JxUEFIQ+1ZpOtha5UFztK7Zn0oC2DMI4s5IbNdC2YC9uXE4A\nj3Wvg1PoVw73Nd5HWAst0GGI2FISPCdJuC86ZHYIzhLuoAd2GsB4w4175sAh\nIuSsq7ySf2c3o9GS3wpOBCcNkr0qHHtXukDeGi/UziZM9P2wRu+AUkrkrKu4\nu+Vr2C++plmqG45VJ1bSXEPYbP2Z8u1SeLKHJLDgBJnq+qttHlNA1HBghzAe\nvl1/1VUXmviTVvHoYK2GFhpJLOTYJzALxbbGBJAxgr0jFipXJup+woxpPRNK\nJ6cyjHLli7epVn9OIOIPYMyVKME2pmBdd1O+SFVNcfyR7BY4d9+T2xzSS/SN\nila2UL4b56QgDvmL0vvFLc5oQ6/F6fOAxYiBVVo1PNk8P+mxAOzTZdkrVIdC\nysqz6OnrB1FhP9oImfN2tkwNe7o2t11jfS6AdIKD4kC8FcEN3FCqilYjObWc\nok6j7umcGG/zp/Azn1ibGMnOMgF3XK/iRk8Pus8aUVqnz5bCvonD7SkhGfMc\n1Uv3\r\n=kFHI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBB5uaTFVqfLzcXxg7ALI+MQ7gTglZKjvli/NXYTXHOLAiEAvJp4qJ8PCWYHwhrbSc7Z0dg+QTyyQ+WqrJHWFPsYMqM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.f3fb8b6a_1542183228544_0.711444246991908"},"_hasShrinkwrap":false},"0.14.0-alpha.43914c30":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.43914c30","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.43914c30","dist":{"shasum":"667ca46f06e1c1feb77959334325daee1ff37e84","integrity":"sha512-zH+OlGDWM1g+VFlpRB1x0MjZfH0uffrHVWpUqWlfpGc3kYJgM/BFuo7pm0sG4cgmat70SI1FyLJSlCSsoPsggg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.43914c30.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb69l4CRA9TVsSAnZWagAAdOwP/3MXRa1ZDqTmDA80LNq5\nl+EmHES3teiDK/UtmjPvy8T8ZhM/g+mWAx8K3pfYA6FQLS+J25hekh5bb81S\naONXckB83UsTHtnZ0tnn89NzrxMG/U13gpPhoGaY1cOLzLlk8t7WY7xpksgy\nWs04ZcrBivT/Wmy4Vk8EzTRdIY3RJ7+65UwDSov0Lv84as2Eibninvf+Zpz6\nFaG+PiKUgE2u9xnQNe9rEvse94E5XNIvVDuJRQGhyJsIWWoxSd1MCbbtgGns\nov1vF1HFL0IkP5s41TvZm7GELFIRx6D7kojnbuy4Oi1rvXBQTkDeD6rC2tRK\nnvG8uRpTDjywdyDB8i63tbIx8tE3lQ0syutxKaJhQGpbIWZWlXRIvIhEpQaQ\nJGr/d9D3QWSq3YBBd01Pzrar+8/Rf9f2YH2FmxcES42ATFX6L7quQ7q0bz1i\n8VclrafctqfY5sQvhVQLFCf/duO9uUm5RFZC3q5Ysfn5c2cOffR7+U5qtw3m\nMer/QEPATbDw/yWCD27zIx3a8cPfD5rVP0yBMoAw08xcOA39+nuxfiatI8zQ\nrEZyWUmPIIlqJsXs5pywD7itl0ZyCzwtqrDojp7jpfMZkBJwcziRNVKD1Urg\nq9gzw1JFUMHna4N+ftoxdC6OdFdND3h9hLuPlQdNfspn660/V28A+5aoL1QD\nvIzA\r\n=yA/Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAMO06VKDf4heOHXdymg502htyCc4kj56YOrn4/s2z0YAiBsDFkJqGI4bDt/jgJ2RsFXw3ElrolWSjLBJU8Ls9T2Ww=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.43914c30_1542183287759_0.6127493502091368"},"_hasShrinkwrap":false},"0.14.0-alpha.b1fed58e":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.b1fed58e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.b1fed58e","dist":{"shasum":"d0b497a48e91a6cac13ee2244487c82aef6938f9","integrity":"sha512-nv+lZNnV03cRgvpaiu4EXM3yTTd2c1hFw5/1StTM5DobeuEP/pyNAsrXsFeqAMAZPmCWDUeXmNTQZS2g01SFTg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.b1fed58e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb69maCRA9TVsSAnZWagAApZAQAJ3gSMg7nUCVYUAjGqmr\nAdM3c5ObMlc4HfQ82CpUD12BHiyZV2+u5lsry5CacY/SvQKOe7fy6hVKzqfu\ne6/dwXYKFvh/yYa6z7WaTnIBVkezk8PVlf8Ciox4jjjwQGqM/hRQm4GaVAIL\nmbdWzSVQMd6efkLraVp/DpM2avr5NSdlD7dMKznZuzjNp3F4cwg9KsZtkwEB\n5XX6hvnot0e1Yhc3usKOvmnQMb2ETsC6WiZbtulupoY4RhQaPtz6gtmPJH44\nbPdMQx3DUsTbADatSUEe19uh6qxNfbU1fI1OjehRPjrqGiAD4mkYjU0ELb2u\nKPDLl9BaEJfElur5ekDUysOngH9B6Aj7Jb8r/HpE1BiHghfqXaRaYixtqTb2\nYLU80U5AXedWU7nbdxULLSj8pJsG39z2TPyhgs6T+pKTNlgKZFiYueHBwbnc\nkbbA/Ko99ETvSJSlUpGf9bA+7maatBu39bEMFoxvQCSbCE7WVjLJCmsolez+\nyE/MVCNtII6TBiIXvuiPH6BkIDpYg2JN8UrQ7wYXHr+/lqb7/Q5EvfD9IadU\nrfJ5FKRn6aaYveT0eaJxOvjmvVQyc645Chq6PuogVyF6/37buUnjz6ODfhGT\npHue4PN+BJ0Ub9wnKJ83VbW2DLKQj9aA64U73CwbJcwlL9cXSOQkHZnOHkOz\n8MYz\r\n=kZYa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEhfsTgL2bHemxnjz6RwmP6V5JiePSOpd4CdXFJqKhDqAiEA+/9WLyBF8QzXtztQGimW0himo76oEmweQnbI9WDjAM8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.b1fed58e_1542183322151_0.4864493300910391"},"_hasShrinkwrap":false},"0.14.0-alpha.0c5e69d5":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.0c5e69d5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.0c5e69d5","dist":{"shasum":"b8ddd16fb03c6965076eba52d88075dca5205f0c","integrity":"sha512-GmYcK+NHJ7eSr/Yq/zK1NHjOpgnNMrk2TLXw+ofGZzq8Eu5EJUEofn0UDlMltgPLqn+awkJYaa7PU1/fXZhz2g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.0c5e69d5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb694/CRA9TVsSAnZWagAADWEP/Aixv38DrwrNMcW7ter2\nXLi8gsA7Sg8w9u/RVVCnt63Hzeh2fTRy5W5mXDBQjgsg0JAISrdl7vx9GWVz\nKxspehF17EgvFbhoZ8OYoBQsF7TLL2nqn4Q8deTuiyIagTnS9g1xx7jKg6/+\ng5wETo2Nzt6dRbPlRkFLT97f852SKoK1rb3NrLy4Uz3yH54VoXMeMxN+KZXK\nPuaMdAiq0l41itP+OWM1uiAdZp8fY1kSa6svuHaUo0miqj944jmz1HCyXq5q\nvP21+sFfUI+ognNuHahDhg+lzCyPA8bvwrYNoyk9v/BsnxHCYDpY3JfOaN8x\navjC+F36MCtl4tsekiPIdXaReNn4tq+BpbG70sDogA62v1rINWl8B6DP3RUP\nxAiZxHbUEIHhO8LKz43ZBwTZjRTwE6RVrOKkmnHUCzhajJM/3bPCltogKSeg\na4fQJY/+BG5EgyLYo5103rR8L+j82WaZmAbkbFT8Tk6co3xuIjD3LiFsNUNA\nwnoOtIx3sUPdx1uANjCDX8Kn3rOzIz6w0/itkaRrxYrJnOobgFANlUYImgB9\nY79/JcTul0UAO8cenpQ/rtD6Xrg5sok+BJEWQgHCpgWq58r36L72ZmWtvFJn\nD8NqDMMnumXonOPkxlI8V2UZyawf1GCFPTT5v8PtvozSfdzUwlL4MkjnTMY8\n5W2I\r\n=LtAS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAphfBNtdKbnPb2IalAiOUT6xQy4+Bb1wEsONjAsJcF3AiEA9M8/S4Ap4vTLBW7wdw3oH9n5tE+4eHejFhY+DvhF734="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.0c5e69d5_1542184510981_0.02456028995521553"},"_hasShrinkwrap":false},"0.14.0-alpha.f8a39b17":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.f8a39b17","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.f8a39b17","dist":{"shasum":"b5919936400efd39d311b97e6f83b472d249e84c","integrity":"sha512-Q5wns8cEqZtTpYrIyMPRulbNq5GsAM/5HGIRFmX+DWEjRUdNW+xhYmsMUuHeoIkQk7kTEb1tJQ4QpP9ICDOH2A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.f8a39b17.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6+lCCRA9TVsSAnZWagAAq2sP/1ylrPa3IyGZan9rBUuV\nJLcuFJgdLO32/7Vb48S4S1jXCrAfTuxI7QYy3/uQW6HD451qEvPFxkqZbDjd\nkTRDO+20+gLSm2PCk6BnAa68wx2IWuXpEC3Wi+rX9j6pJEmVMzO/zNZ0T2A5\nwP1m7WaPA83UJfsV2xTElTf7vimVVTC+3xjXIqp8eR2jaEqBKFT0obIX49Yo\nC0mYN+Z70NILUN/9sggi/B6AqZSeWUQZP+nAZRc1EGUztsRJnRNQ83gkaI6Y\nke9Y9iBlqT2Ecr5jYZ1Sm7l6RjYR2nr/wnxDJL5LgiPEjNgwyusNRmqIqPz2\nEGUs9YTHDSCTgSI4J/87MgbXDLnWEthUnqnGDWI2GI2qmiPMGjFBwPXER1VP\nRes4uyOQ6HozoICk6FNjY+ziEIcMmKLpX1Ihkqh20FOkNE5Brn7ab7dJeuM3\nwbA9t34uIMKmGN8sgLIL7depHiFDhRVjw9p3KFp6uFxiNr90y8owIpQvio3U\nDIzo+3Y2UGJc1wUy/05RKD0pjnsY0jHa6qXIcwLEmrTm7eX2oUTY8v3c0oP4\nwazqtZuEhVrhdI/4R3mmrUQ7ICAD62FziYyfmDNyt28wtdO6Po03KqjNrTsJ\n/ZdyfOLACtIyQZqbSt5IsqxW5jYfi1q4d9DsqRDJOfZ2sCIWA37egX6P5L+6\nek4A\r\n=SU3z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG+4LQfVls+H3OTmT1EdJA/YMgsVWW4yIvgqPjySC01PAiEA6+odbltTOUagNmxSH7g19N1aUtdF4dlVk6kDoLRcV/A="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.f8a39b17_1542187329798_0.22321037677226463"},"_hasShrinkwrap":false},"0.14.0-alpha.4d9ab511":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.4d9ab511","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.4d9ab511","dist":{"shasum":"6c21b6c6dd962b7c734a802a343da36c568271d4","integrity":"sha512-zJ54j4ITJ3rbBASkqDc1DGw944YBXMrM4tY7SQ/26fbawiBD5IBzip/kld3d+D/irarJ3f2RiV1Cw2AjM8EojQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.4d9ab511.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6+sXCRA9TVsSAnZWagAAwwEP/3e12g+XjAZkvJ49BxKC\nIi1Ndf3/CU4D76XUxeORuiE5W4sT/6rHxQAqKcu9mW9pUJkYz+THUMbIFpnO\nYyzTccNtxj4G103tJlGwKrIZodFjfqj2h2qZfhg1ipBBKKRI9ganMTxbiFW7\n8u7AUq4xbv0/8WTUwVtt7erhm/G92/zqsr/374GrTD0E10l5jk7Cn4QkWf6U\nnFItEB+N0aDlrODubAaqeBAiJFpNdEd7UTGiMI9G1H5pSn71OLbpnmJN+NbK\nENWRCg04jn3DOwUUj3MU+SkSiDl4pVYA0hBBWOKPUhKO5heC0hK7sayGcSYR\nOEZEiBTCOvqX1GmQJf942oTiNchbV9IYPzKYHxdIeB5P7L9YUsWzCSpJ5C4x\nxjf24K58idJ8DIOCKne7jkvdSi02rdOeakAKsQFyAYv4YDDR4gsAAr+3bR81\nAVhZdJbc1pLeHggJjJMc2x+2BtYALb49DMtOECujTvWpEojp9iXOUjPQ8xqN\nx8cPk8wAWTk7Pq6bRn7Tt8WB0XKANGPchGzeNLt8O2YLCVtzsjRdPq2r/+eo\naM/jtTzZcyCDq2R/J6FROfAKNWpCcAphT/zs9lBnXpwg4y1o+XiHc8aj5Kc6\n84OoOLNcJ0nTm4vw2AEmtPslPeVf4QvUuTfvBeqvjAklLE0Hx92m9mI6F+Qn\nvWdf\r\n=UPK+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiWMf4llESQ8NeXPEwDSwP+zPLrhJwzMlq+W0zfCxQFgIgWUvxp15o0nAacpRqJvWzLNqoe1aCaoFM/cRuVhFX0RQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.4d9ab511_1542187798982_0.653739440574268"},"_hasShrinkwrap":false},"0.14.0-alpha.245e1729":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.245e1729","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.245e1729","dist":{"shasum":"9a1dc641936b44411be5cbb6cfaf6d6ebeec64e0","integrity":"sha512-tiBjeIRQd3QLp2IPEI4huW3ky/bFWwFd/RmZ4Qjtmhr6hzn4zjw8tXfH9sy2Wn7ZtYy2r/2hlnq6zPSlrXfcpg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.245e1729.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6+wUCRA9TVsSAnZWagAAsbUP/RRztAqOJkqaiL5eFf2o\nHtBl6cIP1EEBoYnyXxu8AKdi4I2g0USOy5gxcyUASxgVDbwhK3le7WWQWDNz\n93x6z7moPatFENimGstNwse1i0+eaH7O6z26hveO3zwuzfDFYTGQua8bCWTa\nmgTZWMSiKZWvkHuZA3btrr/8phZYyPIXQE5HyD+JstWQQGzlwdKPthFaGYnm\n5m4gR6yrbl9YP/zIZRCeOLN1l6Bl5UzxiLn0+vhF+61xMg1QlSucUjMLfsf9\nXLosbabNvOWHlw/ymAO7GBGLeKpYNELDvRGoiZcgqppmbiNrGDPsuilVCEYT\nM/SMzv6Wh/t5NP1BNFrhPc4v9ZhKuYQC1GxXs/v8UmYmiCHTuhpvpcyh+8ZO\nKiwNqvllhZlSjYWW+9JnJ2bvjVtgw+bI3KC2Mz+XBdZmefELIH73pq549U4G\nayrplgeL5fstkuvuloXFXG/DfQ7xD8R4/qfaRyNz9FhqM8XOSTT7aN+6kC3o\nxIk7an//v90wWDGGN7fB8CfReyON1v1jpSfnLAAb50/2N2VrCTriHwI9J1VP\nzgzH8VNLJqfhl6oFmtGVuRe2gsf/6WOrnIiMxlaVfEh7LXGl5BgUQrG6wm/B\nmXZMfZWRtcI597gFV4BIf99Ctbsq/YraCFqs5UoVdKafw7yWsvhRhcTe6BV7\ndM8V\r\n=U4hd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEpTepALm14JgqEulrMUHwLv2DwpOAb99Jg9GXmjRDhRAiEA7ZgfskrTNrvWkSb28mi1exBjtCuj09QYZYqH64rkRBU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.245e1729_1542188051878_0.5378141401254408"},"_hasShrinkwrap":false},"0.14.0-alpha.cb4cd223":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.cb4cd223","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.cb4cd223","dist":{"shasum":"63e40812eb3c2021df341257854db19cae88496c","integrity":"sha512-8Zp9u7ZEUsOGu/QBJhpQ/ErumKGLoxPj3l7dXkJ0GB88wlOhg/W1+hX0unE4X4U/eRvwCMwP5ZcWn2JED5qvlA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.cb4cd223.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6/FsCRA9TVsSAnZWagAAcFkP/2iyg8GOEO4zv1AF6vMm\nK/h9FOmuP9hW4emXJYuXQf4z4NWKJnPjBVBAWzpyhw278r0L7gRMxKm+esvI\nzY+9mpgkCO2vzmlum0fodNdSwHuAfnwuTW0cryhMuIViBlRlA8jeiEReWquK\n5vmb+9ZzQLd1CAdKyXIAyREz2iiCmUd2UX5k9wSX+QVY6XUEFUB3mgdXvPba\nbSWM6vgxuziQCy1FNJzQKToJINCWH+e23sNl0FavmDFYKa06Rsm0d1HZwtbu\n52TEV7FhE/zNvUzR1TmCGgPtQ/tyIZgb7uy9v5VDH8yIxGZyi1sfR7BXiipL\nkRkltivwOhnZYxO5/C3tWZ9KbE9uPospm/6QleTHOAfHLLkdQFuIKT6JhDvk\nEWaUri/ABSoIF5xg0W23gESU/3DglPlFu+4XJsiYaQiudCkFUJh3Mw0p/uCD\neU4O+ecWzY+grd1z7jPVgbbT65X6Y2wg6pdMaN3l14XsTJcD7hdRTtmsHBWz\nEB1T0z8flYG9BNLeYV3QmblWB6wsQ1xkgn71OCM0haxaO2OeJc2gT+Zbuogg\ntFwmFCrO7QnkdtC77hmZktCZnTsCa6zWY1GPUWqyJGjtV/twoNHLdo30VPKN\nG64cpnV0gO8FP/8ZmkeZ2bWZyEDVwB8eIngMPk8m+AqlwZtvKDzMh9SIsaFQ\nZ0rN\r\n=CK07\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGGUpX6PG5dTUqgBZhYbZaoKYsvzmJX/fI2Z4a9h12nwAiEArLApoXunMMZbTR0c2PIINgSZPkBhtuYG/wJkpB9WPxU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.cb4cd223_1542189419836_0.3986388942963355"},"_hasShrinkwrap":false},"0.14.0-alpha.2ceb8e08":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.2ceb8e08","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.2ceb8e08","dist":{"shasum":"22fa7f578be20fda2cc212c6b33f7902f77f036d","integrity":"sha512-30qtGgiL9c3RJkpZHlOM0X0SBhJ2crcVaSXY5wV3ab6x6nLEbrriBaFW1BzS/ScP01+W6laFZ0yjopDqcttunQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.2ceb8e08.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6/G+CRA9TVsSAnZWagAANXgQAIMMuPJhYXTLCgrMFqo8\nF/hjFMvNT4CiS1OxFKdzo1tIwL4btzoWZsgQQFwoNuiXLepgRjtPKRFJts14\nqJj4VGs7/J2AcJsPAob5+SHw07y5FkU9cuMbMFvJw/9FW6crEKBx2XoRtd9p\nufq3d1y55ejvyk6OX5Ja30w/rWTu6+pJ1dGF7lIVF4ff2PQn1X8y3n4jf2qb\n4HJf1nYh4QJJu6+8t/GdI6S3GpsTok3htUo4hqYFEBF5yK/nHAHZsxcKVXv4\n4KdHFVIJQ4CVoAf4+X5gKgj0bfMg+HuyqPDbs1gXiqO9F0dLMuFRs8oKXX/B\nD2L251hyjrefold6/XyDJllq1Iqt5SW06qD/YC/warjdaWoyDwVk3XLWBJ++\ncprAFv4vzozgg6Cc2+ioHj9iuVcrdtJILtnk28GFsiKJdlmFBUDq2DVeUH9l\n/dgwg6SeUy8id0jD+TljFexifbuzJyjXfo5OVH2U7dXlLmeIPOTSeOic/cxN\nwoqJz/i2aLhL4ieX0c2NbFQadnuxhFlQV0YOkJGfnpNcjfsuZeWbA9L1e0gB\nRN1jBZA+VAwKsEUDHm5GwE2SUPlRY6JMQrrfSFZnhuyJxTVcFsRskVyDOG3H\nQFuJ8GX/9t3Hi+bcC512s2wKtRca1TA2va08mSifKZv2fFvuy2baNfL/DjsB\nJRo/\r\n=HmsH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIATK7juI0PCtoz78+XYjHYfvhefu2pXid0OK4IAq5OQpAiEA0NCa7VjSqgnVXE1OJURqX9qHKeUY6osa8dv1wYLRnfU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.2ceb8e08_1542189502063_0.929000940903669"},"_hasShrinkwrap":false},"0.14.0-alpha.624d9dc0":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.624d9dc0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.624d9dc0","dist":{"shasum":"cc9d91fa4a71ecf9952e449e7945ecd14e280f72","integrity":"sha512-I1kWgiuL1v9eF78q96bgbTqdut0HmspkRgkm3Lo9n3uD3KQCFJ25n52kE0EC4J+ZfrNg/rHHYF6gN3pLzNkejg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.624d9dc0.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6/L5CRA9TVsSAnZWagAAggUP/RrKQkPJFTNBECwRA2Bi\nRFxNSNjpTNZVjnZN3QyVrsScbCf6d9FZgx4G/O2cZzwBpll5t9ceItnFT5+I\n2OuaYtVSWVginETqT2E2vivwhVNZuFXNcS7FYmTlqMe3PKZ2OIuTlUMCFgjZ\nF57eTRk2sOWwqXhLeMQ/FLkqG35civN+l6MOqZIHFSDN4o1fwk74UzLAKO8u\nskaulL1vJdsoZ8zryN2p4V+iHMAIhx+o99Tusk5QpCQHT8/CmsH7Ow90QJ4T\nDiJw7DQEZVuANmu5i/bsYFAsvpi2SwoHimvYQEYLsV852+IuTZ1g1vX8TIr4\nFa9OSQuXguc1jV6hzwITWHES+pVlXSoTXR1Crg59fwPDsFwuOLl42/lspLh9\nOu5RmHJY+WL2+j/xayEkPJh6QNybN4Nss+PpJl0ZmGu0oWze2Mkes3pzXWC4\nA0vFW8O1vzr/8jdYdD/w/qtP6xa3PY0CsyeLX7rZRfDo21mtGXNy4UUVKKZN\nV+Pgg3T5F45PrLXMuZiPdklqOKbo2ZvLAu6sN/BdKn+1KjnwAfkgeej6PFBh\noSRE/ur8VGsp6LoXUCs4PtRRd+KEPbdnJo3DGEYUttm334u1a99rpeMFi9Df\nX9k0Rlk8IfDiHaNpD4MgZgbG6dWPeXjhHoI91+Hx7xkK7BYnya4gUdxZ3yPp\noXai\r\n=xzUF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG7y+URKRPqvmgD1nDpXZOithA9/HtHWTCOsIzFJf4YsAiAsPAfoqoyDMSY3bu5L92cw1C1Zqz7cUpD5vNupzdMIug=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.624d9dc0_1542189817110_0.3576094558408214"},"_hasShrinkwrap":false},"0.14.0-alpha.318c81c1":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.318c81c1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.318c81c1","dist":{"shasum":"5c5a16cce2eb0151d0daf6f0d1e4f55e880c2691","integrity":"sha512-jm6OElD9as3LO+QmQ4UgD8bhMkk/sVomtGtL+daIHAKV0qfZSoidek0eW7n/LehUeItpaD8WlX5AhsfbD87/fg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.318c81c1.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6/MUCRA9TVsSAnZWagAAvhwQAIQiHo+7WOGd0fp2qT+C\n88CTisASUDMD+3gxQEdFU17Eqk4id7eNb/jIS/fsW48IKsEzsTSve/3pA58o\nEkhuTz49Azo0ogMP2ipwAF8nzg/KdBDHDvnsvZQ1S2eqW8aGr0xNoqRzDeii\nHrFTqDpCQTCY3C9rwasba3eAr8HahZnsm5NkXTnVTgia62cuo/NdWqmARVHU\nuPmhOj212//WGdJAc+MiiNvCUbP3eOsWUPOrgVJxstR/llXZH1nUBKLeH+7/\nZRmQzxaz5SU/YS1GDuc7TDR2UakMWp9GKO2U1U0g+71pLsM3m/P9rUcRda5K\noy0646uB0AfLJRo0Zv074A1Qw8eeg8SY/lP0ueiBOtKGA1Li2rk1FJpRH1gA\nrkjFQwEj8RXpqHUsW7dF3r1AyKrtsOHxmAOAX+MgYqCsD8sumwJqbzv10Dxf\nzDFqqtKXddOxqo44sKWX9X0Z9oXpmnduFlW50v8ZCsMZTcmxUzMVaegq3taC\n9bCDxxmBdSF7rAnPociLU0eWXeSeAhI1NxjS2c42K/KvzWy0IGT7bQ0TGeM/\nXIMWHlO8vtURoytkh6f5ZKI71oN+dWG3G8g7YUp3Rgz2yNYFL0aiDsJlh2f6\nzIzU8hjkyHWt4utVlGRAHbcsvMcVnlJg+S3fgI19S0YQIedLeR3QyXILSoeL\nPDzx\r\n=zbh7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZrE2gB8w/Tf/9CUbZDqp8kT0aNXD7zKtkK+4fYNF4BgIgX9QspPCl4a9HbaL1G7fk41Fs/iXt7mwg/0b79c3fo8w="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.318c81c1_1542189843443_0.11137849144994383"},"_hasShrinkwrap":false},"0.14.0-alpha.c7471403":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.c7471403","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.c7471403","dist":{"shasum":"5ef75c099852b675ca7824f7ac67243424169d6f","integrity":"sha512-pr/bm1J/S2o0ju0ZpxiA6O5gxjxmPeLbZ5wz5Fvuwjx+R4eb+x7tppwrn4ovSh9XklPjahDcufrHfZU2QcKNvQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.c7471403.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7CIzCRA9TVsSAnZWagAA4uYP/RpJF8v+z33Ow/WjyDJd\nxx7zN4PDBYo08XnGBVsVbOG6hzOPpvP5swnbQnT8KiXuqdHibcEcKM3xdtG4\nyZyRboHgLuE0nLVVMaS60X3XvRgopbfoC03UmMw3fjX/gnd+b8HZjLWcpe5b\nZxAQAHwUNG+gI+D/TIr7D0mhS1f9q9b+rv8SDZ9wnf/4Nl1MYOvAXox1MPci\n+G5BVtmVdHDjIHeygpodAJUWawP2db8blW9J3BDxrZH7m+eHQFAK/lE8f+4N\n24NFUKYM/5DRlYYDw+CTk3v3kjF1S7NyF2CfXdpehZMW/E5cjXIfjBd/WY0T\nnTTJz4xpB0Jz4vqOe02WgmLwSxGtQ55iugg1/4nk/+L69mSG2Ft5CUIZmJzi\nMZyePBxD4ry38HEWAtBvTqr1JD8de2TTW/2AoyN6683AS0sevAdIo8rP/pFU\nQWMMAs3SfsyiEG2AntexUsrOhqS3kUcHk+RB5F/Cf8bYC0HJltJfoSfEcKvo\n1LAboa9T1aq6gN3GmlAT1uBWG5fbtX/Lx4649t9JbuG+hYI6+EkcQt8MKkfJ\no/LwgC6POB3/e/MtLkut3It8GoJ1q8TAz4/M3ofoo3D7mOOGWWnEK2o6UuLb\n1pI4YELb2Znp+fpAiPiFMDr09H0J81vQj+BS1NL+Qm0GrP0JUZ+a+yEUOfQs\nm9XU\r\n=JHCT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHyse7AkC2+TgyBLrp+YfS6802aQivOFcmj+9NQ1Ae+4AiA8b2497SgqEd2C2SEUQCGCP6bsUDs0bmGMtWEbXRru6g=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.c7471403_1542201907272_0.6471103739728219"},"_hasShrinkwrap":false},"0.14.0-alpha.e0b68192":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.e0b68192","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.e0b68192","dist":{"shasum":"42413c72e261c91d4ad35f2e879c215cf73e5d53","integrity":"sha512-HbelZpKWPYyD7H+TZFSkovhnDaXwIzTYICRsETX+pm+hyreIG1XOAoCiDoklNaLYapeSRGvE8SH+qylPn7Fi8A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.e0b68192.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7NmMCRA9TVsSAnZWagAA76MP/2c57cjbnwQVOwqtaWdz\nOCFDpmgP7TGHNXdTRN3XJzIa34/mlctrGet/8n/mEjhp96iPmQbqClEtrZpX\nXUYqbD8cbkHfp4DRXBDEoiBHkRZctzjMKealWPE4zvQbg/rEb2RM5S6x6FtG\nBMCbsG8z9oV402riGQPi+2BFZNPEi1uqgDX3qOQgjDHLY9hsed2KkmkphZfb\nUu6ko5D8PtT6oEJqEl0lks7RlHZojrp9BwIUKWBF/vQ38//1qvs2klsMXIKx\nUmUAijXn2VOJPrWnTLt8/xy8X74Li35LpvBv12lPYHEg2gOrc8E+SnUvyL0t\nDc+geT/rV/8i3KJ+8JLwRItKQ/SWEDUorQwU3KGd0v6uQkrO0bNWaj4j+K20\nDMkE4Sks/LXupxQ4E8OQCIbcSVSJ2zJggnaPUXyHfDdih8o4A1Spvjqx7921\n9mFZF3RqdQJxqrWztUH1O1gGmG8bXzQbUtQY7pNcjvoX5wricPT3yMFyQmBg\nWYNXQaBi3epoCg9gH45TwxNHvGEZlTNZ8HgJhgttVYzNp6uA8qUnuOne990x\nKVpvby2w7y5YU0UVrqrY5gAQ/N+vYqlBx+9ps+AKrdry8CL5q4U/ILRJ4JQk\n0nntiXI0ZmdDIgaacG53y332d0eDqVOYIZCowzUJwpBrnqa4hyoeb5G6tmP6\nboGo\r\n=fGNz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHds+7k8LE/7g7UnHETrLx1XWiWBelml33kxFZECm8f2AiACYKBaHgUtAu2V1QSUmQbLq+gjwifpbkSpjWiu4kuS9w=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.e0b68192_1542248843584_0.37498931992875395"},"_hasShrinkwrap":false},"0.14.0-alpha.6918c68f":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.6918c68f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.6918c68f","dist":{"shasum":"fa798bf6a9032e59a098e54e7595b84c15b49ae1","integrity":"sha512-27AvQuePFaxZto6AmlY7HOpwanfmD3Cf4SEEgB49UOvaivpbpxYmu2m6zsA8l/FGcUCZOTT0Bek5qCjzdQ7UUQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.6918c68f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7OCFCRA9TVsSAnZWagAA26YQAIGYwc+Pqo1OWfmAh14a\nru2xDEzV7Dw2XFHaB6CHj6YVFARuEmxw2UpyXoGmMnMt2arSg64DviBrjkoT\nCh0vxZEegyrlWdqan2PXtDmk3gc8CvbE6trQml1ng2s2B+uDjcarepYwUlvm\nUQV6dabAGz0neoVJT5ZeBw94tpm0obCOfI8Zm8pp/Sqj7QpRSmh0whgmINk+\n6I/VTGXZN4vXhJOVRKL1IeAAS8UiKkbCsXSE5SiKY1cu1H+/X4utOZXqXclx\nB8YeKERuVdTuXXxBaQzPxzk62y2945NF1zX4QRvarjec2soDiHpUZApWbLf7\nIurzWSDKUNAvQ+2uYc6ATqCk1xsSTRYXrxku4kmsC9cBS/MEEjnJSWAWieo7\nQPFuK96+ddF8F5gdwR9o0LDZQ6gqwQW+7ffOllSDLlbkJp7On9adTlovbjLm\nG99eljDmPzcJoDFpLB32q59axd9GiEzQa1f/+xScevoO9peTGRHKhuyrwxSl\nHK98BuTJKeRhB4UovTzNpfjaINoSbje1HzJjD1B8kth54s2kx5zTzphqSy5j\nekbQnsND8lC7et27ZHMR3jBcAEGh/8NC+rduxvxaCMMsNaAv7C/t9hljEvrj\no63GonEx65fpmNCy7RMyMKCi0WoXOcXpRRRdK7reQv0eFNFkdMC2t43D4zDv\nFvUO\r\n=4e3l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHqF2ZeZ3RTed4FlHtDwy5Dx9+A2FI62bnocfcSuoizNAiEA6PhEXrQHIgF1L2e8RNMtoBmlt3eRfbPYtLiex8R0Pr0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.6918c68f_1542250628441_0.24783787722692896"},"_hasShrinkwrap":false},"0.14.0-alpha.ef29b5a2":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.ef29b5a2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.ef29b5a2","dist":{"shasum":"ae3f6f2acd2f7b78473c443788fc33d765152c99","integrity":"sha512-ED7ppHnQ8XV3OIgmT15XiipjqUo/ER0ENzSRlyJqHKD2Ee0+DhDbnWrn1k2umwSBMlq0tCTO76yVZf1ioWi7bg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.ef29b5a2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7TaVCRA9TVsSAnZWagAAuSUP/juOFhjAilNVnQpGwghp\nCPmIVki7TRKrxB1bqSQ0mykVdZ5aphqtE4+E3sQOWvR7mrCj8XOhrTVpVKZQ\njXpCxeqPkKfBftpin1cjppMX4lGMTnI71IrQLQj/FaSrdGRDGzdeJclY2Xs0\npM9bepM/ItyQrciZKrAzaFWM1RJ8Gph9P6teEGsp+ItBAcK96Grdxn1FaG+i\nEGqE4HYnAI+iUjHVzPpVEjsBMjuP3ZhQSEa6w6PG+T+ZlVE9o7mdy68I3H+l\nkLLP0CKh9A1hC7H+3TBJzqCwEdj5U4OJgHiZlT97i2nQIWJVwNerzxaVywX3\nLwyoEFohhMx3/Nx2kqhUdRKAqcAmEuyWxAH9kpAhrANiounzBMp87vFVLWrV\n1NHUEuoDkXaBFIOW9JdnAn0uUhsMr3yyF0N4R/qqvk/cTebhPRcv5iWhJljv\nvQnGFzmtHbtdnBANVq8UhEEjHj1zRtjtQqInBroMrvijJsQ7513gBTq1bpO1\nBqTJrp+xU0ItZvgWr4xMfVOzkuCoeWslHQNJ56KSenugNF12XWAXarvVgNN8\nKcf0Xy9cwNI1Slio1pDOIXtVD97UtVDWygWVsSmF7STgGDTIboUCz9QilK55\nddJS0OO+kMN94QgzuOKuv3YjzVsR4Kuev41sx+eNIPgNd6Tk7Up04tNrgEM7\nvSFF\r\n=YF//\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiRqcKDqnKusIJNddxTUKQYLTlLsfOtAlEO0+GrDJg5QIgUrXy3Jz4Ht20f16oIWdnNOZ+IUSXV4mxPs7D0MO2LH8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.ef29b5a2_1542272660985_0.502010343323354"},"_hasShrinkwrap":false},"0.14.0-alpha.ad8b70b5":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.ad8b70b5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.ad8b70b5","dist":{"shasum":"99e6940ca3ab6ef463330f47e42126b9041de87f","integrity":"sha512-r1u2g7DwdeV7ano3jG3NbCq90UVFyi3L/0AlU0mxpBGM3ycuXJ4hIqHjfw89XDmWt84NaPvqJ6STVIJtwAaBlQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.ad8b70b5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7T0HCRA9TVsSAnZWagAAveIP/RWyiQB8vEAmGXL0CZz/\nJsGcYHlvpF5pxkF//0rFNWCFfAFR/7JyqkIk6UDBD/6FiP/oxiUlLJDCYaaa\nXhlstnEiJHVAS0vhQuHCNn0BtpUrtR1mkKhPso3Wk227M0rPDY0NRgOZ+4tI\nfBfKCat/2XTaFvpE8svIoUvQLZP01BiuCvt+o4QMOGOrEapyBSxuw3DNToVT\nxzg7R/n7qLY4thwwoj/yQGWpZuXwwnl9InV2MzduvbKYPMhUzm6AYHydIjqU\nHpD5V6Mz9rlWGOKFHGPgNfdnFgD+rXmqzrmoBCr0lWGuUWnRHanz1iB9b842\n+KcGjmQwhIR+JAGxr6GKOVH2jUhVq8ufkitMTQ4FLEJOeZ2Wjr3uZLeYUQTK\nQe9bkqnMqunmWqAYVFYtyJ5fDpvZc7pCyJdg/kGKNmmk1jCCRfUF08EaVpjQ\nE2VyuLGk9G4kIURpuIiihsjpyPNRnQHR/HfGdBa9sFlGZGqwEqmJSO2mm/TW\n+vFlo6fwJ1UgKQzT6MwaUjb7nir6IBJUmIfZTcildJlPcJFIgt9LfqS0F/+M\n5SOH2upvBrxM8/vx7dAvFq9rTuf1ZMfpP/0Wrwp/daisSGcwU1DBaB0x1+nM\nLs8m9dPQxSXYXZotR3xqkVvUCMyKIh+5BKW4AM4wD0hwNrCN7ohhq8B+S1Sn\nvxun\r\n=hFPC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEd2TWikNuoRb8Of0tOYW1EwxjaYPOwuVWVauV6kRo5FAiEAs0ou9f4cyMilwXJacfSPFX+ix5885AHEcPdL6GWX3BU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.ad8b70b5_1542274311075_0.1344345731605261"},"_hasShrinkwrap":false},"0.14.0-alpha.79712f95":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.79712f95","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.79712f95","dist":{"shasum":"890d16955aa198da95d5bf3dc3e377188c26f7e6","integrity":"sha512-Yq/nYkX/JI3ZPr9787u8nlGACoeEGOJYXY+oLKYb4vVfYmBLu6kZR/i5ALHpFdy2vHE9zDVrQXBec+Pq0MpJZg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.79712f95.tgz","fileCount":22,"unpackedSize":17842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7T4xCRA9TVsSAnZWagAA/vsP/05sKb6wlWC0WE9NSTTz\nB2o2LbG9yLhzf55eAMvkXKHm+xutIUkwD3Y0aQXiBpLI0bjvz3IECaGBlA6m\nL3KVde5weYO4EZxr2ihJAkzI8xqDRAENAx3vNHET6w51VOzxSIj6G2akAXzs\nf+IulJvjlObpz68C569zt+NKtZkb0hqEdPJHDJbQEpibca+UGPXoYY+EAMdl\nP7XQY8QR1zIbhFwqnNg+MvDfz7wu7en9yA7EhvF1Po5ajzex2I2XTqfNZXIg\n+Ebyma8r23avc9Al2umuMJpw8y6SpCAcFltSxl54QrZv+NCtAvphNEXFULSR\nwJHqF2kVZLYXAKfbMXG4Eh7N3acoxxSo1wVVP457ZYjzWCjRUB1U66iMBZb2\nGO6DJ304bB8iRNM33D25UcXiyhtupH0f6SBt8WnNwI1BK8IOQPowDTqTkytS\n7p67uddAtRtjsPYlfY5e3+teFxDhJHrPT2saafTPy80SV7CBRc9/Nl0TLrTV\noEcCPAq8ifKjPRwvzo0vmjcsLDAs40vLzRw+3J8xsH2Qq47w5zX3IhMbn3dm\nKXmXgqnCL71ni1VFqscT2c3qDOAuxT7Ay86pe/jYGMEtglYnwM191zFER8VL\n2i30UMpwk82mfZTNb+hDajGPTMH711Bn55wnjrTaa+n2JfUrXoBGVvkN8B2G\nMGOg\r\n=MbqI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+dAaiJbT3n98++vR4T4p2HzHALpqw26lQq4dUuXm3MQIgdmMLP6WnUW45p5yn8JuPlx42V8E1F3J8SL1U9JHAe78="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.79712f95_1542274609168_0.2516226694591004"},"_hasShrinkwrap":false},"0.14.0-alpha.7868be68":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.7868be68","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.7868be68","dist":{"shasum":"9eb1ebdf8de1d554597950018c67044f458ab836","integrity":"sha512-26d5TCjaxHHh6TlmLBj4p4anEnBe6ZTHrBV9USdZ0sIyw+JUyQmrk90nEFbIswee2nZQaZNSmObY16h1+MEqEA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.7868be68.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7T42CRA9TVsSAnZWagAAwzgP/RIUpKV58zPByPDrdb/e\njrgSZh5Y7E+EOpRhyoWY8p0fE2+aysi9brVme88SomTfyLd//hGc0QJmotJU\nX3R1IkfLUdc24ubrsklsbBgMLYwwjUfYWyTZogSONiUwoQrHEaCISOJsXa3p\nfclZjA3Et7YubPIhuE0RBhTHU0vWRklFm2WCo9bBGawIjvTTwGW8tekVnm35\nHaVWeb9ZRezOBKg33ANf6gQWYPOozF1ZEKU22LnLnrSoMPoo3Dcwr+pneTBd\n/zeD55rPrAjK6h3DSTCwxSbFuov2VdwriH7X5WiqCSP72oPbZMlWaUa9UE5J\nek4GzJVwyUxE6yH9p+Ezx+lJRWdR7va1NF/NZRvNNOgXUy5xIBFzo/ZiNK7x\nCYm8uM/3D2IqIo1qHkD+EUobjaubrrFWLcflp/EBZwJpp1zuqXKCt3vV1U94\nKqHMseOBvgpZM3PglVli/t24tuVqLYO/bhV1YqOes2TUda84XpDTsU3dZPsX\nrm/yPoNnqepFQpSx4TKMSg68kmgdl32tvTsRzjqRMR2zfSkXihCn9FY08GJ0\ng507UU68FGLpfoK81l8Y4xf1ho1L46T17kcgwKzlwelrNquL0cfYF9DCJkza\nC7Kj3vsFPNQXJcsU0YKvb6g8cpXjXBvrFvilwfAN3i563qELhkmTuVVUwSvT\nDS4g\r\n=akNB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDa9G6a/eC64QrHAv+Cg9kfhWALXBjMyYpAsRPfRHW0tgIhAL35jiTSrn7J5rS+i9f6wtMvtHPfB/ygYrktUgSywDL6"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.7868be68_1542274614025_0.14404057544136695"},"_hasShrinkwrap":false},"0.14.0-alpha.dbdb6a68":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.dbdb6a68","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.dbdb6a68","dist":{"shasum":"ce9082de1ec33427b7bc31d8356a0c103b61960b","integrity":"sha512-ctPiQvRJ8cayircveGFhhnpzeSbJnBjK9+9QHlTS36deOFm4WaKw9BUDwqL6WAW0hlkaoMF/TDZOAkrqtMkANQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.dbdb6a68.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7T5HCRA9TVsSAnZWagAAzNIP/2pVn97evKiBeSqF9eQm\ntVG5BnXJbTimHs1Ah3c+YTGUQPAk0JTZOHvbgSEPT+nBEt7H2ZzehW6NSpfq\nb9cn3XdI+QPbhfBRYjg2SLR4NzfpwUuUFvbsrmQW5vs/gnSxNtfRGL0RUeoX\nsZa9KRshbmRq65EOkGkQP2IbTeuKI+QbMUGPwoEWhjqhFrBy1HfI1B4EoG6n\nX1vpkt1LgIs0qyCor1swT7eFLttUBJLIrfgoroOluaXcYwPASM95qw4RFxFB\niF4c7JaLRnDHKOsnUTj4bvvfGbYwVsvaMdp2x4I8NxgnM+hswHmeUvsQ0aGV\n7owBy9+dabyM1um6iKOjfKc/9oU/A/FXJx9pBi+WS8rtNiorzty+iJQuuCqp\nLLbrdTbV6cavISDp2spZSkbZwrd/wOhhPKfcq5ClOx6wyRLD4lBB6jEZ8z76\nr5QDKVYj91N50TztPG5RFb0qdH/3vfvYG+ng9m8hZc3z2RzomYppbEIFjnLd\nCjlWN6bdKQSSl+B3o2EoNZeqqVzd9Fjm0gziWAWmkoCm4DdIs2ZlDLxsou36\nxmsFMqZvR4isfjkqKsMhlIq2fjpyDD+JmZPQjT+T7vvqGNChvk4/PeMG95by\ns5GHJrUNkO+kDZFXgAZ+JQ2U1LsCiUrqAdrBqa118NKfwUwCJEp6Cq/kSqyZ\nTbEZ\r\n=3TYO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHkhA7ZEKc2uX5DVowjLMe2r9kZBn5TYpV0zjvGOEt5eAiEAnLRoZtUtyQtRqdPxWytNkK/nRWiuBM1/NRgBZ+lkAXU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.dbdb6a68_1542274630647_0.8300219297841263"},"_hasShrinkwrap":false},"0.14.0-alpha.9430727a":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.9430727a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.9430727a","dist":{"shasum":"100d0e952d70058a8b331fef2b7d4fd349340f2b","integrity":"sha512-nvrT4xfZkF67LPJDBUvGFZ6FJXzFZ1CvMaB38rHAgMlrZoEpukKPSYL9BOIwIxW4b1Uwq/dTxfckGzORZ81jQg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.9430727a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7T8GCRA9TVsSAnZWagAAfAMP/2+wxDzLbmcxR6yizCkc\n6PX38pmxiHDeb/247VRgQPk8CTQvDoz08WMA/ddE7vGhMHVdBfg2UTsyiZai\nD3kZGXs0OXrRNFn71uqGouyItzk7S+Fx/PZUt1GPavag5lgedyFkuEC8oemX\nYTPFr8jA+ipEY7I+7O1EPoEg2wgoJZCAY/Znuu/ZerAnYMELNm6GmTK69/Hu\ne+NBmGPAuz6/YBgrVris+O2MYsfsBQpNUoRGkbQViMs9jwqpREpagechjw+p\nhc5qM74DmRi6KJMTiNzEYbEJURJp6+1BNGG+5eKlk0hZMBceXfo3xN1FQVI2\nj3lq7/q6xL8jLbqsxSZ+qXAr7XhWtLYhsv8PoZDOhU9Bw6TqtYGl4WV7cgZt\n2Tre1w9Nf2GC59ufdUT04ws960q13BoR5ABMBehbeqG81OwwL6Lc3cIvJNEF\nk+Uml2zch4BQSaznVJPACZMsB5Ijt+yN4e3sifOxAHWPVmlb2rIFWSwMQ/Wz\nAAWMvR4m4rBwwGbadNb2Ghapl746LQrDbJht0N+cf9bgdP5K1hm3ADNI1mIS\nlZX8HIqwqrKM0EK1m1viaFYIvpztcgO432xyluAHSuxYLYQqYLfdssOMuvVN\n46fm9q618i8rwCEyxyPeqrjs2toyHbLyeRH4hYtD0yEdjZXNiSK5bQhFwxeN\nIG5f\r\n=aV0t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNz16YHzL71zJZM/U5iqxbjW17pY95yvQNSl9I+J9SfwIhALVr58eoxOCgInSIxHJJYWlDPbs3qpycHlPaYP+DMkgh"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.9430727a_1542274821918_0.9941490596417009"},"_hasShrinkwrap":false},"0.14.0-alpha.a81f478a":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.a81f478a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.a81f478a","dist":{"shasum":"5f599c8c3cb1f6348fccfd46c3b2cd46e389bff8","integrity":"sha512-Rep/pmDzBPkn2d6D1gXdckoqsbkXGGwEHYHqZwNFFCR3QiecHyS0qAw+rWJXK323RVbv3wIHqhgtuxY5clcd0w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.a81f478a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7T8mCRA9TVsSAnZWagAALkcP/0zObOEKcxWKbc6of9TR\nexyBgEolwKnSWS4I3wNHDwXAQavGh1BR/jRfEQyeiNo+7pU3Qyk2aAGdGtIl\nQbGSunIhSpC2jKeDY0FdrJLz0A0qqk5ckD5yKZIq/1R/2eTPCK7XKX9hTHWZ\n19atd0J3MR6/lQ9YljHiUsP3pIV1t3e4COAGnM2bIJWzHhmx3dctFeSXUjZG\ntSpxBWA5nj8T3qi6sxw5Pm/EI7RkSRTbpvhzI3ngC2F2t0R1CfvBDZ5tEMbA\nwgISsiS9ndGHe/rpn2ktO7CJ6ifh7DNXswvG/sSn7ASEPUkiLVUVXdWqdSmc\neqf/NUo0FAKg5H9VMm4SOM/Pi501+NqUhyWz/N0BmHNPkV3LlrJxEmvpZArU\nkRRbglfpdYa4ODEXlka8RFJSviioSfKb2b6rkktywsgw+5Qpp2fIzO5f3i8g\nd7F++XOYnKsNDfy9C3s08g8bcMkvjSWTmXpTbR9elqFmzrVuTZVy0dEldMkX\n4rCmmgHf1fIJXsYygZvDkX69idNtpGvuEg2CTd8PsMKzueQQUZmEN/QBPTBc\neeWP6O+lYfDIG61tz/oHRGt0N4qVd8ybWItwEvqmrJUhdzAlwpajmVs5sL/j\n39FmryD6RZIFPiLfImt9j59nVJE5QGfP8qVHa9IoEYGxIidJc49xK93GQ0ea\nrCxB\r\n=wH1T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEH3fFdpZfnCzpbFDiHd8gjSlsANYysybjYycYtKhvmrAiEA14I4mZ529uHxho82LSJ4QM6h92Yk/Vdcggu8IYeyYBY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.a81f478a_1542274853967_0.1875311141640983"},"_hasShrinkwrap":false},"0.14.0-alpha.a3ad4912":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.a3ad4912","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.a3ad4912","dist":{"shasum":"1a98b294bdb24cd88d350e1ddb8bb1bb472944ad","integrity":"sha512-XfrVe9pUlGpqGzo7mJQKGBtsTg/aS/YjtRb2xE8syWoW/ZpyVHOGMUSGFHNgzV/wL/eq0RkijSkRMYN3rb18wA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.a3ad4912.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7UpdCRA9TVsSAnZWagAADycP/Rlqit4i2Bo92CSZzYfW\nnkpTWbe+L71Q0CQkzoNGWQ1die+y9RGK7b+gjwhX3YN13vFd8Eb8SMTezsw2\nLh4MFcRWf/ISIonsMpIKls7zA63gTouSF4RZYW820Pui4XS7kBsnRPh7kTCv\nS0MKJsXZ7jwHiO9XKOhWxDpRxFjc+R6vxgy0JUaCJnS4U4uOvsbBVFApnpla\nhH5nu9Q/lMJDqftdWWEZZZkGwZPCFAjUTlFzDwXY0DK0WpzKdO4mNB78LR9+\n58LiIq15zj1oKt8xn1kroJSoizIqV+ip8uZYwh0UOo3Od8p0RJHyiTQEcQFm\n6pBU8O0IBAThCW2px9FLo3ArYuy2zhoaTfSJUkAxF4ahxHxq9ELh5j5zP4uo\nb7Xkaapz4xL6mUOeBYxjQfh4YzvAtEJwzKixkYhUhLr1d3unOl4PZS4k+XGM\nPUFDu0SEiAXIPceNE20t36LcivlxUROBQ1UMRIcWiZNq9JrpBAam0DsOim7H\nYjiAnVJ7cXeh+sVa6jPhs4N5wkZ57poFJ7QuTTlk+xGKpCHro3M5b8PvjReA\nvd26YaGjsWDqE9rMI4Z1M10r1G1G1CHPqEGGWjdcYztoo+54b3bYI6sRDei8\nuFVwwzN7EUt9rAnjFzd0TQY4hYIBqCiajIXdiihoCgTk1tGSbEPzG/QNIx1f\nYFqB\r\n=EJbv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLQRS+hAyHGxzVI4g2ilx2f1DQUBeXgoJgpSzm2TsPjQIhAKo3vKRHt5j0yg+9kizb1BJ2pL1QFSA0tUotWIju38Yv"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.a3ad4912_1542277724897_0.8107218890041361"},"_hasShrinkwrap":false},"0.14.0-alpha.ff6f91a9":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.ff6f91a9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.ff6f91a9","dist":{"shasum":"4e95cc24d1f134f11e825050e61edcdf14f397b8","integrity":"sha512-P+iq/KIagFWOvMj7TeFQj79KjgXAY3cfPLBbVU4YAyks3xw4qZITaZxAPdEui6mO7IADJZeDgAx5GUOoOoJpyw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.ff6f91a9.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7UtOCRA9TVsSAnZWagAAg+4QAJUB9Nh0eIVzAoqtEfuS\nzRns73nKArPt/PCj2UygQ4oJsPR80a2BLcJt5g7zxFAVrxvPgS36ZmVq39Vy\nHWMCA9Am1O/cSSSj2SViDZiA8P/z90LE1F2SeI73911jlIw0XE+p/8YCjds4\npD+QXhcl1gGbvYYxHxw9U08Ny7NbBvepkqImdm/DuLQG8qr5wE68OGvbXtVQ\nN2Em3GKILqYN4Jkf+uqBkO9tnTHUwHXEhxBRDZpW4attQAa3EKM6MMVjNJla\nXQSENAcHI26hLwy7PS5dAPu3s1ThG2wjHhX3Tj27uIPcWJ+FPjyBTg1MoTip\n6IOGiG4MIt6qNeFsfuQkNqBn4454eaXgvTjKegOeSrcZC6kb+t7NlxThUmrM\nmz420vyXIGrBa40odeOXU66/0fD4+CCP+AL9vrVkAqqfrc1zmERqFy0rUsTK\n+lnOlmoh48mzFts6w/H57z9MmvazNiiAPv0ssP4/K4TelReLHCA1ckj/Masy\nbFTpETq20egojCxurWEBfDxVeAJuF79rMUvTSyVAh78r20Iu80rtf/zvZp6x\nT5d0qieceJgqC6Hm/GFyY0dfR24/R3Im/7Htz3gvZeZ4bMJtaBSMO03GTvti\nsoo7CsjlU9U26plCrmsEkUWNQLnLTxyPVc3V3IOsFrBnN0z+HVdP6DLDwjE6\nmSoM\r\n=aFBZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAXdu+pNygYh5ojprromOc1OfcLhkfMY1fGpgiJxlq6PAiEA9XyRMAaJJu7i/EyGRoCE3H6Khdc0ig7b9iQ1Ymp8mC8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.ff6f91a9_1542277966065_0.8080481629746674"},"_hasShrinkwrap":false},"0.14.0-alpha.6c22f8ca":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.6c22f8ca","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.6c22f8ca","dist":{"shasum":"5a45d6ad6dd9a55f2a35c39ab7c65365ac14c586","integrity":"sha512-GIglRVKzDQqp5YGP0TXMW/YwQki53F+1GQKkS5L9e/RievLC5gu3aW8wa8DWW5Nxo0iej8CkuNZ+fwpEKY6O2g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.6c22f8ca.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7UueCRA9TVsSAnZWagAAv04QAJe7hbk8PChBG1zQWLT3\n9n1DXgPvDCT/9ft9RcHnmPEXdwpBdjnm5AaBRsdo6zjAiWdWp+DnbYpW5Gcp\nkJFdaafItANqdr55STnmsCI3JqLx3iZK7ak+80AJPQJbP23qV/B1lJl2ekii\n1baYpLCsFNwPYpGQjWOuplCZZFz+cOd7KcbC9MgMz0SJLseZaA1Ne+ta2y+3\nEpToUoEGvPVxsfGM3vM81UE94TUD3Tfa4MKCFyKeJOCk4cZAh0Ks3vRDXIX9\nvOfiDfk9zqEOEqWorJH5bO23b8joKJSWyiRkAjwfHMTJUlm2xXgfxyUBjuNN\n6cLv0BnWKC+ElmdqBo862jholyxF0vlSdbIbbGfI2C/Z6yByWicsHVhxhjHz\nnQ43uW/Gm7yq3xbBNwBaP67n98ATPhUm+PPipUdIrNar13s/S8yP/kshJC3t\np21pswJ2PV/989n/DqaNAvV1jzYuaT9KHkaliGP2iIP8gX5y7ZoGhxBiJSyl\nPrG/mxQBoX4SEq0QmOU5WjJJX6hfA4nzjGAUeB6tX7zp+2zuU8dHOsUzL7cb\nyBh/1e0GUGpluercWzYYSR0vztGDGKyDXpq1Ponp6HLjUfDH5We5GlN2cSAn\nF4t9RF+BGHVrTDBJgcxdnGSoEHZBwrgP8XTtLBZs8bX2Gi23lvkNYoaTp5qv\nD/Ws\r\n=WNjw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGjhrDK85LPXGX48/1QIl7LkiFGHhjnOLRDt0spYAw6zAiBMoKEUrIXtpIRMjl/Lkt0SMsNUoX0jGLVJZfEz/63Kew=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.6c22f8ca_1542278045713_0.9292571023068132"},"_hasShrinkwrap":false},"0.14.0-alpha.1a6b1b1f":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.1a6b1b1f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.1a6b1b1f","dist":{"shasum":"987d21aaf5b991fbe58cfd9c0189b3b917009729","integrity":"sha512-Fj5son27UyuXlYOIQU0B46x+2Z0ZTTdP0itGm4Q+MT55EKRUpZbCwizFENX1ALaq20aqNLFdfB45LJEmdKDF3Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.1a6b1b1f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7UwPCRA9TVsSAnZWagAAU1wQAIxhqWG6NSzvBGCpK3z2\nKaJ968TIt43twweNOeN5hPFVBHAtbWIG/vCPzTqeCbLwIx2XCwp4qPeA6XKl\nPksso5JM5ajhrCrZB8uTuFJjv5YHXWM2dnoxHed6Fb//bCZcNk9aY8FDaz1i\n4G37fkjVxhgipFglQHMIr4ES4FYC514Hb/RWzwNPUqx3tL9vQj4c03U4cVCq\npJ2dLVHEIhJfD3oeV/oA80uwQHjxI8WjETq+tB7z4odMAhVC18fj2ab/9X2F\n6id/2uYGM1eo9RHQP7fMFucjGACvjwLzrv3xsm0XlEl2j5nWm7Lu6Dw5bOaR\n/P0awhzuSFr1qZewBHmonnNmxujMb4MVUwjyX+Uedb79WV0h2teHK6Uh/5Pk\n5swM+tydqSOTVziD5FYDVZ1P4R3utx9HkGtbBLIdFbr8By9UMqHaHpk+3Ecu\nK7pM0+qb3oZO9bwxnw6c2NMvK8saCIDtagXDOqo1Heqr4xJ0G2Bew/jUvTej\na61Pw/E2wtbD7XqjXEpyAPYAHhYdfmeaCVBJCh3e3drwF0KLnNprxYPTJmC7\njO6z8clCmIJbFlY8l1ovUc+7gr8BugsISxTmnquJPcE9OXVlEPMW6Ft6oIE+\n5iMBrmRrpe4fA+GfoWuZ1eZuqz2/+KVDJpZCmdWRYNxXrIn4OFDW+cdZHGEr\nV0Yy\r\n=Oziq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDuExg5bWi6OMWYVd1Dzve2/GUiwJnxak/3Wn9OZukmmAiAlpTV9hMCUDlu9j45a0eAstIlY5OEFkcpliT9DPaQsWQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.1a6b1b1f_1542278158933_0.5137891213932793"},"_hasShrinkwrap":false},"0.14.0-alpha.b16a622c":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.b16a622c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.b16a622c","dist":{"shasum":"6ea4f2770a765b037d05ea706e49c92450a6294a","integrity":"sha512-F6PBgHJ0wg+xfAz097I9w+sPmogwYrDuEUYKwj3yR/aM98wef4tbKJAe48R0j8qc+aINKjVFW+Uc3WuPtWgY0A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.b16a622c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7U8CCRA9TVsSAnZWagAA3NUP/0/qcTt523ecvSX2eA0y\ncd/9U959k2nNrRpsBuZ+McVQSAbIsqbqvxAYQDUoIlZNxy4W2O6TnZUAEZP/\nww7fSDMu8OKUjbDqMkmawTIwm3afKkXK/R+iwG1fDkRkdXGkOci4ZuvKJtbK\nnZFWmx8xzT/uwE1RaIG0rl4M/SWHk1sI73SYWQG5W82G8ruJppmBSlCd78Gu\nBgvUoZvVx8DfL9SV/9dNQPp1yOM6DiuI4NcVleXLsysSfio1o9i3pySzwU2J\nbKWe5RnoN9zLMYTlK2V9xa+PmlYDDSMUvnF7qexCMMXXnQbp09Mo8rNGgkWF\nVDtFwfG7+ySihRYonaVtSkCuJV9mA04xjaDneppW00CZ9e+fHbQblg2QkyTq\ngALxa6ZNyWfTOUIshHXLHHzE358+qY2dNCknTW76pkh773kOm2qxFxvkgVs9\n7qlggS87O8A8P4T4Moxw2m+fTTx1imjBKh6ZNyCtJ2fWRKKP6gHD3gcPIZEH\njWSv40HD9jk6rL3zfFdUu+3QIwxX3rti41LW9+zIVfc1UeWFVrXIhxt3FYbi\niF/eLxgDZNrekV/+VcVDFIioQg62HRL1hy3Xz5hpmyku0efypxLsTswx1AUQ\nu/xJbBtLdEc2G+nWES38Ad1YWPjf85wNRfgLl5sK2b+yw/VuO23PB48lzH8M\n9CJ9\r\n=t2F2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFZNU4jE6o23aXaDNrSi4KuB1gS+vhj6Abnw/F1955iQAiBLIKuEZVCcmw65k5IPKW4x1uLEljZ6eOtXHalJ1dfM6Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.b16a622c_1542278913548_0.9649620582935694"},"_hasShrinkwrap":false},"0.14.0-alpha.69da2212":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.69da2212","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.69da2212","dist":{"shasum":"dc15802bb573ef42a6a21530b0c4963b90e00cf0","integrity":"sha512-B6CGG9UzgSHP36hVQjkkLXBGhY5MPBmrS2O4CcOl+m2eUmErrlgeQ1T7mUaiM2O0dsTEysqXt+yBvOoZWgh8Qw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.69da2212.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7ZGfCRA9TVsSAnZWagAANRAP/ilOQJSsa36ATnaADoqB\nw4CQgFGGUhbKSvgBl8H2ni4hXQHzJr4gnyaWma6D2OpMbISwu0IDJACBivj0\nLKIOInHridyYK30lWtbq3onKNYmYY9+znlGQQWc4Q6ID1y48ftVfKCa3+kck\nTrstk+oFmWU2h05VWO25/GOhyWk4tlO4qIEO1Epfbzfh8Eza+WPJzSpzPys+\nY3g+VMDUCuNFt8sCSTlu1nS7XTB/aUJGTDhpVKh1HS99xooXDMWIOVKMvFql\nPK5WCNy8V1E392x/dOWyG7DPHPFFnwHLyve58dCnkXFxJH142AZ2P3RfTjgk\n1QtU3Z6UFammNyR545b/kG3Fj5RjvO94hnYRAXLQDJVyT3M2frnkFZaCXFLN\nVinctDLlUGFXd+ydWqYDntjsa/TXJ+Rzrksf5rzTL8eW9JF8uRjKmVMS7SyN\neoUfO96ogze4vqMBOcvudZHOCZQlaTNSpV5UaXZgQdoNSSn7oOP3ovAVF2Y4\nOKeR1FrdRNvJXJhOpokqJYmB5nShHP1B44Yxd915XOuDlB+XiDqmuKQWLKWX\nm4nP6qn6JPR0H5HeBbMOtPACUFA1sQJayPl9tXL7lJ8hqK4IPLBiWyWkjT/u\nJzUN+kIRRuXlgZWhiPRyRulndUTws2O//7lRQG5udekUL3E/EReWE1uyhoca\ngFaK\r\n=0Hp9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDZ7bbh0i6cv+b1pjVdaZJkyPHUvpsd6//pvTI3RUluaAiBvUl/pODZ17cfU1rBYwkY9Br9TM1o4EVkFGDNP0ZNxJw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.69da2212_1542295966391_0.479407452703257"},"_hasShrinkwrap":false},"0.14.0-alpha.84da663e":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.84da663e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.84da663e","dist":{"shasum":"f2f7e2c187c8ae67c91b9fe20e50e0be6f11667b","integrity":"sha512-X83Hrv2ohB2K5DUv1z1SNnUoPOWFq1APvfj8lykprZoZT6iLxWafowpol3oJNYgq+5aopgqzFmUMhC6urPZnPw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.84da663e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7ZIkCRA9TVsSAnZWagAAvlYP/1JHDF82WFeRL/oSYRR3\n4CGzo1LLyqh39H+FTtn0SbNnNvalQDc+ANE+GpX6/dU9RWQ0BLzLPnZt1jrq\nJNLnIY6y0GrPADSA2zixvv3OiA7KT4j4ZEgFsn8JPErwHAfCLIwiyBcvY8qK\nnVaJAirnKTIPap54fQF3yxq65Sr85aIC9Fg+x5FRyY8OxXHIQ4eGpdktzFOP\nv+7rrdfTkPP4AlUTheAiwRy9s79qClweb4lbDSos5+fqWbOVqpPPafULUsmc\ni8473CzgDxrpkNypB4uRBHGiNfrj6xpnogUw2TV4AuQTahF/kSroaSaK1MkJ\n5pQP38SQ8ZrWaI0Tv/fWMMkVORXlJoo18UO1xlcZIwx8XLShMtZxyenA1Dnb\nP+Wj6lHFRp9ugGKgGBFkYD0o/nlWl0IaAuoQFOMQl17dLRA/7E30TrwvNn7h\nJFgMI+DhJDKRxYZrmpS1p3e7AXomaMpXkD65R5BYgqGoyKD3mY8iovR4JpUg\na+lvzbz42LSNG4OjQCAsJVqB+TslE6EHdV30arxRFH1CRjRChB1fm6o5RnET\n6wJoptmgf2kxkrCQxyyNHbL0Vx+H/tmey/KA4g17b9SlTMxRqLxl1l0Dcm81\n4QQ1pOWacNs4HA9QZzVra/BsSUDUNsZMoaN/6Qe+pIEcGHwB9LXZ+ZQpoZ3A\nNC2r\r\n=+hDu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPsslbKVubr75VrzIzKatBUbYBJVPdnvUBCtiGQZ52EwIhAK1xbOw0UgiMIIWBH3xPkLdqOHvlnXbomV77t1aLgdFm"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.84da663e_1542296099311_0.6770095230078419"},"_hasShrinkwrap":false},"0.14.0-alpha.989ec240":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.989ec240","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.989ec240","dist":{"shasum":"f53aec0e6c87fdddcff3d9fcb4d72ee3dd6511b9","integrity":"sha512-AUeXS7A9d45mX7MeQI8RZwpy90kAg62mxjGYmcYnzb+p3VZiGST2nuTMMpUeKqcJBt0uZszAtzTV09scwHdINA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.989ec240.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7d9oCRA9TVsSAnZWagAAUhwP/RcMPyl0JbVhExJZakJ6\n6SZQ+DmJCdPieER7EubkFApLoVRwG7aPP/vHYgN6qnGKJszj0Z3FlmwfLLbB\nE6Eji5Ce2ZErKiIOP71BFeIuyzMLO5s21/x72ipGlb+nd5aMHZ5r8Jdv/v19\nPIMzli/6CwaGlOSxQu2XeKQfpYztE9wfiGWVbVPXLHh/n0zXygrmGM5zsCyF\nvEK7xcbOI+/QI7TgljpIrqAdplSa25EWrPorCXvUI8qme8AeVDxssaUwsBwr\n/wl+6iEw09eLTvKE0GF4n61Ix24f2tOKMdWhF+nNa4vy2LOWDZF0f/jDmh/C\nx5FWuRG00s5SonZ2+srdjuaeIIII82ZUYUD0f3UEKUtbU9QA0XFUt+dfKexC\n/ZIXuGaH43nFSE7HaUMRDHrO/KKHfYYVPtT/y4ro6B1BZrN3MJqt6n05zJRh\nm0l97RWiWSaU6yHeI6WRXW1FCxCwc0uBknN2nL0lzikZDG4sS2Y2zMivyn83\nunveeqrSPbR6LCYnva1T7JrqMEVbjHi8OaAOj3odbOB4G4EkXISM+XV5nIB7\nQ0xNeb6LyGD03hKtuEfQGJrj30JOfwBvX7gieAV/YchKb+QHARANNtqZFXLX\nvKoUYpeCVPROSNzTyEsOLt3xs+mgjU22C1rWtN85PQZUExbxIkn9qf3id968\nrNcI\r\n=0cTH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE3l4FJBmJBaexSFUG04FgYAeoXMoiUJDM4yRVVd4wDoAiAhE2+IB8QAd0mxJ9ifSZmaphhb7yVDQVASrXZfST7ojA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.989ec240_1542315879651_0.24493530649263273"},"_hasShrinkwrap":false},"0.14.0-alpha.4c8fc26b":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.4c8fc26b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.4c8fc26b","dist":{"shasum":"3627fa509125cf25dfe986e0d02740e22cd86cf5","integrity":"sha512-YOeWrC203XdAMZKKYK1MjshUgY2XNTXcK9cgX/DAjNsUmXu1JYVJWDdjOV+xJ51zVJI+E6o9t6vQHjk2fD4/qw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.4c8fc26b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7hSYCRA9TVsSAnZWagAAJbMP/0sSMK8xEGmTeKPlzAlT\neyUVnFtOgyC/AtRP7ctR/dBuUixQzuqipFjlpsvRh/kaM8y0VNyxqBjdYlrU\nltOkvxCb2MEJ8YedH11JrrkdUU2yeLJJf6LhN18BgcE48Yz36i5Su+bY/eo2\nl2blhpy8DldWH3lROaJHhYZWos9iB10p9lVUXcVXiaRoKmUeCo/MaxEwBge4\nouZeB+fPimbZN79WkCFVTSUmQpsfr+cJ55GZGHsTA2ybf8kBa6ibtncBN91l\nfXA60CtI2fzqhDtWOXTOUosSEAAeYJphlHfPLLqEhrpiE+XniAwvEbihW8QJ\nHeX8M0o0NVfV74yhiO3XlghxinHRTHvTAwsNwYgAv+KINlbDLxw5vRPLcX6s\n4PkqYLJqYXUGMLrYk5W40pxw6cL4KEpLhU6QhWDnVW4vn/G1mKp4ut4IDF4w\nl64j+2VJFgyJ1D3q1uQWQ5BOuGZfcEFIzBn+i3QQnk9kfT/Z1YdKPUT/48Ul\nR5ngwmCP7Qjlj3nxDxvP4SU991/Ttf5Xc33iq2s41cO2AUJsaBMGJWN6NZbm\nUriwxNs697K+J+DJjVMTbaGQ/U6NLW7j+qL92qqS8hnMPKTXd5n49t48slGW\nqJCjD3OXwo61hkW3nGwixax4pO7bhZr5+H7y7JhJf3CASFJ2HElh/TdfnHTP\nRale\r\n=QjT5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEH2meqdIwG2OiavEfRNCdaDIXhuDEy9tvZcR7af8CZDAiAI3AdHBoRFSipSotV6aWZcFKNQImf7cX7J74u9kYhJoA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.4c8fc26b_1542329495489_0.2697881799462081"},"_hasShrinkwrap":false},"0.14.0-alpha.0e923410":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.0e923410","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.0e923410","dist":{"shasum":"5ae636a2dec26c7ab9699ebc07568a25ddb11180","integrity":"sha512-O0QxYtsJnlxXGmsYn8r8lKP4+5NG+caqlAai3ReE89HIMYwOGK9bmCWUByAtEl49wXVHH+jEhHvcOH5oV/23Jg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.0e923410.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7hSwCRA9TVsSAnZWagAAaDsP/RSRidpcK8xynygidVv2\n2HKwvGP9Gal17UzzQsMNf3SzbXualtIKYTDxThVxQbll267vAW3jaFyFpHjh\n2bU27ZVn4blW5cCLfZ0ZglgsnGYQQOPh7qn08lh3cqPMU7iJJqQT+GgKvMwF\nbMeQuvBgQZJuYiXThdBNJmebmd89PTJ/7R3mBBpGFwoqFJqJt5z8VCKkhbvz\nn0yY8Tr9l+pd9okK9JW497i+ARLRworpn03g+ufkc5VkETRuLY896dP9TT2K\nBu69Os0TdbEn+nJ4KM9G9lhBexLgMFWUjkM6ctOm51yCc/EPhK8wFDctH8Nb\nnufHJMkZpoRkQxNg5iyhJ8zjZxdPhvIg+kO6MYuSgwq6SemEEx10IXI8ESic\nwJmpOg+22GKVRRk2dHbcQnGgtArNLi3omETfSzjt9+Fb3A8RlYTZZpRPxd5+\nBzax7Y2lav1n++oVSsVhe8PFBS7YBv+0kUmQ0EMITjgqPba/GZfPMcKB2PCQ\nD7MVUWhSFtAoCX8x3gB0m/VcCxtVSMw8iK3Z2zB7Or+fAX5JdwM/0doa19sC\n70rsMHiUjO6Y1gN7LJupTYqOt0LofSjhtt6/Ut4TcowXv1PoDc6AltmSRESp\nHgm+KUJmcNcwHNPrE1SR4dV599PT8Yn2lFqT5s4+/4zGxS2auwJJm0DISx1E\nLzH3\r\n=+OLx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBBg5Kjg4Cm1LIQly10VTYA8IXE/K5W7EhPMh6wIOR57AiAnH4hdS1UrxC5GcfxNPuGUmBHUONqW/kIc3bVgUFiRLA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.0e923410_1542329519934_0.8554222179918158"},"_hasShrinkwrap":false},"0.14.0-alpha.cf7d1146":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.cf7d1146","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.cf7d1146","dist":{"shasum":"c1b6dc9c41bc05efd027042a1cd165f1bdd158da","integrity":"sha512-KqAYLihPBw45LWhhR/DNS7j7cy2Pt+AnrgObLGI6hWhc8IN01pl9YtIu8JProrAnM/t8YmiiotDgNV4zf8kfzA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.cf7d1146.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7hUCCRA9TVsSAnZWagAAVwoQAJ+AzawXkQIH+raWM83A\nTSCRY/eWTFxMNVrMqeLWp0d5Fb0RBsmBErCgEE8Bmc2WJeu2MYd/c5lTn3+T\nQG8JLIZ2xrBVq0/THaSjSYY+cxuJTY4IFhfJ0In/y+0vPzT6NoWWgM/TjPIx\nAK29bA1vYGAquXiGyJ/gTAsx3Q9FfFAn7Yq6kJASChXHwal7LtOeb9h41qtD\nGf3EYbR1bRwoQE7ACjgvVEs9ZIVCMJ0jyqmxJhJ8V2BdeKHu8agjAEw6skRc\nGEj/XmWOBP2FAhH+JdduIwQER/f7j5fOlwrx+4S6W8SooD5NcyyQl4eT8i+g\n5p/Mm7IAISKMNdAldop5xY+wtTsFW5eKAnUj/eyyEZM4jZnFM+AFe4qv0hnj\nyQGaTN5SLCQXlF7KS1zt8+kY66gOyY3MuEvNlrzrqg3tA32+Try6MfMpPyzh\nTIsOK4e5CAEzIQuv2gXdtTi4rsyHGYtxT+7baClqGBImwyweUrsG2vYum4U0\nESLzgncdQhq90SdXreTYw69/Q81uSuB0ssC6SnPAjimq5jrXwnHXYnpeBnxT\n3Oexc5bgSfWeSPkdHE4H3VBlmyNOuoh6pOQjTZ3u7IujFHbSI5aE2h5Ggwo1\njXLp0sr4NF5x4Djvy54QyHX0jHGCyxrxxMno/1gchdwXtVMl7eeVfXxi2Fpe\niR16\r\n=GPws\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEosOSt1o4pkL793dasbIfAVocM9kFd1e0xOjKTWJvdQIhAIu91E1JjybT89pZ8QoqYJniIcXF8usB8Zo9pJ7I6Iyt"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.cf7d1146_1542329601477_0.8965713053418096"},"_hasShrinkwrap":false},"0.14.0-alpha.c3bb00db":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.c3bb00db","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.c3bb00db","dist":{"shasum":"0cfd3c2ba1ae0150acf8b7965bf4f25cabf9b90f","integrity":"sha512-kwCK9+S6nuToci0q2n8poadu7c6BlbKbu2AnZiLpfn11fq+CiMsgnHE9u/oXGSHp/yLhnj6fI/zhSy920bAYAg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.c3bb00db.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7hVUCRA9TVsSAnZWagAAuRsQAIZvjKFKtaJb3fPQtcCl\nqoen1LkhtRzW0b4tAMQaZT8v/Bx5aBMt8ROtW3mSe9pD0S+2WIFKBCAp4seA\n3IH6Jtwpt/vjwEPUx+inKDXzrwPAJa6ILQoDt3EkPeHBgx5ZQZwuUrMRVeTi\nr0+Me/3YdGp60wtchFG216un5DpCytwLpaUhcHQ42Q2OgmfgxA9nPUbMjm8r\nhPOR7fSfs7argz5wUNonJ3/V7OiZyhO9WiaT2ci3H4bX7KmUGMRPwNcngx75\nbmOj5wQ+v+ckwwPxa0KALxhyQBlc/bCg+b2B2+YB9zuMChsw7idJrExQBxux\nVEOtbzI17eZNmuNil9ZUVUHbpJRV5XRBegIcnyk8i5CeezVjSF74/OR+2Gs7\nSCW4MwpzLua6qrQKXvTcVoIhJUpkuj/KpRdK+EQJ+WSaSFd+4nUaH8/sk2Xk\no3hSzBzxSMj35+MHRVLIg92jH6TkJsZnPQa3wG9g1dQDbrfWRyPtoW3vsLpo\n9Ie/8ns2FCCNPRT/9XHYUiwkKfL/oRu10We1TreBZsxg0RqGWV6prWwqP7Rh\ntLofIbKhihQtZMET6mLrwcsL8dbOzB37A0fUuUN+Th+uxzXtr6WDou6nxsot\nTsJru84buU+TqdnGz3iEDpHRtGtOrHCy4vLcTboRgwdI9owMlkQP38M7qicz\n+h6D\r\n=xh0n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXQkgocaQw3tCan24bxOih75VxGIR9uOV3unKWTGmUMQIhAPl8AzAO8NxRmKxi495jf24tA4mtJfuSwIxBf2HBrUQj"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.c3bb00db_1542329684055_0.16068587106309296"},"_hasShrinkwrap":false},"0.14.0-alpha.4df73d7f":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.4df73d7f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.4df73d7f","dist":{"shasum":"9840961adfb769226afd3c7a288eee1f2826ac06","integrity":"sha512-+/k9RbufSBFL66uFvoMbuloB3k+T3YfDPTSf1hpGjDfeLHswADdiVHLu3AVwIwXHKSPXtys6OjJ37kO4e5TXIw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.4df73d7f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7h5yCRA9TVsSAnZWagAAjX4P/jku7SEharvYe9fH7Uk0\nwJ9HXAi9g9FEFjBHxtX+mCM7c3lVqjRMiNhlS7mbZRHdcCUSUpGqvO7sygnJ\nf2S7MDNdQk7mF53UDrkhuqh1gkV2RyWNuIXY/qdsC3Ds5CCzMG2LFYKH+tk5\nKyLFsLgSwPcCIwGki/GYUwSMwqdcRcBOwblHYnttzzfYIz9ujgogLaR5Z1Th\nHCCTcPd97BpEgjnxxG+eXqx1k1L34YneUEiJSp7dvOPgYZ1gkbsqpLW6+rs7\nxzsVs2MpF+nQ14SIStyVwBqdapv06Eto11OFcvA0kN3MRE8ZrVUTsjkcFhPT\nhmlSKMxPCbraHGy0oq81E4JEbouCMsdLgZw6tQiwIU5nfTXWlPtWWUTozPie\n5DK2OYurvh6H7xJtBvGEVfZ0HapuzXp+QY6tYKRcY/zuG5m10AlLcKe6cv78\njCb199JZ7vA/CYA7L7OrjJEiJ5xtQ9POo1IJhgh+zT03mlguzI1PN8F2w39H\nvXRSMJKc8GafCU1O27Ec22YHhDNcwMOSFks1bmlcPQYAFxhdf7Y6NDyWoENU\n83nbQ8aGl6aC+rY+S6BNx9hcLFrDR7TWjxLeMY00VIhFEPIqWjXa8IQlj+jK\nPhPk1noy1H5ugb0PVRSh7mbRpV2Sm786ZqCCeRv3gCC0nEXbuM/vjEg9Mb2J\nAhDM\r\n=QMnu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA3bjNgevNQj1NwF6DmUwo62cFbOSvp9fjoaHt+SWQQNAiEAoigPpZoM2PdQS2NfyKAY+gu1omFbj3u8g/b7QmToILs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.4df73d7f_1542332017787_0.5260803994138186"},"_hasShrinkwrap":false},"0.14.0-alpha.73beac50":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.73beac50","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.73beac50","dist":{"shasum":"72e74ef17b1545fe315a185e9a5302d10e0458cf","integrity":"sha512-Y0ItitdB0JFKalZkfEZO+ItMK2FGtA783IKUPAI4iseYLfujeGaRF1F4hHOw2KkZy68mxNNEAfmZzT3KDwI89Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.73beac50.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7iEbCRA9TVsSAnZWagAAkHAP/jPq7nJaaksgioJ8fXLQ\nYMtXZxZ/wbPiYZlUqNZ0+QocewM3AtTWURFMQQhYIPmMQ//stmuIhQO5y7Qr\npnQmaKAFD+5xTuJxbftg8fDEvIMP/etiOKvYUKj65Cyifsb9lVl3ZhTiZlOR\nmo3Ry8ByXSP3towDEGhlPhBa7DSJIuiLIHifR5PKf9NTe7uhp1juC7Z9yyOL\nyApkEQAQ3uva7fGEOpJva+4PtNCSJIfO0jTjTkUJXxen0Nx5kz7z4VxyDydg\ntqk2ZTpuHK65Gy2Dt/nXrlxUhMwod1a5NRcfJD/2SpxtA343y5bIoSCsJ4Jg\n2Y93VOlJPKYJoH0R9gBg8z2/XNbBEnWooI3Ld5+5j5rauq/Nwr5RGgm1ajVM\nWwJnpjJRr7oZ0TVxSfciDElPMaq97zvQoZTtJHDqivz5YTLQ/xaPgayaylSo\nhHk+B+8E0KbbaoH0eVaylYG+SmlD/4nSrp6EjTTKWxcu2m9I4Fpg31lpffSN\nkK/cV0UFKFhhq+g3BXRE7nKXf/km7PAlKuD2eVxsmso3Ex5hbEy5siKquej0\n9J4aIVOu/2X6UDIZYJ+AKc6vr1+huYwsAsweW+taxGzYJFABexBne0muaQIJ\nxuOk/xN2rJUvprfBf0x1gfKJpjz370apHNY3gJ+xCCdp86pKEG++a4W1dknZ\n2Dqt\r\n=E9uX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHLOOiThwBRrcD0KU5w2m7/v0IihAyogYpxZU3jy1/ZUAiBWYWtkEfn3b6ubJ3qXxShLLEtoYnSJcL9G/qRX+lJBXw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.73beac50_1542332698609_0.2379656818175433"},"_hasShrinkwrap":false},"0.14.0-alpha.a4e47993":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.a4e47993","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.a4e47993","dist":{"shasum":"da99df50d5a766b72ae2225fa0281e9cdc091e78","integrity":"sha512-PtSu0/sVTc3xpYoA6Gr6XllwtyZcp7mvqTqgn7fk+E2IJmIuvsftk9wD51Qs00wLqK9npGuGedFOsyHOLdY/HA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.a4e47993.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7id8CRA9TVsSAnZWagAAHakP/jxbihUHBChBcUnUuucb\nraWGNPMQzzKtpi753gT2uTLfiIT9vKVQzn3Rni+ZGhgf90L5q5T3z4yiKyvw\nqnyIM/aPXBeKAhL5Fya79L3Wu8BnxJ8/1j/q9fMZVCaoOAFo7s5c6bYprQ3W\nQyx9Y52P2lZWRgZ0jCZ5atf8cctrPTG8qh0CfrF5jTQGVJfmD6Cy16dt5Ca3\nvA0wU5BR9niE0HBHN1HbqQwONakhpQuMOfIgpeKWOSSGe3TIItik5/vfl4vw\nzk3lM5iy+rFsjb8GxJ9egy0EpZAKDMyPfj7Vn0AikvbbgdxwKR06FRvo3SBL\npfQHd/l936iO1KCsRrxPHuA6gknVpX0rquGq47Mpp+XfVTXFFPfxgZ4C9URx\nCF5WxVyiSHA8s5yhUUW0IL8lNj2gEnQD5+32bpzFLRjFi8K+cYxDyKlUyyL3\noGKRmlBE8tYI67Gq2Gf0TLwZTtQCdfDj5XVr/uJDLl9XwtybpFHV7NeMSr0K\nF06e58ULIttscJrK3Gt5gdE84Qt2KHi3P9SGZXyCGu9oVYDye9K9HfgG4PrJ\n+4tZAnDKamzUX1d9Itr62XbLfr63c2NtHfyOaxVGl0X22/LV38eFpfh9xYle\nfY+BVVbPMgxW1aB2LM5s+HMs7kxMAuoK7dPR0od8mBZBdyAObuuzsq9BqBvg\n/h3E\r\n=uEZx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHyi/6robfsO1vCWHgqIisheqyg8eOz29UTSGshxGo/OAiBlRzC6pbuySbFulcdfqgMQBINNRfUO+1Gz7YJatQ4tfA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.a4e47993_1542334331466_0.6269690136784536"},"_hasShrinkwrap":false},"0.14.0-alpha.6fb1e99e":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.6fb1e99e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.6fb1e99e","dist":{"shasum":"c1f092606f88cf5ddc6f5a7399bc6ffca882e665","integrity":"sha512-69p2BNfE6NXS/dyB+kiamyVDBE5ODWWeeqTxx0TRYnDAdEUNDm942rG9tOB91FfmkYnq6kWUcLir64eDR3PSUQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.6fb1e99e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7izCCRA9TVsSAnZWagAAuZ0P/R0/GYj334FR0OGzG5g0\nK1uTl+KfK9xtGWKpA+Z9lPB7b5GOezl3etVhXtkuNAsOVLpeAUB90qWGA7B9\n8nlEYPheLcJz3KVvIb5kWg8EroWrnT7q4mg0yOzX5n4zgd1Ro50JkI8SS2sF\nfd9IM2A49m/D+NrtV3ECG+sycSstSCLcr4oxP2nrvr1qOEs1f4TizQj6FQt6\nTszk3v2YqDKSnCVNMynij50aboGOexSaLBhXGWU4X1Y+t18pY7QMcDjs23ph\nnaxlIUixWFqzeIc6MJ4xiFjIii3QoA/VSPkU5KI+4rQ3/WOKOiJGSibTbuw5\nlzMzGwMGJ/3bTGVNMbrXnsh+/4naNFV1KbbasAHHssu7ZihVc0+tI5UZiE/V\njwZdVOLyFTWaG2pQ26FplmXSiGL4XdPOX5pvmkFQ5hvDEGGRC5HeqiHs29Hu\nvXVyj2MVER9HnrFFJTiVshZC2yS2KAc4vg8HqaVsO1oxy21QtObpC2RSzrBB\n7KB80vWYuOYs+KWwH3Zm2V7+aXch1Pc72UDkQXkrmEMgXz/sPiPh7ieX1Q4R\nIHKI8S/qY/QvVB0lIQe0v4amIy8Nr/lGjrdAeiFKTreaPANhpQz/RAPuZILr\nGexFCC5EYDF120vzeLkaOR8TuRnU8bQ1dfEFI2y2dkcPCS8fCeFbNCwr4wD/\nwVN5\r\n=eIXL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID6h05Z5tzSvxLJ9+gPYPF6qf/BpN3OlR/NZRjTlnoP7AiBqLH60u32qFuzi7GM6GOi1n+ZWSfJ9GU5Sg7ShN5tesQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.6fb1e99e_1542335681576_0.39801896918418644"},"_hasShrinkwrap":false},"0.14.0-alpha.bc1935d7":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.bc1935d7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.bc1935d7","dist":{"shasum":"ae9230600c5ff132a62e9866cf73bbc2c719c999","integrity":"sha512-/+Hm07TMdzIhmICS5fdtEmlSUDobnsevZSNPGaI/PRzxXPim6o/GAYgJjs+nFjVC4sA2Phc3BmsTOQZk0YHelw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.bc1935d7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7izmCRA9TVsSAnZWagAAWhoP/2Bj7tActpUbJRi7NaEq\nM1NtLFvgyR8e9R5UtxFgKaRinktu5/ET1D6F9fNQlHG4U00zP7cAVwrvHQ2H\nrb3GAbnjL8rymXjSDqbf9qdxmH8JDH22tUHwwh2yBeZGPHruwHi7z9GYx9dY\n4IXL8b3zWNHsAgAKIe/UL5rAZrlqSREbAFTuJb6KX2iJToqdeXXXC0k3MKNS\nQu6qQZkPpHRRE5HpGuIGL70fH3H7oKy73LPTEP/DZBP0fLzpHC5qG0gb+Edj\n/rP8d9r0OEBCUm3WYqJ209qB73lYko5K+nTbCoQFd+rkvXnfsggBGkL2Yuqx\no8/4WP1cRx1qSjKeMlHmM7JNsLZPeTSXnbO/WSNqbWOrhbdhnSMIvSJUSrm1\n6N10DErsv9hSnVVR22ow49Mks3oayIbnOZOt0O0hbF8ED10L1vW2P9OKcmKR\nylQSvTtuef8q2ircFeCHLy0NKLLTQmPeTkdhqpWvyV1JAIUmxwwUkRxMm4xO\nIozipilPYscky2dgbRL5HrzMuxFz4zt7hKtgY45NC28nkQ53nMp9wYOQzuoA\n3k1Cp2n3WfWEiFBp2/zN3DTzysNJsAE2/4SSeKgeVQSSfMwSd/E0YVj3M3j4\nRuKY2cYN/hXcK77eDr+vjT+I+iNKQAfRmh9Z6qVrdGvF/eMiNCkN/UeEk4i9\nTYM7\r\n=AJiQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICXOQHR/zLwFOhFTpk7/zVVYZM7yl53izf8Zeyb3D8wyAiBbo8LVLqBEo7/JCSUnBQyOjFZwOEGKc4ecvbJTEp/SQg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.bc1935d7_1542335717501_0.3782975146553431"},"_hasShrinkwrap":false},"0.14.0-alpha.bfd70d84":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.bfd70d84","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.bfd70d84","dist":{"shasum":"3ddb0147dff5c280d78ab84c8e3ed3eaef511e40","integrity":"sha512-jPXZ++YCPQzUTLtwGg+IaoBDEqQcp/3vXa0+0sIkHahIg9ggu0HTEbMaWUf6SGv2jOKzbJqlQXe5XZQOZg6uYw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.bfd70d84.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7i0DCRA9TVsSAnZWagAARbwP/jAmmuRRvYBZ/Usjs3+V\nOaIZrbZ1egtEA5ECNdqDg6uoE9OxZlxbUZCTk/NOTLH3gOhkoWAGopbseRPX\nxgR9ox2ErAqMeUtbwePBhKyGAQg0ojllGZFtH8Xdw+CugK2q8TKNx2zmQj+Y\nd0YHmAcn2ztx+dyW9XkkaOjl2CICE7sRKE4c07896SnbwnoAchWkp/Zf5ol0\nDeXluqDYFttCGPXnnbGg3xak6Hbv4daQO3lQ9GeKXGU162p3iC5PcBu4zt12\nH2pjc0TCPY/6VyCIWwdltIteybK30wYhlXwABsbYcqsmIawO3Ir6S/WYXGC+\nPsqKy38cEMdsew4NsLx9JQAW5o1Gm9W4pInXV5hFLcC5PNtcgQ/+g6uSzlbd\nssXnvs2AHztEPye+yAyx8j8WzhhtHWq+cMUB+1ZV/pJY2Wl/vS18w9dnqIag\nBp3L+GYDtciPtpwajTk9cyyi15yTkZx1PVtq4zlOgd8moDJzSYVJkGgn6QiS\njHkibVGN/zlglwI1Mn7I1RS+YhMiccW3ThG9mhZgQ3P2m7s6/3TWXJgX7WLs\nIc5OS4CK2IiYH6GuYyHWYMLgB0fhS7gQ3yAxgUTUNKHddgfeEZH6zuNZzPQK\nfThSUKA4H5F1gr7vry0+71dRsaSZOFz8Tnaa7hNZilP9NSYRw7cYt++w10uV\ngRDi\r\n=yr0v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICjPBwPm3gZUgvyj07D7V4D3wGLKrx7aqbUCowugu2bLAiEAoQ4nOjZgCKJNFIPfHMVZJIfUDveIJC3T+rDLC9dQkhc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.bfd70d84_1542335747348_0.29076949600886115"},"_hasShrinkwrap":false},"0.14.0-alpha.efbb7f7c":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.efbb7f7c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.efbb7f7c","dist":{"shasum":"a37f47cf888531fb52ca2a512e622f7c15b6903e","integrity":"sha512-XISVppb0Lh2vlif+Tki2+4aiIKhnejES3qmf1PP5Cjvz9YKwyzSuqbBJW/rnc0l25B9Re7PpXxLsmW5hmBMaHQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.efbb7f7c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7i+9CRA9TVsSAnZWagAAOO8P/iByrU+TKXV1DQBNec8/\nRuQb6+JAeAkwmWhbimHl80XYZ2rSoZ+bLJGU3X50JSbtrUOAgf2M+RixOz+x\nGkjY7vpfMeneWLQPFll1scvXj/BMuw5ohS5H/kF1Fx8Yp6vIn3xfD1dD1CcL\nqFDoxYPVHWT8yTdBcjMEiGW0y1qaDeMJNrhOEwXJDpXQgWh/0C5luRBFh4g9\n87C9LFscgE5esL/WlFT0r88ycMgK0NmaFWnGo5oKVrCUT5+PqtgQRTlSxeye\nzr3m2ewuntOvtVHmqT2eyuG/gL1fzwi3//Z4WKBFDUZpbQdy4Bm7xY4x+ems\nrF66UyCPKVO5Dm7iAa7GWiBxA0WQDm/0pU6WR4IMaQKqzomfEF+lvwuRaHGi\nk3zoik1kbhuPynZ0bDsZl+1rj3yh/+JeedgcL2JA+mtO0K1fjJpYijLk9Xls\nRqLKcP4Aff2mfOBI/rgD667q3Qe7fRo7S9zs+Kr+PRxo7IEER/I/b6bCfCT9\n5eMNthYMP5QMJfd1dnceQSjyns7/oyOIjZ2lfLCQZg64QVHC6dZggkKsTyne\n58sbkUv2MCXT1OwqCCau5efPQKbjNgQwxrqqsiaAyopFE2/HQoEEQ8Po+0TZ\n8OVU7n60uFr940TrKDp7bejq0v86X3mdgz/OXqJQwDmo52KBf0aZKWy0b6CV\nn9Kv\r\n=gnbA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFnECqQg5yAU7dtWgNDDejZBJ4LtBZmDMV0p9NX98MzvAiEAlEm0rJF+yjz2Nd7XUMxnxXYtk2lPvfxeVsYbRv89W9M="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.efbb7f7c_1542336444439_0.21060137224854958"},"_hasShrinkwrap":false},"0.14.0-alpha.3ed7fee8":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.3ed7fee8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.3ed7fee8","dist":{"shasum":"b0ecfe30ddf7f89b981cc49577e895b0645bef2d","integrity":"sha512-LSr7nKrxdceVlYrAabjBG+QUEQFiVG6lNRhsVN0nm8uhkYXpwBMuVej1q9QeGvl0p2tiaUg28ETtuVw8KJVDXg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.3ed7fee8.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7jcJCRA9TVsSAnZWagAADzkP/2yZPEHIMH6w1ja8/Nyu\nqRKQ1ktQU+eqRc+uWucRgtkTpPhVB+Zg9DXXnZuykaJHdMk+a9nTJlgDvyP+\nUYbYB7vGmrs1XGqmf6UeRr19WFNE54OLb5BBAW4NZLn5GRYfRcXUT1Qk1LSC\nhdBZtDxAogctziYWJQ1dEiA7P5beBPmKtAyol0zexgkJiPRnyu+igoc6PMox\nUofhzKPq0ubaZRgBLrVADvMtC301C4rmX/IdmppDcHPr01fmmET3bQv75o0p\ne8qsdQnlFS7HgcUS/QICQDWqjyGca76UJ8r1Is2BZ3D3namXd92S0vfe+4RI\nyxMSqNUWZI6z4+TCKZVBrNU3ioA/rDwjIAjZAe9eI3Wrbc3gN8VyiD5iq5m1\n001V3aEjBFDwrBtpf2MqZYDr4DKz3UOkkr8g+Idnufwybm5Q0vR1uVYk0wKZ\n/DmhWR/3sAZGTzbB75HE4A7J+lwkOIZv65ALBK4osAp3EEJ2qG8Bj/i3yaiz\nQFFmM429ucU9vQjI6iaurx0ZweWstydlzherfIthnHtFN2wPl+rnDL2ig00G\nwKzQA5pBsMBh//1nh2IGySx4MnEJrsYrqf7YSGFDehEXqA9GDXxLXIP5/UYP\nnE+g9NWYxSmM/nIbun9A/Q/0QsLU/kF46uOfwaN45MLyT7vucmEL5EYcRx1l\nq/a4\r\n=oj+z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrol0xp5jDt27WbsotVIIMeFT/O4KTpnGvkT6gLRobGwIgJA6zY13UaD4Mt5vlwjutWkxi4a26RH+6UxWr/f/Tk9w="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.3ed7fee8_1542338312791_0.6479328616934756"},"_hasShrinkwrap":false},"0.14.0-alpha.876b8e36":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.876b8e36","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.876b8e36","dist":{"shasum":"66479bb1b13af7377a12ab28ac82634009c45382","integrity":"sha512-2DJX8n2tqeJEvEr/oApRnVvtz4+x+XdFu2894/c/jKaaiPbuijs6q0/SJoyJ1ACNqwnK3dXlO2FyseRUyCxp1w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.876b8e36.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7nskCRA9TVsSAnZWagAA15YP+wWWHXuT7pVasIXdrVpU\nCsTQsJDuhNrzDKHNGJSYja1/EfRrw1v926v4ii1vK9JwTZMcI8VxenOp6ahO\nuODPrlPBPmVgqjbaTywW4T6+4ISnmxM1EGnzLZXY8jsFuUJJp5G6MaEognkt\nK3y3YnDN153bpW5ii97EqUJSz5Bv10EZ5R/QdBGtxphgXMdH5+0Q+/bwQNCZ\nhHp03JlL5fYkLtT0IEoiwthvl4s1MfMv3G5qHT+hGhxEYfZfAwAdbjo5k4BE\nfi4NnM1pewHpjq22fSprnsiVQnW77tzzCqWAafJA3sCEZzxUfTQhROSgHTAn\nOqrSgvkGNsUIlWXLv0vA129E3581s1loWnyhfczfLo01sinkNpvbungSoNLe\nehO0tu7zhohRMspLcN41SzFkyNrpbqAy9SiwpRljrhVKKCn2Sd+NhH47hetP\nIH8ftkJh7xEPTFpmvTv9AtAyu8woGxP/u+xgDa8oT/WTgKCgfk0Xeq89ZTJR\ngtdw/Iq8jZot6YFomCWQc0/z38zBkBTYUbTIGw9JNmJaeA0+2+HjfJUMPQTA\ni3jR0DMQ1ofR8YkebEaprFPuKpBXODd/tgwovk8CkgQO9AzEB5BRkcZWXjqM\n2kJmcyraK796tF9+dkiwtD8bzojEaVaU8rjAo71X8Bl5LzNCOagd5f0OhtN1\nijGc\r\n=L0Xs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQAKfLQC29+rVz57gngN9yt04mK/novEnESLmQ4iegWgIhAL2LqmChgvQ8N9D3yGD0cyG8qQFQprR5Wba908A/yXf0"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.876b8e36_1542355748019_0.8849993453995912"},"_hasShrinkwrap":false},"0.14.0-alpha.390507c0":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.390507c0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.390507c0","dist":{"shasum":"e41d6322f64a3dae9bb67738ba1e0e8508f25373","integrity":"sha512-wL/oxMtQyfi0vi7DvnVAv7qrjSX/FkeofitCW3tAL7lpuwwk3T6DhX8sKA+kKkeQUvp1yPciBF3uwoC+rF0waA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.390507c0.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7ntCCRA9TVsSAnZWagAAs68P/RnBDyQN/wYnxuXw+5Kz\n9Ls2QV27EPvqhnhp440aelosRha5esQMXn/737KGG36WMtXSU6PzwlccvtSD\nOiA6oV1d9nxKPjkPRb7HiQlLuLSg9eUaQEzJ+U3yFfsI7VT5NQ3DzmfxaldY\nd6wyXM7Nxq4Vs7UodiNr8VP0W0zydG5X+MGhcp2TgU2vi6oMsl1EME1IUqT9\n1m3tViv/8Z/6IV0y86CNxBCocgVP+w5YCZKE4xlr5GJ/IRDi9OwGZ2F8xhPO\nS4WYTu//3LdWFu6Y4XMZwiz4oplJ9rRsK/ON95IbyJsvdk0dohphghDFMH9y\nF2XDGSemtertm0AYoP+XIrAzqbALgK4r9fU4jHMNGJVqffWIchUlMgRXYnnW\nvNutFAABGMSeEmfN4w2iNdrVZdrfryxs+KF7BYKUiiR2+5AsBmxgBfY1JF1A\nVyFj7+lmyWiqg4XIsJQQqvZHKTpJpYsw1PJckjjH7EX6RvZSyVBkHM0ZxkZG\n50PzFCW78zA+bQ6KIxsTiADFMlBATXomoJBoA/NQp4DzShh5zQ3beszuIXtE\nY0nKV4MxFu0/8/u1j7IYV89RtOJVzw8cyFjJkHsjG+cfF6EvXjZyCz7DUm8y\nb5D8eREqjMB/Ta91Rzu0LPCp8NFkT7Ey/PFqFwYScc5aPyvrspYIJsQ0aPWp\ns0Dl\r\n=4EpV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIERH/UeD5L1NrfTagO+/wGCJfuTRPhi04+bEstKSoF60AiAQ6jIcRPSBbHgW3o7P/8S3jU0un1aPoY8tJh5bQlV6gg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.390507c0_1542355778144_0.41090088462584173"},"_hasShrinkwrap":false},"0.14.0-alpha.eb34babc":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.eb34babc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.eb34babc","dist":{"shasum":"f4113a1f90b780e26858edf1098d6d971dd8e576","integrity":"sha512-H1z3Pzc/9bNmKvD+BuM+92FLuyWtsTYEYe3wOw+Wj0c5C8hKfD9nOX/ixx/C1wiGtyzEl0GvanaTsZibHyjBWA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.eb34babc.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7nvnCRA9TVsSAnZWagAAvC8P/jpl+WWsG0TQ98ET/s1R\nWA4XuFwEDrDjwn3EgEnNhZMiWo4Bae/IZh7NzTenByse0zXD+wThICoRjKQy\n/VRfuiDTgRcU6Xad7xmzTTNSZQQxABNLHV/DyUJQ12O05n0gkQtR3A3ISq/J\nTBNsHfJpvFCG2lyooZnenqzKxKGNHzyPDus78tCNQLAUQq5Aj/SVIK7vumkH\n+2ivkjxelX+wTBNZIvu0zHhI3F8St6zvBzntcnQg6LpQQL6dpRI7IxRakSBX\nMxVEdCoNvOpUhNPSKlTlmL21KwQJX5zT1i3KpYLxtvaWTdl6bhHGTamNDaBd\ngW0vdngS58P78A41EQ6BvafpnlgML7xwTC+SsdAQeBm+f7DVn2nblTojh1Fm\nFEFCPFa1Y4wEFnVNpB2eBgX5nWEJCda9MQ5r3mqim6YccZYIvFtwHAajIOzT\nJr+sP0t0pYdKFKfInkJos+B6RvixfOqoeFcbzJrIoLL7Omp+7YPRRpVhVy6Y\nCKhY/izZo4vp60zT7EWpM9GfFPRwjlNjRkOpf7nMHlWzhiW7zq3vWkXc8xG8\n4qgXEnspBM3Mf/kvY1jXAknfarQNIYkpsDB0Dyi9al1pDQt4o0InRlnMJJ4b\nHke9PbGkNXRQrJM0cA3RZ8M4gLSU085GPtfj7qtHBEOM9DMwiSTJNZftKBPt\nuoIg\r\n=ZDtu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoebPW3QpTpzN4LhSBikbbd58dOMpjlQgpo722TaVKIAIgbRkc3XOZqf0AIa2WXAl0C/Z+FH2DDKVJSHJOeCI1xyU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.eb34babc_1542355942503_0.8272719576326817"},"_hasShrinkwrap":false},"0.14.0-alpha.a1c4e35d":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.a1c4e35d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.a1c4e35d","dist":{"shasum":"f615b868b035e24dfba5fdd98a6288bca00fb178","integrity":"sha512-5TS9kXdrUGSQszRUnBvy7pLO/aDLsqlNaGQe8F9ILDkbOEGirzHxAhD4gajN5iA6FeWDPz/RdlTSReEwhp9tJA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.a1c4e35d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7oEvCRA9TVsSAnZWagAAfmAP+wQZXW4B26H0Af7Vwntk\n9boyflbgM2SibV4Hj4YxpNbd/aqCRgaYBrY6PI7DLJ9NnxYR+X1EmdKjUbVl\n4VVDEWcY17LjvJeqJ+3DrPOWtcl/I58lPZ33huMn30jYvCa3SRfmNiDNJ+vC\n2uzKQvLoTX3i37M5nil6/2BLOkSzIu0PCixlBpFpbjZQf4v1KUkdYvGua6Cn\ng3YPKlyX53WpPXTM6sRjvzb7gquauvnLI1zGo4ldUo/53t3JJI/XVLPzW3G5\nYHXbllNYW/iNrFU4eagKY9fctYnpd6A5h/BkpvWcWwD3nPCdVxrJd2kDhivj\nHyuL8IKjqL/9o7G/jt1c/ezujZNrqIoS9WaIo0hzzD2TtUVrf3Pl+4UuNFQN\nBQdfRChKA77XzhmL5ErlSwjJ8DAQjLzma7wkfLW05Ys5gLO5E8QcKRTenEiv\nPsAlJuO1rXYZkpwOmeTOhuNYRkhu5dqRxq3fjQx270nDC0YYAoo8GYk4J4E+\nPTImrFLtdt7DtQNvr5sXzXCAEe14YmS+Pkaz6cxfcWeLG9IJS7Ho+Mq9bLdM\nwEDY2b5WtmFcRLDeEx+JESQvmh3w23aq+uoEdV4aoSXXcwfmYt1WnXvar3VK\nRDEg9El2EQ3RMaiI+WyBx7J+EF3ZfNC50+ElC1HdhDU6lxlAU6KqldcnuioL\nS28N\r\n=u+EF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwb3pd2CugP0AAVzjV+cNAZsjVQ7bAMz2Yl9Mi2/+YyQIhANpF4bZekv3yvQMc5f8MVV9ht7KZbPrOAn3Mp1Zk8VkO"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.a1c4e35d_1542357294506_0.55100312770623"},"_hasShrinkwrap":false},"0.14.0-alpha.56514cb5":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.56514cb5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.56514cb5","dist":{"shasum":"1c04add0bd8e7882d24c4863575abe4dc5a1ecc7","integrity":"sha512-N1diawipvyVDYDViVWJoK92w9GdFq17R43xZUnwtIxQ0MJEJuBFY7LhGUgKicvaEoVRY3GRgo8l9GQ/Za/Oo0g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.56514cb5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7oJECRA9TVsSAnZWagAAYGkP/0M/cZMmtYB275lNHsmh\nbRVuK4q5iaruVlIsEj02PzAJ+I26kUXm/2ECNydEGl3U6tmPfSXJ1jgpZu+S\nAV0UwPAi0klhW7FWscZ0uQdQoa66GWtIqkiizjnR94lwrjgp/Mw6G4gBDc56\nynfzZIAu9lb7TXdwm9STx7780Lmc8NetJjusZAUgtictyeK5acsn+fiok2Wb\nvmDT0VeseY/XEKNETKUC6l9J5bxy1QxlcEl1wTlRWQ6bdGqs/UFJDq0ahjKi\nKDnYuSD7X3GbzgDWLQzI5v1dAm4uhFa1lBvxlmb7c7rNQYavq+Rc3Vl4aZX8\n6I8Q9jCnTFBLRhBVgR6cjsIjRNy8BMIRXTqqiNL4rvsrXtSyIUd0XwlhZkW/\nhJTdp3kVh9Sa82HMRD14KQxuAUs7dAlnr/9p1gSDiIegszo1osEhA+9jgGyM\nBI5vod8pGkP6bd8sVZLqvCqto94bZ1Qj+hEJu6RVVOTcY2RkQCw0XII/GBj2\nBpaSR6/gGKcH0d4PW972ztVoHvfxluriAAxOm4EM6CMEH7slipDSV/VbUISK\nz/dzq5OUHlqWg/SzwnVwpbXPOrEO9pKQWluxOhZ/4yvIYIX06T3F9YmeeeuA\nLBS8oJz2wGVV4GrNHo4nf3W6KZxvjuvq3Yu8MRPPFiDQVFQq6F0xcaBkNime\n/gMR\r\n=GcJh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzsiXTSzGqdIIh8G8VFxOF2OqgJiVmY4AdOWnbxFL6BgIhAIoMC2raVuN79oYj9rimGuMLNC6aeeTYSLK/7RV9+bmr"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.56514cb5_1542357571923_0.8747549203782168"},"_hasShrinkwrap":false},"0.14.0-alpha.fffccefb":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.fffccefb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.fffccefb","dist":{"shasum":"d00285c9927a134a54d5325dedd4bc7a9e2e752d","integrity":"sha512-wcJBrKhIgClbxksjqQHXRnZs7/DVSZOP2bmZjSh3gKOfxmP1WpYu73EymZCpAxHNahKlERaYnSpwVdsfj1TaHA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.fffccefb.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7ohxCRA9TVsSAnZWagAAAxkP/2DSGPpwSS1yPZ7AE+es\nEB95yG3cf5WwY3/tSOq9KgxEz2LyGXil8Po+oSZft+mu53+rroZ7C+Ou5BDp\nt/Orr0j5DzC3wJhE7AVoyZs0fKxwOpSdXHOQ1qB1xFfNERjBlSRRi3yf/4qO\nNJ/pZ61eUHFnHAzwWy0Gvc/7Wi6g49/A7pWCeDb3+7IIyfT0YRcgmMlHEovR\nK0smpYE2gbBXrQbb36i/hZVtQVoMxuYPSoTCPfYUArUy5Lz95nquHEowLPI1\nadp4FA7zeVkWUqlp1UEsJOGWa+dtpNXRoQZviIkoqMd2KZu0hTErWmDQcTHo\nx+2V3qHbIKB+BaggE4CiF6oLHRvmDeCx2RG5KzCAMba1q2taAYYEFurhxOEq\nLDzwKRhDpgjt//2xdViooMyfHfWIIKigxKayRNG0sbp7MgAjh7Nc16dle6qL\n8T7cNXK9CDY/0gZ63xZxtIlg6/d2LJY0p8JWnamNXHQThKEmfiOv8aRnkldh\ne2l1PObjlx39DKt+7BqVYMeGiq7JhTafF5LjgbQ3ExMQpbxpaNEJT/NTlwp9\nY6XJBBxtHtuv0XKWYD145PZlGK6bJFiimxIOYVeBXBoQkW568gpQbkCqywgY\nRx3C4KfmRgqaTXOX8tJOAdIdig6KIQGeDPx+YUMSIfRlSuyPh5lYDy/iiZzO\nBxiK\r\n=4Fga\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDv6LtLy3FKY7f54KRJ160dpJQPjpe4uGe2/Vn2kzncugIhAJCGD83m279YrNun8Gs5A4MP2lJk8lj0PMgP48wiBZ0c"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.fffccefb_1542359152411_0.8134855450260237"},"_hasShrinkwrap":false},"0.14.0-alpha.c42826a4":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.c42826a4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.c42826a4","dist":{"shasum":"5314f68d9ccb0232a1488aa33f102b16fd65ef5a","integrity":"sha512-CoW4CbC/StxZmdqOvgtW+DkoROZgDs4pqrpDPlsTGvfp7zB/yVBk9+6DPcFHe4Z7xtJjABGE8a3O3N5yx4GCiQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.c42826a4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7olZCRA9TVsSAnZWagAArfAP/0tupA88A7S3Jg0q4eKC\n0czyFPIZcX2H6H3NqvKb1Oya1ZiWGOJIq6WMQ3wxcZ9lpVeIvVZNSSr/481L\nYO8SO9vgPWj5GlzypeTpRjn6jeTybHVyd01aCj8KDqV/0qVCfpGRqQ9emyQl\n490s7M8pi3N10RqLnejoIH5T9+1CupVzZnQWvzC+KAFJvJljHcOWbRmpdKdu\nif055b7ZKTmpJxxcraxcztg4wtWJpIKERbtsiL7vsZZBzyjhYY7qNgtmePYQ\nlfcZyPXR7ZjOxiEheR+6NmsSggdjX/FbnmW93X/eDf7J14/YohoiUseq4vHp\nHRTmlSV+GCV0Z8seg9c0nwQV6AMvDrYu+RqzzP2+pzDzKpZgpl3T/ITNRQKp\nQO22WubdYO/6MU4wFKLW4LtTeB+drb3x+Ui5oaAeVsNPpDXx8g2uB2jbBzpB\njgt8gbJHOlW/X6fOG6W5RYUutLZifiNe9vWoagd9Avuc5IWJRS7oE3bnfigg\nNkfsmKPsbu7VkPDuA0Dp/0SdAranVZZaZKr2x/brg78kDWQ4NXzvJbWHotEn\nTHIsxe7xcealQtagNWGliOE3j9Cp25e6ur8tLQfcsgIrejJWmrvdegQvDAHY\nZuwQ2WspYY6PI6cR87Ix5h1TFuKqlTt32lLWHmMeXwMyvFV8Fs1mYmo895yx\n3VD3\r\n=7xQF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHfhfmGN6quBNgdRmkeR2Oqp7GYzH/cnh3fppBvgF6oKAiBAnd5QViAs8HP+TZ3Jp+zx5d1wAyxfvtqEYnxorUjDXg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.c42826a4_1542359384955_0.1285284025328215"},"_hasShrinkwrap":false},"0.14.0-alpha.d6839e6f":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.d6839e6f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.d6839e6f","dist":{"shasum":"59944e9028b71634f545ed9c85d642f44c682424","integrity":"sha512-vD1seGduM6rRTXJRRsFriHMErsllfbugZL9cclGmR0fjgunXe4ayMyS6sJI1w//pM2+/EH37xt3CGPL9LU5Z6Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.d6839e6f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7pJPCRA9TVsSAnZWagAAZoEP/juCzqqMaGDQ2O8OnvbM\n8kM9SDyBw0FxZv8l09IeEILVI1k6pIXZgA8+lvS4jOzI0OmeUNRf9aKNpoXD\nbV28MZ/dxWO4k4gy1GjqUwtRf/k1CeLOBeAxNvoO8ipIAWQBV2BHUnvedWzB\nNZFD3Dl6gVznNaGYxXeMVZxEmOPh+g8xxc9axAxJOva8bH4ULPjDprsRA27k\nZDXbgjtuQ0lsMImsbj7S6WVeJKm78cEmSdVH73e/Vy6Dxn/W1w1avQn6yy8U\nnd2e/iPnjhL6agJLWUzXfFs/fYW81/WgPPSEKyhkO+7Xf5lPYKhUAHAxkA34\n2OsvCYDnb2MmWsfMQb4KmPNQEea/ruA4VRFNfzOSuQ0OtyuDYHdeyeKJmO/e\nly1hIIpjGecnP52u6IAv8TPfc46kMn1lRSICXagsUScpyoV4dFn6BYyLpBvB\nVqzlP/rOkyxIyHLKL+RERLM0WJw1cS8113f/Dc22sHfXG1noXsCnj/NQ5Cve\n5RdkRXj+YEL26S+KIl6osI65K4x36JxLO0eaiA+dTt8RKxE/8iIx8DEihdWF\noZQrNjRC7piFb07u+l9pClrFhWrwerJTZc20a5re12Hspi5o1mArrPXxC8om\nciVCGpKbpp8f6333QH/RmUD/LPtoKAr4xzb46iriklcjWNJdA/zyqJXzEQop\nKTKn\r\n=zg/5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDc1gRO5h/yxF3++uDlgKs2RJ9BYXU2yFhMiFnDnsyQPwIhAP4nJryAnM8dtVkMelnPo53jkNW+5oIZY9m6bpT9i7IV"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.d6839e6f_1542361678850_0.37254120005231917"},"_hasShrinkwrap":false},"0.14.0-alpha.5e4ba2a9":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.5e4ba2a9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.5e4ba2a9","dist":{"shasum":"ec006855fc187d987c6da5d105a60a7b2a74cea6","integrity":"sha512-tfGbmiRrSKuYbKCzZDsTD4uLOAcThrAk84WZQSCcV/2e4JcuDhZiqaOokmFtB/4c4iBoRHdqGxggL1QhlG20VQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.5e4ba2a9.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7pQTCRA9TVsSAnZWagAAEMQP/2VNsc6TxHVk+N95/A9g\nktFOtd4XoCBEzrjN4JwfvFHfScMjU2nojcPBqFFSoP4eh05VhrhWk6SAOc5c\nnSW+ywLHzh7JPhbp/L78a9GgT3InEL2a8MDEHbvNJ9omYc1dAi3/S0fjSWax\nPXf3qM1Ri+eVgd4ShD3KOEc/Ws/FmYUwRnWRisFiwEzbSdazfNaLAx+yBSAj\nR2P7caSWtSmcrRk7+Jsjdr1afr78lexSUTpzehHaMFBlzpJaYYSWlHdHJ3Hl\nX8gOll+SSfs79UC2MyCQuAit4SIBhO90uXTiJZo4RDL15bb0HCXHNwifs8oD\nEQ26HgsWA/tnFFmkWRRiU/t4pMxTZAE+tVZ8Dvp3W0FkMrNr0ZxxkV9KQL8/\nrKzkR8rFhJelChds9xAvGR0Kc23cB8uCVbqhDar9rnSVFz4REusMexKnMPwD\ntSRWNzjcdopdRKs1TByYqELB0z0xGbfXpPrznSNniiXQZX64k4Qbme3vVRRY\nN9Jizh3H7OAPrkTkR7P5LK02/ashwIP/JfirNpfWwMpLjUEi1YvwCyqyymIf\nUwE+AiMauqa02oKSB26Crnbsue12t1DIOEnBAbDcvzQV6UZk50/C2BeNfnlX\n1g1yl3AgS0aUfVDuU0mVHwX25IM0ysNbo1g+5LsahYiL0BPTw4QkXmnxOB+6\n8Qhe\r\n=pG7Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAWqeRxpDN0Gozq6Uj3FkWeXy/RmwgMjBRT/Kt0IXWCFAiBTAkI+FksMqmKKSePMCAQufsxaJJvNHVBMIcN7iMJ1lA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.5e4ba2a9_1542362130829_0.8822201499857791"},"_hasShrinkwrap":false},"0.14.0-alpha.cc0d6e1f":{"name":"codegen-templates-scripts","version":"0.14.0-alpha.cc0d6e1f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0-alpha.cc0d6e1f","dist":{"shasum":"7d5580b3ebb789cbb15f0a6a612f4c4b3941eb09","integrity":"sha512-yWUtl7jxta2FHE+IhuOlk1VHtnc+kLdJyIKSNdkXcrRCPoHxpwh3Za0wVRtbGlaMAImhsCVxo+SAAU4lGlVFnQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0-alpha.cc0d6e1f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7p3mCRA9TVsSAnZWagAAydEP/15jT4V6lm5mdahDN+MP\nv7xF6emSMmCii4lI+QU+OYNk5VA7Tu8IwWv00LN9RmIzmbwWOiJ7hSBoTboK\nLpMo4i2aJSkJG5HTnudTUHXq96NUakoAvYP32tXDvtLaNEWZt7j0mtHnOVWu\nO7frBT3Fj7Q/HP+ori716Z7Puac37z15wsqutdhIzuNU0uT7A9WwJXMYepvd\nXteMnLjwdhUZpd4BvyrmvU1JfnAkuWC98xRYxEvmozHG4HjjaTdYdRLriXqO\nObTb0nD8tfjR+qUzT8B91VJj6H1wbuGdWKC9Px1nAuzNIei2fvdwWMsYRaNl\nxPdky5hpeVT6NMnEr39phNbB6JGT8gb9jY/Q3gcUflay0DGJSweNAfjZxnG6\n1QG3RUX0x6SB5h2k7ZLD+F0aZkiuOydIK5C9p9+pDMZid0OkWpnQWq+B3RhI\n2AdKuU7cV2EvoUczm0DJvNQu2+0B6LJMVs5gyq3HI+15fgqH1DWMxw12608G\nB6PJRvs6soZDO5fCDhgYkLWyRXm//HIikHOFQs/aMdta6PXTLXzmHkQpH6LS\nAcr5pfMXu+0goCj9zm3PWWPmq3HyMz4OZFH0HIdNy+mJpey9pyNj52vk3QP6\nSvSGuBslSpc0+plVlhffUVQ7ON8enNVM+Oen52qHgs5ah3yeorPRP5XxGlDf\n+TQc\r\n=CAfs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCO6dcxD2JjP6kp4MROVZq489HIxoiPVdmmG4EHOPtLEgIhALV4/FOtTuvocGfu3gYhBmqSjPAOynXeoy50ILt0Ou7M"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0-alpha.cc0d6e1f_1542364644766_0.7882823622750723"},"_hasShrinkwrap":false},"0.14.0":{"name":"codegen-templates-scripts","version":"0.14.0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.0","dist":{"shasum":"60ab087b86fdd7d7d7cc098575797cc7adcefbcf","integrity":"sha512-O8wOgGELAvndfox8S9ZWlY49IL7Im0ro6urvsl7akniJz4reO4XF6Ox13BtMQsi7r29s/dCQll7mmojAtSu7uQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.0.tgz","fileCount":22,"unpackedSize":16711,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7p+0CRA9TVsSAnZWagAAwfMP/0lHfI1ViYNj4lBugB3r\nAmSSUCLq2NrdweHzARVB1XdJc89PdKWhuotRkf8MtozCJGLqpwRxzPQ9LMHc\n2VXfnfEGlqw8M7rdFFQ2vTPhGaTzhz+pXfJ99AuKWsQOk3itYDf8OH5xbbfH\nCLyBrcy/e16rOjzdv67EL4meOp9DXykEBfUlKoKou0mz7YzyfRuU4SHrCXW/\ngOg4tySmFEuAud0A3qkKtO220nODJc18LZHwUOxwxHvARyoD31iWyOCIsrhb\nl4ndu9/NpYvhA2oJNogp2ASQJ6NrIguzRoDCpPalqugdC3Wmijzi0gykODau\np0Ceu0PuFhz5EPmpv0AWIO8HOmxElQFj5Lz2X/Htrnn/oCFVi21h52aSL/4r\n+oXdnL5B0jGTvhSxA2EfjysAkN0k5tCaAIsFmLD6Na5nrvhGGjc/3XnyjzuV\ndtcnd2jejiy+OMoNkeeqrrftFX4oaIDkUQUA8CHRVUhub1ceF5aGEjRCQbMG\neIOJBjAIVXMg6mNbrc3iR0HpgnFG43nXDQJVb6+Pzy35/c9EqD8JYXSlf0w9\nEsUd6Up24MQsqI7pupLZ4LFSxy8dbHVT7iqDNjyYwu0xvFbvgmIIkUpSG5x9\nAT8GlgDNggR+IcrDcsgJYR0BZ/sVOalO1/756fk/HTN6Q5KfUbXibBNi1LsS\ndHio\r\n=hVhP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/49xI9cChX151sZpdj0kEwDDCwsUK/0IvjbPls8bxggIhAJOc3eGTsnmwBS5m8KKTQFGLnH17OpK2m3LkgJRs50N8"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.0_1542365107443_0.5925780113820274"},"_hasShrinkwrap":false},"0.15.0-alpha.bf38b87b":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.bf38b87b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.bf38b87b","dist":{"shasum":"154ddd9f3a211850fb009758a8be6033a9a77298","integrity":"sha512-hrJ8wkJ2BwZY5GqgPL5Ooor/H/kACf+8z+Rqt/8QcLz/qNHgznlDXOcZpMm6wpXzhIMZIfTyB6Y6wwQvrojZPA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.bf38b87b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7zoFCRA9TVsSAnZWagAABvkP/Au76J0fgrK8D3oOioyE\nuPILC5wdxPQ2u3BF7bBggVdf5wNdLOZwUMx6AfH7Yoy3Z6Hly1CsLNtdUpD/\nCNxY2WgFfJNFFIhK2ItB2EHOTojwud9lzloUYyt9BtJRzGrGPuFxk7TKmiDU\nqFbcS1Smyp5qFQvJhyrxUM737NFvmalk1YAhMqVRrR1xVl3w0/pmIjK121FC\na3m3ONA1MbL5UbMiXJf3bQWAYWEGjr+ce9lRvrH/gacatnZv122YytV9/CI1\nOgcpBZV36MgI5za1FCn7/lYC1Wnhii2qnuqV76+/9mTN2rrp2aNutxWkw/GL\nE3Bdl1u6WWHQ0C299jQWIO71ry9LxVPbPgFpu+ovFjcGxe/x5sD6vPkwSDtM\nqN1PLy02tUkvbUDshL3DXuGIRHUASYq8h+S6fZqyrfrvwJp7Pw7tJA0dsC9G\nS/N5ELiqEodlHAxgcdLBEqHSHm9mM8G5tL6dxVyXXahpQ2Vge1ivklPdJ/0+\nRSmlOd3WM7mRcKUqXvnUZFbLpmPNQlykn8iclYEfQCFomW3QJ7gYMJOBCmya\n4tMMqa2PzDjHo62cd5vmn3/Vb6xfISU4q9ioHGBhTT7845w6vTfeAWITS1Qp\n2wAYb4+A3s9p2mcDSxKrq0uTOmUUe51YB9U7D7oAzfIeqNeVnymY00hwemq0\nEnW4\r\n=qiDa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAKCIWN3RtPlJJG6M+aWQaQnwN9A8t3kmRyZqpmxPeggAiEAwjAOESV+N9IRBp2hLOTZynjhpemCN14KszGFhoFd46s="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.bf38b87b_1542404613014_0.9353781614562566"},"_hasShrinkwrap":false},"0.15.0-alpha.5458e7b4":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.5458e7b4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.5458e7b4","dist":{"shasum":"7e9d32f98da1ca3c6c9df87efe82717424a05605","integrity":"sha512-/E+WMjvyX1Wv9hMvGUiU00Fp/HHWw17R5p9tzMyChqIbXsCfwWNu2u4Vq9rFt83HZsWmHY4GxiSg8JRy+hIlCg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.5458e7b4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb70Y2CRA9TVsSAnZWagAANzoP/iBMrqszdUv38VsxsSnO\no07cyy0KQzgETc1f7McPdien//IhAkTmq1jHAkoH9PANG68MaIl6o3C616SW\nfcQUMyWhFdirXm1q7IozmPQIVPNAs8TAu5AAukACl5hkvLB4HLBRBsA7c62B\nW9yt6RS5LJFrcQzs8zfIGkEorqgAW7NB+NNhszTL3CcJJgCXaLsytmPvccJW\nvH+tG3wobc7nE4t6NY954kG/zvFARw/BQy6xE90cnxs7HeYN8DnZ94Hz/dc6\nmsm3UIThATLTsap9B3VcQ9e0ZBCIDG3r14oITnuRXPJi0UxT9ZNZ9A+7Bd3k\nAoI2x4JVvoeO3TDG1pjyR7135sbTma+uOH0+2F9iH8mCjxrO0+GquS87wI8c\noW2ZpluNvmBxwKeCMuajW5rbr2nufQTVMGAmGO8zRALm3AkJoo2HjWaPi5TJ\nmJUBc1a7XoDUKMCtaazWpmDJh2WDjDKIm8uNxoTC1L0ILqMrMLnf7UB0qrP7\nETAA9wTmV0M/WCa0BKk0qN2jvoy7LwOKRGGsnDOqGbHN6ZL6mxjJf/GCP7+Q\nGNnj4zy/evRn2JOco4Cnx6oeCv+YLwNFkg0IcapBOe+jjX0IqKg/FPX76ljo\n5AW3v0Y+0JMqsmes+WxEQOoCCnakN1f2a17AaNK9djk4PYmFapmoXpYdLBvT\nssK3\r\n=qI+m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAt0NcMerySbEbVu20he9tEk8oZb7zkBmotFMDtZgW36AiAeiENJiqLVImlIfuC8h+7EAH6fqDf1vaq7mD1MVa1Djw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.5458e7b4_1542407733644_0.9873124233809671"},"_hasShrinkwrap":false},"0.15.0-alpha.a013b04c":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.a013b04c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.a013b04c","dist":{"shasum":"4b38cd3b77bd621eb1dd7691aa9bc588baf8c1f2","integrity":"sha512-bsZ2g0m3ydpLs8GvLzKyaHs0fuM5YwTBH0G3u/alHKpwPGNtHhcnOIkzwqhuou8eetdajR/gVEMJkpMjci50yg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.a013b04c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb70ZICRA9TVsSAnZWagAA630P/04ekuWuCuD28Yr5gkx7\nfmO2IcHE1OyKWGQx2tP+ywDc6vjZx1GaRZbihomsvDxRG1hNZJg3l19FYDR8\nEpSlkPunZUo2qCvTvY9yIVOOdtVn+6ckk9oGqABvjUhyuc5Q5CgV2x6ZrFK5\n0heDK4VVG+YFjRz5OBW1DT6ca/oScpeMC1TqpcwllPdu8HrkjWcBawU0JTDN\nFq+6SrB/ZVSaenyQx14jOX/nMilT+lwAxcZjA6VslCczOqWVVg2Vg0zwzrN1\nLATIOTFE0UBl3KG1BS2mwhZXQcCxCB/cKH+t+/QDaVMkSLVsFzVvUQEDp3HB\nGwnppfBnJWXTY9EhMOhxw+CyDIfIVcEls2rnbiSX8C14wlx8KRCVeOmkMvgi\nxHWgNjuBvw6EHy8wgMKhmhqYBk2pR75Tngpl579gxMjzrJQNho4Yghzu/wit\nBZXlEXWWQ5uKupvdt7mVJrf/UstUFaSIRoeG/3A6tlfV8Ky5R/ExXin9DjRW\nooYFWGYTPSu319qA02a8ZVMCbXVlZzWeqo3AxYwrXc0DY2mv8+nYvCpJqUl1\nhCYDaoLSGEY+ZLSjLTjodgTm+mnTcPLoOd8Ooof7pHwZ7JLwQtqFcNYv5TVy\nMvzXMA2wl9T4xnlo2m2TEwjSoOr8UfTaa/X2dTZlIMuD/vHTKouiu5VkS0FO\nw3wY\r\n=iCsM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDL3B4JcNMX8NLfiBA6s5S/SBE425ubX8qEXWW2rllJcQIhAO2KCPHaQLlZE85+dezOuaGX9pnIDwiJz7r1aO6SCD6S"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.a013b04c_1542407751499_0.31084205030326095"},"_hasShrinkwrap":false},"0.15.0-alpha.0cfe49ec":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.0cfe49ec","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.0cfe49ec","dist":{"shasum":"4f5ab5b7ccf62d5614a1275fa72ffd3262402c28","integrity":"sha512-HQNh0L29Dhprvk0Vqxij37hg7H9pwd0FzTQi7r51DkjBZjDXxWz+GMcYCjea5Hqi8kR07eqgAfhCtpinjFZXcA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.0cfe49ec.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb70ZVCRA9TVsSAnZWagAAmVgP/32wTgBKP/rXs86XuwiM\nYonvBHAbMqGlbTNFPjVrBIPdmMdlRTUqB0U9tHlp0tmSKu3TpekxOUYIsBg+\n/CoMb2F6DOVUVrzeXCrjZNoU1dV4oL9lP3p3RiuNWc+RX/uvWFRT1iDLdZY6\n/ZPIV37qAFLdCV1b40yKlxMVi9uuQbZ/2MJtezGfvPDaysACpzkH8t60NNXs\nzGZ27goI7xOLnaAx959of1UD2iEU+i2i16jApXFX58iai0+UR4vXi4XDDDAx\nNMS/zyi25xZhH7bi+QuAAn4Ch3ok7xrNFc5r8mX6qTGMgneEM8jPEpWau0s9\nFQbsTldnUUv2sqaacXX/8rQWGu173PkRXoKKTmREyszcG+k17zq6hjh6Qg4l\n/AgHWfN5VdLQk1+UYeOKoaDHc1k2W5gwEsw5IQHsbcf/vng96MuTEzUHD8zw\nEjdPQklDVSj5nseBh9IGsTOR6e/tUqudJu0SsHCFusDkCgKCveUUUSKTb6RH\nIEHM0nTvkAJr5Z0oNpLpPTq3y2m4F2sfAAOYidNr3YDy4StWOfQz3P0TvI9U\nsrYcV+K9UIYYU1YBfooXU7+ifXa/e2fzv/TSz3iCfczgixOd7tsZZEprVfT9\nm3xeEVZLmMEHDBanU4HScX5d7muoqg6VUmH3k4hOaUxmT82fJVJePZN0vAeQ\nPiT+\r\n=pWpu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrjN2ekbI3iV07TeNwpYkjwL0rzPnO0sltkbK5eB9l3gIhAMhlCCho31jWUbtLEv/iWvgCbkKQBNcB54KoSbDhlE/I"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.0cfe49ec_1542407764451_0.31478690872195125"},"_hasShrinkwrap":false},"0.15.0-alpha.8541a1a3":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.8541a1a3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.8541a1a3","dist":{"shasum":"9ffba352e011a624ef4f9eb1c7c1ca51eead04d0","integrity":"sha512-NX+yv2o+chDw2105wWEdbfRonOrR0ijA6EHUF/vLFDxoldruDVTWUEoxhm24nrYBu89NS9cg5093lfkIC96+ZQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.8541a1a3.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb708dCRA9TVsSAnZWagAAQ9gQAJNxeIIiEdoXS+YyCrKX\nhXaiYxGdUZYsrRmXG067IPTme/FUjUvJB0NWDQde9tANoHIY43evCv+B05c+\nQRPF4DvCB2aWVbZlIumgFOBePtvzuvYts8DBLrjp6TlDP7tHm1uKv+zm4dFy\n1LMoTj8z7BWnxwPAzzUcAiNWq/Fya8T+X0+kZntSuI3KXOkRcsAiE99krIf4\npgnhkUnnUXSlunByjX+dZGP2S1AsxVl+oymkYyAtZZKAyBmZJtDcN7Z0i4wj\nFpE83ZWjkntef+xdKspykkrx99I795SiYIRDa/vf2RXKQpuRtwFSV6M5QLnS\nzc08R5koDPHZIlQF7Ba8/snGGhq6QS6Q3jrU7zs9I8SL2HEEO6Lz/MxpmatM\n5KHEdHiOsd6+ihHnhIhq2MUtseaxzAzOhePi/6LjklXaK8sojNkEmsq3pbTJ\n/+47OUzuYFcIewzh5buyMoQckZZfyS+2OJLW/cl2+Z/kEeQ/ZR38tAa0JSBJ\nP/jdQI/kZlQX2rAZDkRiTHcNdTl9BOwWgErRCNwmJXurEbhFg4DzkCNn1wBD\npRCIf7xv34yLAUo8tyGVuTjtr6BUsCwJ8cABgSMAbMuI0NGaYefLpy7vFPvs\nkXpHiijfz2wVbxtjsmckosmeCUkJ3JSO5CeNpCXesMEhrY3Y66MakZ7VxBR/\nyI8H\r\n=TWXH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZarqcda9PEPpejVl18PGQf4g2trx14wJwiwMb4tgGGgIgT7ABFp64MtIncERemRFUuX2Lqvyi66EXJlx9wihEQKM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.8541a1a3_1542410013254_0.7049975115774174"},"_hasShrinkwrap":false},"0.15.0-alpha.bd62c390":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.bd62c390","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.bd62c390","dist":{"shasum":"085911ee57238a4e3e0bff82b29d7ba647877a0a","integrity":"sha512-OBBaQ3udobk4KDhD9FSYv4M7mGiMyA4T96U6VXt3RsMCwNYJVhGxdugAerPLllv0XDwFm7Z7fcupmpqZ+kJhdg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.bd62c390.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7087CRA9TVsSAnZWagAAV5kP/1cyUsy+nb2a1HskzVU+\ntm6aL/X9QYD9vDtCEpCRRF7qeJIGRZqjGYIUtek2pr0d1r56XgJl/m7D5vhc\nKU9/qqdgBcPqUoyUtn666liuRHxvw601DSF/fG4/sgsalz+HmcIJMIlupabJ\nTui7FO33NxhF69dr/hZpj98YuKCW6aoStRw6cwcvEQYP+386QaOkXE+DvwE5\n5ZLEurl++h7FJ/aDYj5hVYyZPT7ZkY0IODTeee7Bm+ACEzjUY9zENIHnl+Zm\n3+pCJ2HUkSC0BL4DGxR0AWqv2Yz8wzSlXcgoCf8+GhcUC1XgoXvevbL6LdTc\neLWxRwADL9gPmb+miWSlerC5zWvISTogl66L76zkmB688MUC0bsWAxJ9YS+W\n2VqEG5H2BDcsbd9F0jQZpQ+nczx91Ul3/T6Ke7J2OQY/Q5Fy5xATsn/KmQ3l\nr8xAHDszM9XMfYWGiuxFURFRtlBN3vzVG845PvS+XDu67p1RcIur1ngAsmyd\nLg8b0qK7lrbRko0yne1XmwpLzBGUoVoCrfZxaz5m0UD+zqKfdjpWKHcJOpLq\n2YZlokeCA4IrtSEjqbE8VeHrY89rLSYtK3e3I/fWXX1nujAJMSEVRgqWaN2U\nBNiiLKtw5Ga/oMXvC3AOWnEbvHFwq9eSprMza+sFUUjtu/4NIUwWycZzm+Hv\n+xCz\r\n=AFn4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPnYarr6yfxZAqBN0f1fNVk09RJay4Ysm9f6hjywzDrAIgUE0tCALhTfvr7KqnGOHUMHmSYbYg1F3QGCVdmRqm8e0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.bd62c390_1542410043082_0.002938983920181659"},"_hasShrinkwrap":false},"0.15.0-alpha.e4e788a4":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.e4e788a4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.e4e788a4","dist":{"shasum":"280c402333e6906fe489d2c27af29bafc947d966","integrity":"sha512-nzwS+KTARk+JWOe+NxU1Sy/Y/O+KMFGUWUyhbaT/iwElS8ObKdx+0IKGcImtlJX+2dbCQvfWr1K9asvj2whvTg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.e4e788a4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb709OCRA9TVsSAnZWagAA8TsP/2S64vN7stMFODjgmnxy\nGENCRYSZmvd6ylsQKyLRWQ7JpOrVgsMh2KD4ny6YCkUyqgG4Sdxcr+F56EGH\ntflqx2cezt6DRQEe5J4X9wQ6QWmsFKKEuFP+WekPARoiVsM3XzJBjaK1nDiy\nYi93Cy6GJMR/AymXqRaVD8H9SmhWcjlUCMOw8q5RiTKqmAb0BAOP+X3F70JC\n/uflHb6rU6keS9ZtexIO8Fr7YvTnDKCjP8YkNfIQNpdLUj9PjgDoTPrnFaDQ\nx+djR5vzZzICMuit96jjAB7LLy3/fg/BlRtknJ8mGw0lfgHqHLKmUtSZghVI\n9mZFpflaAWrhrtWyIBRb+oCvypPFShoXpI8mtVV7wjmVYEu4agYO+yyvewN/\nzkNufbtjyW5dJ/YeiPeKDKJYiRkKPTy2fT8a+scZS9nLIVH5KRErD+8/4AHc\nkk8wGQqOV0ywYV3TUMdeqMaDwSGu6WOuUdziw5tnFw3vTGXGT4aGtyYxDNgO\n36AhXBcaL4if+ULVUylj+Ht71DucdPVjnj06gcjP7OGQNdWdcI60rBdxzb01\nPrkH97AMWteMevv7SMHTJUI1LkD5qhJ+3IyVEn1U0J2upvd4bBB4kervLJI9\nSEAn4hSnNTB4Kr/Bg6YjS8kE+cZ9Kwpw4P9BbNQ5KKwpyfYT69U5YpaYM5yb\nI4N6\r\n=ivH+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBg6FCpj1nThcghk1EHWKzPArVisOdGQG/fb83K7fJzOAiEA3iNsD3Ny13+XegruUWGHgXOnHfU67wS4mt8kvrDKBrU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.e4e788a4_1542410062054_0.047394581971267336"},"_hasShrinkwrap":false},"0.15.0-alpha.5f2a8354":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.5f2a8354","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.5f2a8354","dist":{"shasum":"0d0d93341f804554c88289c05893fd2faa083149","integrity":"sha512-SqfoEv7NIS9b/OuzeIZnkQbHwqVx2Ek6+cSF0qng9AEUgk9X6iVqNi4VzDjpPipP53OmwJDrI3Wet1Rzjp+lFw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.5f2a8354.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb72QFCRA9TVsSAnZWagAAYj4P/3XQ0toTdTno1mR0Guic\nxSJdQa+OYgvEbx34CdV7AWi+T3bJoJ5QFZ/9JFYpcBzyezCV/0pfzVrRZrsb\nD8fKNMnhNJqP/7L54Ccpiw9ieOc0stbS2CFQ62pY29X+ORtxLAqpltFrrVB6\nCtiNRoNvnZyPAQ/xLj4O6BpZI6w36FErYFQItsqFDEgs2f+A2a0eF3jYZMKl\nFbfI4doRfqM6tXWPvf9abxZPCGOaBPOwfqqb3y5dDk1HMsyvZKgF7wTgESRr\nwusgILsGPKoloVKCdyOW1DXtwK7a+iE9AgnL87ue1maB1oRf2YZ+k3diidX2\n42S7Y8nGuOPxFA8fhUxU9NffzCpwYYAluQ5M5Ecm2It2cfo3DPRNE0g8oZZ4\nuf2CB4gH8NGfBhs4mImjgwXy0LbyhdWUQX8Cl6qw9vHi64WSAVrUh75DmMba\nTiqrkk5yhcb8BcAX20QYgQxiggGau52qizNw616EJLjR1P6BPJT1i0sZMqxL\nLT9q2zThNO4eoe9szyTQxwmdUk2a3zwffCFqd7iTK0otoQYWcYltkgIBd0H2\nzZCjcZTk15HAkEdF7O4Xw6yzYIPFZmo3Cf+JSc48uXUQJyRYZLwrZcaQn2Es\nSlA/FptOCWBplYdw2IOd92Yzr9+qYmjcvlmGVTYhoDBJhD4MelHi2BPx1nUs\nddAR\r\n=q5yM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEyBWIDnnfUPu3t/VWC7hGLYgxJ7NldDngGyovVrgIA5AiEA0fRq7BWDhC538zlM30lQOdtNXjIGgDsLW5nNpot11Ss="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.5f2a8354_1542415364136_0.9090356989321817"},"_hasShrinkwrap":false},"0.15.0-alpha.6db34d30":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.6db34d30","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.6db34d30","dist":{"shasum":"687080bc1f5cdb5d96314e0ebe69464ac82bcdd2","integrity":"sha512-QL/ORwzHFgEE5QkkcC+oi/LfV5dj5G1H1mcG0K3XgWkYz8SdiGacSflnZt8yy3wjTRsomptFIW3Cww06JOhlHg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.6db34d30.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb72QoCRA9TVsSAnZWagAA1nYP/REjR5s71utZCPAssaW0\nDA4XcjGGxHk/DhphM3blsuvaZKD4Qmbc7lecHWt/jrlh3lNpUHksarh9pAml\nxZ0o2RQu1jIGemlsjDPjlt7IQZcvHZQh3pWhJJKd7DI4gl2JuVbR8u6X6HUk\nqFTakPWJFN5Hq8s3RWYQwsCBhddexpfgSMF/An54HYd+3lZoEKaXfAMvYuxG\nLqA5gpEuYdc8pX3ZDnkGUREhmXXVSpmjv7wCTIstqxEZqAKOhrSnqkQVRboD\nZid1HlZN+VDVk6YoRWn6+ZRVZQv5OJMhtHUlLoh3UZYOwuKBiInUuUxvwiXs\n1Aq2j2CRhoPUvonJwzON7KnEXaoZXGSm9sV5DOsw35q/jdIoHIT2EQlmDmjI\nH+xTa4l9gBkRCTDGC1/M5Dwk4gfOEJmtancaQwX9VEoj+raKhEA8O3DIDkku\n5EL69sTQT70wUUslC40n6xVGpy6K4BCDTRbud9UgBcqpvbwIugWycM4c0bCX\nvVjRIxKM58vTwtSd7PTPYdQpuABfJU7k4UjXbTTPm6QvuGiWBAv9AUbROx9E\nwJN9L+e8biuPz/oOM4DS8UgvyDgpiwlAwgLPibl6Sb7FJJk+U2UKBrU6A5lp\n3Y6tm+oyuqpZuAVixsjZ9OuKy2vSqjRjyryH439QJLg4VOJKeO0otFNC55k1\npPQ7\r\n=EexU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBwQ7UAfVJVQ/Tw+13IQADauAfbbqKqCKti32vNgfRk5AiEAxKuhxMCMjUgMX0JGIE9VyPebJ9ghYlG4oAVW+tg3kWc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.6db34d30_1542415400326_0.3445892577689271"},"_hasShrinkwrap":false},"0.15.0-alpha.b1f61774":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.b1f61774","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.b1f61774","dist":{"shasum":"61f048052b27c942ac77f822364447440d4a36a1","integrity":"sha512-phY9zYJImE6xDnSr4Z/L3+quWCXJjBYJiKOFYh2Yc3CPkfQupcUMUtKZwBTp6iTtJAQU29TMZLlKKGOPOEhA1g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.b1f61774.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb72RLCRA9TVsSAnZWagAAY5oQAJ2mYuily2ngs8bef69D\n90cCjvYz+XM2x/g6sANv8cn2MjEHlAODQLejQAPOEvgz0S0r1MU6ZR/56/Ne\nTYOG/Nyfdt0FQHNK7ySsPsbLkjqj75VHounxYdRzTg3ejGXuC0E2u3/575cq\nunyLfDB2wfGWG7/SJ+NiqD0BXMp+MbAeiLVfGWFZ2eHHdmt7g00IYpcowrwM\ntjyxH+Xo85/Xr81ebTKP54nqunjqYmbe6bpNbseVTn/A9TcU278gv1kRZw8q\njYUDVShSavH1yEB3+OFxfPoI9FZVa7WC3397NBWcqHWXPuqGeQhdj8KZfiCL\nTc0CzV7tp7cyNVEtl/nFzw41jQj0miD4nuYfUGapCPwzg91nyj5cXey0n8lv\nMqSQDSbRJ+D7owQ4pWOufVu1jMAbyOTcjC3RTF8gPC39uVnXSr5RyPPFk4OD\nu5QjGtvSDkxTRVaJDmqgx01PtpUdo92tdCFuZpA/IT+SWRB/3ipaEacyPCqK\n7QKF3n1U9cwl4LdLsal/rpLSUYYthZyaI7U/ThEyp32zcDcZDOMPYGisueP5\nFFhGFEhfL/iQGK7e0EHhXj2zJIF1iQ6uAEZxwYArMVzGwXWZGXokl6nyFWyW\nqqHZjIXk/9o/S9/wXM2J4Qy5UDRIeXmcgRRmTUAAB0bPhV5ZixMmZd+0mk8H\nQbGm\r\n=WAmt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICSALwrWWkMj16qA9HmCSLtCtiMjBZm8WTHKrv9jPrFiAiBANuJqlpjls+4Kq1ps36PetTeFUvTXmSj32/Wkze0EcQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.b1f61774_1542415435310_0.02809084418322616"},"_hasShrinkwrap":false},"0.15.0-alpha.f389bd15":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.f389bd15","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.f389bd15","dist":{"shasum":"5ff1310d63495be53ae39a1e7c49e4f174733290","integrity":"sha512-+CtwmptiB6edfRNRZrXFOSFICPo0c3XSH3cK34biWeiwqmq0RrUbPhRrZmg7Ape9YYq6DcxY6ZANLh8I7ayauA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.f389bd15.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb72yRCRA9TVsSAnZWagAA3QkP/R8GHS0ZMdoYECeTG9GY\nmu8tWfv7FPDV189yOAlSCdRTBP4CCJqc0tUay9wB83JYjUFjPWoNKH6xsLBF\npK+neJV37YqWUYDxZY4Q6zpc65tdnekq1V1Hq1vneVOG4qGg9AWk0Qlz1pI2\nJoqyZppxCj6LwZNgofDEGyfSz4XFMRAu+D5c0fcUcZBis8admqVJIxS4pDdp\nsyYw5Q1uqw8YJ/Pj703lrx5QCVWs+ELdJa2yTwnefShWKivldjP8JTVnHyib\niXwi6Zv+GRQ862k/YA9kRN6+GnV5ZL16gXLslg9tIX9kLZMJfcjkK9Gqp14C\nOATOry6YMV5RfiF/Ki/dZvVMJeEfjYdf1O9SXzXhvf4n5Vrfai7mcqrW18OX\nCYcCmxp6XpdA17yFtBEf/XVdgbgtWvpE378oTZ0RipTdzFmrszxAdPDFIyBy\n175vCDZkVHCHhH/5NOoXMyV3afFsqsUDyIbe8n75cX6v3m4+pAnwYcQW+D4u\nSOqsrvhcDnw6C5Txj2ix9kvQubJJlpCZojSBykUICkQkCbOjIPhNwC0SKxWg\ndg2FapgyiDZ/PEg0p8LZnpmdVvR5ClBKqPow3TbOu2/HlGod+JYYCyjG+/Qr\n/WDNFykLEm9561eYLbEofiMUigPOoQMaHZUyJqem/zzARpU4wzJhmg9hfRHt\n7WIk\r\n=UAl9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFP06ER8w5vDMYHBOLKukjiDc2AdwAmhIjE8xEIqq/V8AiBp6RPGawO6XDGr2/j2c97js3Bb9In2I4LUoFnRDClZ1A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.f389bd15_1542417552398_0.27759691062708547"},"_hasShrinkwrap":false},"0.15.0-alpha.a647e3d4":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.a647e3d4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.a647e3d4","dist":{"shasum":"d9406aa50e4df0da717db2cc2511d7f4ed7705d2","integrity":"sha512-bwHSmQiHwbajQBc68wcCHsqIg/yM956N6I1XewruitM+Z1dpiB7rtFVm4aZ9zo4Tn9l+gO03ws+fWN/1pG8d8A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.a647e3d4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb72yfCRA9TVsSAnZWagAA4hMP/iQ0CfzZmzkAd/GFeW+P\no/aq5ixsyhZ1dCCohaWUXGC70GOnYdwPMrk+t3tom51BG75mJg23Vl/CARZu\nddBP5L5C2VUhWV2enNNOLhleOVM46nZq5hYrgGevrOBuVSB28b2XWUIzggi8\nULQA/x4Hf+S7EAvvQWe22HDq/23KuOXaB4UUvGd4dQA1iK+tnOI0JoLcx5vg\noJXOrt0E5J5aJIHIjfAqUnIW3WNj3mLvCJGqUchnVk5KBhl0Am9oBiMHcG1U\nXu8n7mYZx/YbVQN7ds3Z7iUiUW3VW2eREBlyJaW+Nmt9ET2rN8rcZd1tDEAE\nlc1jYw/NBPGdEvmvmgAy83bEQOu4P9SavQQpne5DJHZQSf/VSRV85KtMJ72A\nxJxom6m3Umtm6wItQuiMvRW3NV660wS5zH8k0vehyfVCzizCUemt/AvCBAfd\nibkMmEPrWFMdNIm5vM4ZfH4Agy7kHRo2a5VK1JPQoCLcU5F6AKc0xplK5/Xo\nMR7Adoq+ka1tcOmXR4pTBv1Kh5tk9ciglRERG/89OC53CpfaWAZo3RafB24s\npa4WtBZtE2anIeAUMLVRywuqPU0TRpuBC6dFkYYL3OZpGtb63CL3TWlo3mO0\nPfyd1b2C87U2prmbUDKxlCcWkNsyTX6/SJUSfDA5HBAYyV99/CyX8MyYBIM8\nCEWi\r\n=Bun6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpRltcTKE5anhC79C3nC63L7lEd0C3TwA0aeNVKHvdewIgauAQOxshLAhw5QJr5FYtMSnLh2VAGM6Jn4QTNjXO0XA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.a647e3d4_1542417566819_0.6979769356836165"},"_hasShrinkwrap":false},"0.15.0-alpha.16760c04":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.16760c04","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.16760c04","dist":{"shasum":"6916c0d049bd04f089934821814c69c2a7901c58","integrity":"sha512-lHXfkDG4whsA4vUcYiexhEuk6wBmwub+osC3Zcsj5FBLEScs9QF1+j6GFoF3ImT9P/m2xcPNjv4/QTeb1Kb42w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.16760c04.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb74F0CRA9TVsSAnZWagAA87YP/3gLPJzA5m2D1T/xDg5T\nc1CIvnHVl9r0MMwYEnfuOhQI5VZaT0MJgk2oEBSVQ792HkRSosPj89Tku//X\nIFX4jIYD/SFZqG78hJNc/rkgAbW5OUhwbe/v/Qay640FlkgoXDXu/6wGeNah\nqdFNiP9ws3Zq2poKt9PKD/CcknpeTU3SemWjXN2F/p9NCmKMhjh9fKfVFyCo\nYtw0BadTV771DYBYY5KI25UR91ICXcmfizHQ0dsHcR3KH+8ju0U6jvi24A7A\nEHsyr64eA6DY6F11HsPFIWqhhGicTryjqp9JTcfbR+CHb63Rgvm+7FRlywwq\nil92IMS/sSquJmDrwALpUyW8qUEA+Y7UIHEC9bDu01s9ErGE9y0p0UaK5HbS\nfXaApQU9Lbg6RBAGWv7lLafwsw8Tcy6+bsixha3pmn2dNbqxVRwnC73YMsn2\nEaBSOLcw0gQdaw3t5SE3FJIGhWfzyaHui5ugkh6etCQNXY9YDVguCISBZmx+\nJ7o6OJtreJJQuOCiAbVgDT3br8BoM0T+/N/CepQvm4NiADtIVJlMUBiSJJH9\nkKDrcobxNtoL4kIV3cnf+sFyHUUfqX/cQJuWwuNRhzLWYPcbsH+9+/S9jYwF\nTZwEvrIkjiheptS6tDNyWzLq9bwh2l55Vt4O/Qqf0ol6uQv0NBttxuI1EzKe\nK+NB\r\n=a8gc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNMaAenCnSzh0jCEW6XY3VSaLCHsSAdzIhdyhO16c4eAIhAIY/aToAvowrcwkhazeOIhpYRyxCU4XZmc8fnilO89Lk"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.16760c04_1542422899975_0.013111053219516666"},"_hasShrinkwrap":false},"0.15.0-alpha.ee31e4a8":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.ee31e4a8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.ee31e4a8","dist":{"shasum":"16191570a2d8613b2c066cea330b27bcaed9f5cc","integrity":"sha512-STaNIC3dOihz0rn6OF/pnjEtjp05sVTxlRNnZuVcKa1p9npr7gm6RsL3CA+sQfks1D5FKeYz0cs8awFigi9//w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.ee31e4a8.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb74MvCRA9TVsSAnZWagAASVcP/1U+x0FN3uFqv8yUSQF0\nJ6fzJ7VH2Uxmj8p1UzGyLesPOTobc+Ppe6k2WYH9aA8aLTllxIdmXEKSDp8m\nKNIva0awuWMJFXowhCsQAxy9aF+stBVpmjYL6/CS+O2ewyIGZt6Sc19xDZAA\nuuyYZOSLHnS+4qmNK4HGYmV1GJ8/sPCQv4+Aym4GmQEVfWQPQ+TXYH5huAxw\nJwL+IQZehhSRl2aMunG7Qja7qkj7BcxVwb6WBYB+xf3InXkHqJCaE9lR40YN\njQ18BlHxlwIgLJcxsRGXYHmi8jjY1CgUae3jtAiMpxN8UvFLxc3HOOiUPXzb\nP9Id/8Xh1NDuIEk5b8UK10fs8cg7zgMSW2ikFCRCanMUxmUjfG7ffvamap+v\ncn9qejwqJCh8KdRGSaLfRQA+P0pzKXjK6bmoW2jS/2mdQ6nvKNa4epB2C38a\nBgylb1rgofUhHznTvO7UGLP83NUavzKPzh5+RzTGDsDxpMglJFmQe/IiA0DY\nf5o25/ogMUFbZs0f2mxZcVJ3hzVtI9UjCHR6wfV8WGW/rQRTsuW1w+OxuMBO\n9noUaV214Rr8M8fi39eCBmPN3bXzRn0LP+DKrzLSee6q+2QAiP0E6aZ/4uqN\niSJJff9Qi3XqoPNO7TrcTLdaowl/iSYx9k0/5gLqqGGlm4dR8rn8zhvbavkZ\nR8fC\r\n=29tl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCuoq9pWt8BmaZE0jj3asmYFZ4PMrzLkD8ZizHaHHE4gQIgcv/JSjNrxbY9+Hs2qoKU7MAUzwMg8I+VAuEFJziCI7Q="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.ee31e4a8_1542423342696_0.7901906539122632"},"_hasShrinkwrap":false},"0.15.0-alpha.addd396f":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.addd396f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.addd396f","dist":{"shasum":"e401210cecc85d50e8d84f06373fe5453059c82e","integrity":"sha512-olyPOqLcb7lK1vrLvJy3Gp6T0kjrK/yiuXMeSLWbq2c8TdSKvPQV3iBlY8KUtf1koUmQzSKSmRbZ1Lft6W6N1A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.addd396f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb74Q7CRA9TVsSAnZWagAAA6QP/j2G9JAL9mLSjpLGJbMA\nvH3RA012gf3Z+Bz+6v12UVnESu7N9rv1caL0glbppff8X47yGWZcZqJxkjFa\n7nQke/ZCMMAz9P33XOPEclOslhtR5DkRnkA27uwgvQtrhWKlNeqmH5aKYXz6\n67fOjEv9X1yHvjQZ7StCbBPbTMunDmUk0danOrpQNGioexj2ZaNOJADkhpqA\nDnLxJmOf9xSTUgVaW7lLoRoivDte7lvw83dlFoNZA0tvjfkOqe8Hm0YX1x5O\nGpQbJWuKZpsRwMv5OTbwCqf0vMf0WDbfllXUuD7xzczhEke2f2e0JYRn8ThL\nteNJLAa5gZUX2OoQfyX5VCxZZ5rnNtQRtoKhS8q8k0i47wgEOCfztOQRmUge\nLJlSiY68P5gjQv4fpPgtjTK9jMMgWFNnmZMTDPkTN2sTcb2kxhbMU5aE3vOk\nt5X8xjgWfScsHLQoTImcEecSr+BXS4Qm042AVu2hqJFfjbZL+zAPG6Gm80IR\nj9Mh36fvqeoyGqP7tDoSy+9CSnGtIpGjO1CnJTewnzTkCCV4QJ8AFnox7svw\nAYItbsXYIsF2yJuTBdMw2JqW1QllaXKR0E6k+uWH2lCKurooy3w/sdqgbyFK\nCkQjG7mkvjRsavdx0PrWIXirvp1hYydrft12aZedluskyw1FCckK0IwAkdGh\nSQkm\r\n=d7LW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxpv1y4f68/Lu1sZ5GCAH4qcZUIvQDCCUA9GDy2UYkOAIgV3pkBuRp54KFcn9S6UVCzMDffmOCSmyHF6GhB3mN4YI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.addd396f_1542423610247_0.24962696104909043"},"_hasShrinkwrap":false},"0.14.1":{"name":"codegen-templates-scripts","version":"0.14.1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.1","dist":{"shasum":"4c919f1a77b77b3df35713fd5dcc7185aaa679a7","integrity":"sha512-nYHFUZLc/o/Wtei2mCRSwcTsNeooZn16aoO9b70lXDb8UbvmEaZbD1f1J7rFVNy4Zy6AteWnVLRmnmTf1tH0pg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.1.tgz","fileCount":22,"unpackedSize":16711,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb74TnCRA9TVsSAnZWagAATWQQAJyvBeDMispYj1CuHDMS\ntg2zgdzasIwoNFDMZiOmgipXkFuq5jG76YeNVclHRirCWMqIQmx5BGuZqwwd\nWM9uCKHN37MvGfh2AZXCPjO7etxdZqOZTpSfSuk18OPTXqizmIWHQo9FaieZ\npbT+jnRkUMyQbm6ITaP+ap1aY7Egk00ibaUqCYkGG+lIiUm1MKq2EDZhcl6X\n2n7U/i373WO2odagPl1k4TRpWhm66nWqfPQ9FU1gcYRx+NCOJvbNdr30ddx3\nfXa/ftBVLgTcSHQkY2H9pIYo2LTydBjNfafe/8rGptGUqt2epMm4zUcmZ/LX\n90AjBFYNSmaqNNjBl5GqjlzomCnIfxH3j2d0Tby8KFdkD9vqDc91eBnDol4G\nc8QkBoyu6HKWieMuKUG1YdAcbeJonadAg9aKVuDVM0ISKPB33sy2SEhpuFBO\njaSA1HoUpM0EAmVBqvKbP2ZmaPu/UgcaskOoHxP6mL7S2drfeR1Q4zKSWPFw\n96gwTLzBdVJkIGYVD7hWxk0H9xqbHECJVHeMPBY2BRBdtiPALyQwV1nQvGSD\n0SPJljzfeYSFBH44q6owYWhqPHotTvI5tKB+qERZmTHpmB5uGxeK3SUtXM7R\no5nFVWrXcqCGg0IrJijAKThQ7PA5ALitDHA4pj3GEocMV3+XzxTzL0TIx0UT\nM4bm\r\n=YZaV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlIgSQ6vZmncwsO4s1udXmofBUvyT4YtV1022pxjv2CQIgeWIVmP1uQCOQVh/H26k237zUqaZZhSu3VFr2uWFAElk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.1_1542423782621_0.3975314920473778"},"_hasShrinkwrap":false},"0.15.0-alpha.44dadab9":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.44dadab9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.44dadab9","dist":{"shasum":"67a3e6c279dffab4c5cecab499c467ae6b8290c6","integrity":"sha512-PBtptz0TLnXxTBkO8bwbfAgnu9M+x9bi5dF/98eoh6GGyF1BWc3IL50kb41zDIcB2UAKbY6hmlMZAmTgfsMB8A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.44dadab9.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb74W0CRA9TVsSAnZWagAA8UkQAIi9MPkpmu4KA90sIHCS\n1a/AMyYhzG9IBvCnqBRatBKocleRbfTMIGFP6IXa956IBY8CqOjfORjK4+nD\nNOd1fUAN5fEKgsrqjzRNWQrpHxHwecVOrl5GD4cl4579wm1xdJchiw9aRiUX\nNOGjqS/bCWQFrTsNeTdbhvJ5zPrdP/rize9QDHHhonNuJJWHcGQFkmPYoPhL\nzUiccBova1tiaVy8klv5fACn+MrM3tHCZ7ofl9oZcu8sUR8o7mPaSnXGOyI5\nf3Zr/EdDNQCh1ckToQHPEUgw3c0BEo0ljxh9SYWjA/ZuNqXxoi2jboqPMWFo\nsyfZHNmMGFxGIAa0A6xAsBvlPD4JIzsjNTY2GXNVxkxRP0Z+zs2vnfAgNyAi\nJXW8nH4pGaWhHzZeqKlznIUW42TlccL9gg0ZsZR7sVvNOCIes2mHQZciqJkj\nz+aNwC4C+0nYiiDPv7OluyGfztThkw2hxamzrl2iCUtgX2FUboEZbsuHtgvQ\nk5+tpDnlAHeKz0deoY3tOA3eYOoY6b71zm3PHfjvUyz9zv/XowXfXOaBVDPQ\njJ6RhsfPp9O9MC6QPKM95Y5IulNXbhNpW1wjF/hUqG2uJoc6OjX33YdcFISD\ndJp2vP3QHQOzgPIcQwpIYQvjjzJROnHWxXl0ADOiOVwrsUSEKoRb4n349U6K\n3Pp1\r\n=sFWs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICmcpne5c9mvOcgJwZFD1byCdE/ca49h7xAC5RaeIg2eAiEAjItY3osotVtRifVQzBXEFXaXFYrhhD4n2TUBrnmcpVI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.44dadab9_1542423986829_0.6463321983016825"},"_hasShrinkwrap":false},"0.15.0-alpha.5a856f80":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.5a856f80","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.5a856f80","dist":{"shasum":"ff25abd394703b28e3049a5c7022e2918dba8189","integrity":"sha512-5PG1lpltN8+ZUEIxWOlP8svvbQe0m3TrkJPsGbpp+WyCmXl67GX5eI/U8raJnLPpNeSGu54Qb6faEElcqOnUyA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.5a856f80.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb74XaCRA9TVsSAnZWagAAfMsP/1tmTjTMBKKkD7ZXUHsi\nQrOdANE4kA8ghYPHLR5xpdxrFuKsY1No8fvvxTVdT+qKuw0vDJ/t744VMaU9\nT/cf6oLCwcMNiWp3p9GNUP5/AmkY1C9LGNyheqC0HZwDRRmi/xLdyNnCzuVW\nwVMXQlMPMfqqkMy7vzTZQV3TgPHUTh9YJuvoJfdsPWmflbAW5HcM6e2GU/Cn\nYpyq3gO1ZyyucRk+jC1AE3ogixuMd/BMHP94fBFcT34dQEQR8Xmhix5WEGkP\nBrPIJ6VQokuwjQMNYI7TyWCBU4nBbUJvsAnNUx0ey4yEkbxElJgYwJVYRiNs\nccxOenI5FqbZtB+1GlaMYtOy1A3GwT3P/JZPKtFPSf7b/HXBx1EELfLMTVtX\nPeSfy89Sc8l9JEf1YbLpdmYxZ6pFd68LWPq+BmV5zwGLFAzgPfI0T0HDgHQV\nHF3YbJZBx6RZ6yfoq6fXn9PgBnWF9QPTfzuYgO96/1fz6rlKd5xE9Z6ttqYH\nG2Asj6sJPVOVR8zxY1Z1hEPv/eCltAQyTpTMscHTRUMb3NmB64VJFw9eyh3+\nBV2y1gi2FPAwqC1H+ulhfnE6oKs3BjOlz+pWs0Nl4z9SAPs+FXC+BOrFMM7m\nrGJbrUnK4nW88OrTtt/BVy4VZe/LVMGqRBOW2zfKR+w19DLwvwyEMhyZrTt/\ncclc\r\n=sZmZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAEq7q/E+oHx9gmglLYBXnTK9Fgxs2P7HEqfhRTDxJ4QIgURx+UopFscHujCvX8vG7mnt+VSqI7QLrVVdIFMmOKmU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.5a856f80_1542424025752_0.4726453663398762"},"_hasShrinkwrap":false},"0.15.0-alpha.15f1e648":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.15f1e648","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.15f1e648","dist":{"shasum":"5ff42b81bed78570b3663f8c351b20d8b641c891","integrity":"sha512-QutHBvf2w3B3EwBziLHnOJl1UAXzoumTFKkxLA290EYkI5RyGzxFXyFPL6eHXFnSbM6he1D7FaJLE92mBWvkcw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.15f1e648.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb74j4CRA9TVsSAnZWagAAhiIP/R+KpDjeKDxsvvUKEE3S\nry0SdiC8cF2ygzNOZV0ZDR0jGczpUy8NDwKAvvPX3TP6E8K6ut4RGDOk9laY\nLgVZlyJt61Xk4DH5Q6FlPe1QkDVfSzXYJP7PLkJYjSjzOYZzP+XBeu0uaKT4\nxwiID092uu9BhDuvraYzo4jzVWRy4KUYGSHJDYFDBkcI0y7qXcPaHq4DUjcA\nXr2ZkyyYHsXsgoqEQrqTb3IsH7/pX1zci8I8sE4IUWBEOJVmg4hb9evp+1bu\nuSSVoGCtFXTugMou3ElVQkx9S/vlDKK/LrPfmcPBZServCsp5uaqcrI3/Ac5\ngPX+EzcpYjbO2n69WyaMDO8q+Mmv3MZWEUOb051F7XXSU8RBvNHUnm+Nc8We\nQKSTN3fjcByoAK9MvwpIUKDNP6Qd/RFy5LThxtUIflpXicQRjL646vkXkqhu\nA9HzlgUH+l11Uu8ONUmoKxRQI9+N+9vGGN03/Q+dUOxNXEcltTqm3xDmvs0e\nI2dJ5F54THa6DC7NmKP43cp9oysi2w7QQOck0jqwhCD+NmluTSmkgn0vxiVT\nmdWZqKlmc0tz6PwlZzNof8RVmsUctL+VzCSpqqXa3wLlQU4ZtbTgcKTdEQmC\nMOGRIRGDSfFtHZoms700jvpbs57H7gUm2XZzhzpXP3j3NKMKxEyMjmeAleIz\nCNmY\r\n=6UfM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFjzf2bqQTNzhYu0sxOnbAiLXr0CxBSHu+WfS3EJWRSoAiB5ydLvnWfq5ZpZtw2osxSNKzpRQmowwLkV0L7XRWSFPg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.15f1e648_1542424823449_0.3684262984056903"},"_hasShrinkwrap":false},"0.15.0-alpha.480727a0":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.480727a0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.480727a0","dist":{"shasum":"2baad8e9560e0103177a0bfc739ca2482b6cbffe","integrity":"sha512-9oPLtrfHcWdRPK0W11YZ0BMM48F90YmmrsM4FhQ92RwhJO7xxZJ6uVWteTQ9rH5tiXwIrXutx6xnq4HwHUX1fw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.480727a0.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb74j/CRA9TVsSAnZWagAA/xMQAI8F7zLPb4EClWRgYsnl\nTaaOzKIAiqxr1li1hMi72qfJdFbIT0G/2bOyRVPQnadgAOKuMp22+huw5nxd\nrB1fnTip4UldXl/hvmyAIh1eP+aSBp+eSA+1QwZYq6WmzxCn9MwVrjbFd90R\nR4fzvfOIlsyxBvZRIVgkheHWP7DIKYZF9m0oZdKV7dC3xozWZnuq2nLXB6gn\nnYl7fuLmsSocCTlnezkJdntfrey3C3uaNm1GB192itlOhkrwmNAM28c+NOYE\ne9P9EqPquMt/JM74oRcnwZpZrACHk3lYeFuoM0Xk7xmN+jyEZUShAavQiXSV\nUuL5oRdsWLhTE6AxxYtoQmXW+ZSHYft9sARDi48a+mAYRq6ogI2Q4/ACk3cq\n3KqqcPEQlcvQrcN0vYg8nTZhpt/Exz4SXkg8nctw32kW08pomemVHUHLRjuW\n30cdohHe5YAhBR3ywgpkQZIJ1TcN7TaqA6JKfPXxmo0RUkd//6yG7njzzWFg\n2jP8t55RaayGMQrB0kEjmIIn8MpWCsfyVI8+t+c82azlyMgLeH8iiIwj/MCZ\nqjl0TUuNhwR1N0qoPOT6xNs2mZmU3Oc5q3hDL9dhCiOl5Ou6/L7yz/5l80aq\nCLUmLthcZF7cjV9Q+1rb1LCKY5UZMzNh8r2UHOmIkQaX0PN7o0Wl5zbVhQf0\n8NzM\r\n=qSOb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF5tFIJ2IvRsOPYj7HBf92OZgilBlqlIXmCJIaVf5ItqAiEA2kXWnKR9oW6t0OReNV6F69r4Qjub/DDJB+aRuQ++H4s="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.480727a0_1542424830518_0.6329035843286073"},"_hasShrinkwrap":false},"0.15.0-alpha.76bfbe64":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.76bfbe64","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.76bfbe64","dist":{"shasum":"c8af1bbb3d1eaa7875cdb9171e81a0752540954f","integrity":"sha512-hJqHaCWfKmJ/JEGIAJpNe2EcycGzows7z+eVocSBKKTIaUZmqDEZnFeNOKKyxrIpFeco3vlMSJM3qMk4qQWagg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.76bfbe64.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb75QDCRA9TVsSAnZWagAAFAUQAIqttCAcPlbk8BnoMJX5\nJjbAcTsnzgd/HG137axgCR6X+YevyCSIfBXi5MNLUMA0eZqDojdKW5qYuQjZ\nRx7VYYCmzDNHChsl83+F5Q4Z4YlLmbmGUhwU7+3Y2EXCnmjYc3vSNagAf/pV\nCKW6Ctxe5/s4r5TKJhMIZHXKmszOG00s0CyJj3VKzpfM5iq+coP6+DOUCQlW\ncWoMfVwzCzIoZXwudnUujYEfzuegqdMP1laZxZ792a2fnVgAtwK2p1Ddc+Eo\nnuq7QZGgD4OxTAhqbScOYDsPb4fTlh90tOPS93oBPXx4lB9Kb2lDt36c1HOW\nn7GBMZCMKcrOEELrXWZGtdqKosEh3NuIoxj996/W7n3sVDsD4uRJok0QZYUp\nBItJBmMA9KyqmPPt700TIzDc4fNSJ6+h3I7fSZcSAy/qc6oDc1adOD3+KJYD\nR05P85O2mhviRQHvvggaqJd2bu5FdU9aV7uDcMxsdqG8CgcxPMsq8GMsxIl1\nKUQn3tqGfFDWZ1FUL7pdsWGou/0t7gqBsvPVXrUwQab4vJQ2Z0f/KAtL1tDG\nbU6f0UDmH/nkt8cngfgC/7G3TzWKI9xemVtt4yjUMsQTWzReTsH6Vb3cYmOU\nlMElpEeC+ygtDIZunYt1otX5XJygEeH94GXpJw3Vn67sleAUQMPCIV97rO7G\nxeeN\r\n=H/sl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDCAXFE+m36NfzSiZgCmD6WvV8pCxKmPfqBvUA5zRn7FgIgCAwDRpYP4eO8Q46aHt6gruLmQTSAXoqY5MQRS1czt0w="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.76bfbe64_1542427650872_0.004801162580674756"},"_hasShrinkwrap":false},"0.15.0-alpha.5fa0f731":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.5fa0f731","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.5fa0f731","dist":{"shasum":"bda2625a1cafdfd5932b3eb02c9798f2139e5d4d","integrity":"sha512-zIHbv9eVOwXLSuRKB1CXnTL1Rl6ixO10s6iM1db1GlWozBoCZuhUyOWD0Sgdb8E/mJkt6aBDZljFc7PFQU6v8w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.5fa0f731.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb75RxCRA9TVsSAnZWagAA4pAP/iC+5ElsxZzICygVL/Da\nT5j8NGJZx0rAtYDGa1in74vK33RcvrzGb9bt4Y1vTfNzPaIxH8WM9D3vR1bs\nt1+47I6UmP+yB5l/bLhXb9WRt+UHARWinJSLwdPJkQAGtx9sy2ppg5rAP49L\nio777QPOfIWcCQPQOGiuUdqRiAjJiS7U5UM3aJOLVZF4qhkkkYqRPwFRahWX\nXq5sbWo4x5BPZxHxYObnoea9V/NyqkwlKRqQHgcJOy8dSDKHSUiiKse1iPF/\nmrHlz4FzgPrkBo00GrrPkoHqs9kejAJlKCsloa5OczIBfAwFNm8oKd8GFFPp\namVyDAgmWtoGgfDRzS5NIjGuGHosYFq6P8kEda9Uy1i3DWPxBpJGw/Ebweao\nR4SuCIGXqd/vfqlPXfZ3joV8gKQogAd+WasslH8R4lrjSKAC9fJvkwGRHxto\nrux/VpJSmyBtosx7XbQGZYAqM2X88PAdjeqKBfNENNqSACKWnjy0agOdnawn\ngFB08XDijllWQPDLHpH9cJIVXFo2CpyAFEo2QcOAsphna7Igh0h3drPHdRSq\ncTSP7QrloL+8pUaQajqDid1aA78HdeWMLqG9ToI5ZdCbOAStsC4EpGhKM35P\nhc/Oesdmz9eoQgAlqpMOna/cn9JiCgH47u8StZtVj2FHDV2pnQLwFGdwI+zm\n1PFL\r\n=slkV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDkZsNorCqCrfzsyd06U66YUuzCvHaGFPUxYaBTkT7/iAiAYG5tt8rTOkGETKVcB0QAA+vXFm/Br1ZzAnQ0iNRv/AQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.5fa0f731_1542427761223_0.9348406674968084"},"_hasShrinkwrap":false},"0.15.0-alpha.2fd70590":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.2fd70590","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.2fd70590","dist":{"shasum":"b96488e1e29312c6a303605506159d5734205ab1","integrity":"sha512-FbOJ7OQvChXB95EPwaBcgw57cYwMMXbe9z8QDRMQpCzWP7yHClNzsO2apnR9HxCRcygDUKFoB2VcPk6D9QDE6Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.2fd70590.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb75SVCRA9TVsSAnZWagAA9D8P/Rl5bv2lPyPtsVDEu0jm\nms7nX6LCex9+sFbxS7QJWYDRsrBmbzJULqW/sHiVRGV3nuFOc7VW2f2omQF3\nmaUzl3MhAOsuz8glCH1p3xKBA1hWb16xhFEjeV2RvVaNaTfKHE6mROgyndPu\nWR1NH4Qh7h2etgX4/wWJgnbZgE5axSRuFAfaTn4b4UjUTfEPq40/7IdKeK2d\nF4n5wsCYjV9WukQIorQVXw02OUu8cvHOciOqNmSyi8S7SDv3ix3l+qpOBIVj\nN1hQZ2pQuDHcDi/rNpwuqhxub/lV1Oo+TiPR+upg83F3Vk4SqY3RNi+Qh3PS\nAM/MFKE0jLE2NDOVJqdWcwnxzhrwaXXlCvTeu9B44eGnwGIw35qvk+zng+GR\nZbp5y1FtVoVZYmaZIJ57PwYPeiLDp0+vF9rD5ghQS6nCAPq05fEsb4gUZRJy\nG26nSn1uLoS7HP7seAovHqb2U5ZQIIFeOkvTtHrbMrERCQYNm/srDFMEI1dm\ndVTWYwC+x/3z1E2iP1CRIW1UZ4DzBSz1DDwgJ2/Tej3a6yLAgtfN5eJSJJyp\n8No1dCAo8qF7Vc5quxfeQ3UskpVuQeuQ+SrSkJHnWZXzKUZCooq/D/gmYxv+\nAUZdKJPRYwiAaknSGEISaRpCImVT+V5L65rwEsm6MuZKOrx8NCmvzNX6R+KP\noKua\r\n=nfUv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBoyPy3pN+bBUzGBaeqZJh1vV7v/C1rqWVfAooZpuKm4AiEAjPxBoVzwlfcenGP2hPWzpwApIN3DOstBw34Ao82oJVw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.2fd70590_1542427796533_0.6217864976626197"},"_hasShrinkwrap":false},"0.15.0-alpha.90fa6c34":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.90fa6c34","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.90fa6c34","dist":{"shasum":"9bb21f090fa2112c03c4685fcdf75b9da8826281","integrity":"sha512-GpGhaHgWZjpewfbGAQFIOhR3QKv/TYg/XjOTayDRGbfJciVqZs2wTucikZzEpp3kwFaUpqtEnlNWvIxWXMldcQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.90fa6c34.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb75S8CRA9TVsSAnZWagAAOVwQAJVdbyHTkWjS+gZj/kuX\nBuR91yMGbPwSvWTS3DZfS5vD52EQoyYZa2KiVsdimdfwnj/kadsil+8KUwAC\nIGk4+Lrg9dkgcVdbVMDKlSeDpAsg15hPZWKYNMxvruCTl0LEFGpHUYJTmYlz\nUJJkIp0J5CQdRsvuQ7uCu7kNqIs+52unFlKpxYtz+u2wJmgKEm6MlQAdJs8U\nrzXrpe3GwTfHGoJyZGDktKiOHRaiIZDijK+H0weEONiUjDHSu+PE1DiKUC9c\no2XmT91gwPnh4hqdm/tAPlZI2cdgh9dpf+cNutRWjntmEyGStBHUKQEICuZW\n+4RmUAKFfqI/CWUtkgA35s6qIl91aJ8OduQqc5KTpR4OowqTIYSC1wV2JZXW\nn2JQpOaB9JF6gK/JPD1eUUvLKMSl93Tx43lj9s+AEQYsT0tjxa6OK8V441FE\n5DVlB22r/gQ20fWzwGHnLaw9wKuQ7/h3LR6wEm2CLSY4kUGaDeBox6SvsYbR\nvP9k9OKN/oJ/pyepgC/dSYBBIm+8AkxtAeFRF1vy1QPp/eRVB9IwEr92/VHd\nIGngVsH5WVid5U60tVdkKsj1NEfyHBbOYt2OqC8akL0nMVzby1kzccA1urhZ\nP8Ad85wDoO8uRgQ6ZatTnSSkgbLB38NlYb9lXY2VVsc1BL+Lis3GrFtqnz07\nMl5q\r\n=fDlk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdg/eYILqjNX9aWZw2Vv72HR8OeHDRXxMNgzUATPCqfQIgXk3iNKdhhAWZ4W0xoBPqidps48AN3hlQ2XqZyxntTmY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.90fa6c34_1542427835509_0.10450873041167963"},"_hasShrinkwrap":false},"0.15.0-alpha.ddfb88fb":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.ddfb88fb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.ddfb88fb","dist":{"shasum":"6435f7a0faf0c650cc4f300288ceccb70b5f3a28","integrity":"sha512-d9f6on0fiz2nVIxhEk2n8/EUKRsQVOA97QybvqOQ7T70u8curaP4eflEEbRWUirCh5ImXHfpoq5uwFhcM4BDMA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.ddfb88fb.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8DSJCRA9TVsSAnZWagAAFFEP/3V3HkRgv3DbUAaj/bn4\nuGYzy/S0LPSrc0KHU9Psli3pkT3irYUb7HrWaCzKiZoYZHez9lBBZ7lmo3OM\nZXMwEmbq7tG71+ShsMlrA8b9PV7EISa81on+l2fdXIeQmbV8EjI72/K6Momd\nrw5oDJB38rBFqgcoLfM2Gcw4dWbwW7uxFtPxNGvMbz5Unpyz8+0Oj7vvJPWH\nzJzRpooKA90068+DpbIfjRnqtyVF9h9VswFCgHUM6s6vxzWNOXxRHyodMCLi\nWYl5NGpfrSYlfONuY2ebnUmoMsqmaPUg9aq8cizE0UUwwb9EMleiRVWZfGNU\nHfH9+b1EgIxeCGtR6WSdGX3tnbxAqBLUsSV71BtYNokEqISdoMV/c9gfKmc4\np9Vrs97YFymaSpQ6ueaBnX8UL0BEKe6sIvIVV+uRd0dCXx9RoJ/toQ2bqVtK\nib82HDNLO3qawMmOgqpRgMGv2zseIFUu+/09VR+FQkxWZhYsCtnHt1FAIcLi\ndT7VPb4f4I5+rFdnHEcHxtP3pI4vt70mUzgysvqd9Oa/INMRBeTicvha49hq\nqXXW83xwCKXFBjsFuHhg9c2Z3gS+W7jrE68si8naZj8hy65a2GL/mxFfcqZo\no1MfAJf/5a8Bl7D5D5vs0A9zqUvoCu7sU7zCOHBufSFE6ge//MrA/WS8ucCM\nRUa1\r\n=rtKW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA459fVROV9ubVF80TU2YXrCoLokD/1xL/7cZWbxmxegAiAmo/6yUaIrYgK3DHiPGpNFmIFH30niLzp8CYS1JpY6QA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.ddfb88fb_1542468744214_0.41216285583153556"},"_hasShrinkwrap":false},"0.15.0-alpha.16d780fc":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.16d780fc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.16d780fc","dist":{"shasum":"b6947c01a4b4879f491751f50e816e8f3c60e4f5","integrity":"sha512-nUbXFcKBt+/yvvB3dUSSid5CLrqV3i4vzIkK6UijUm3C5PRzkI4KI3uxaHEhAQmU/s34dF03sbGPNiXFtBtl0A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.16d780fc.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8DS6CRA9TVsSAnZWagAAOuwP/ReGzUfIEmyByk9IXysp\nfKOgbf+i6uXzn7e8zZg1FAtCrE4vZ0V9CWlK6US+lRgPlQm3kAQ8M5daIZ1S\n6cLDQScyCD1xSjKVGnpy8DHDkk4i512dOj8QKdh6Fe15a4eQedpjTvdt+yBp\noZuNWtG7TRuduHBtPtzrCCzazXZMrM72d5dsuB9Jm6+bvYyffzlHN1tov0sF\nwMkigbq+NEOTN8ZEKTjH2N32iHip2ayNAMsgqWWJ1wOF5gb9ZzFs7xl02n88\n+WWHcoC+ax4rvGtq16j9VeHjP3gTLXq4+/yWqEoUmM9C/oTWSBEJpYFoLFVE\ngLCCXtf1Z8htI2lDLKgop/SiTPSHFCyP00o4pAQHl0VXPs8ZdxtfGM7OHvY1\n+/nva3cE038KYvsgrOtw4BvG3d16B8WAPtV07PswY6dTFQToAFptaXRAoc8b\nG9JHWYlJQEKZRpgMWsR2f+5o5RCzmgQVde3GMIhtWbZf+c2XxoaVCc9Wb+XX\n1IQGg3R+OQbfTNKSbVyIvagneeZwm/dOtrLsBK6VxDzHBdh9hZCj/S+OiEvx\nOmrA+cYIKsGOJQPOqyHuFBtHNaVTf77JtF0gun1tso4QYbF2L5RSlxExavPu\nN59IPMKZcudOdCloSgVWuA1vVkmD/B2Hu8TGeQM0rsejxUNj75Sr/dFXWJ3A\nIsMf\r\n=gnxL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvhk/TAet44tiScb8+gRL0a+g5nsY+//feBZDg0GRePgIgLkEpu4HxxDiydG3Wx3hISQBQRT/AGfYkIx1dOzI2Awo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.16d780fc_1542468793650_0.2853432943979788"},"_hasShrinkwrap":false},"0.15.0-alpha.055fe81f":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.055fe81f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.055fe81f","dist":{"shasum":"03ec6cade977f8c64779efc8d871af3531eeef31","integrity":"sha512-YyIlldn9JTx4dCt3DAIu2QlaVvUWoV+LA8ObCtBUQf7dHRz7Jv2SIIjXa3WaJv9EtM39Kpf0+Pnw8iGs15ht7g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.055fe81f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8D4oCRA9TVsSAnZWagAAHUcP/iqmw8L1TT9EXqDZUqAp\nWF52DmRLrcILLe7gAKEqQ2Dax6uWNXND61TPwItjdYd0QLKV/HGW76KQdUC9\nCyopoEvrKp2URyR0u5HnzP4pCu23usGKMhdA8bMouRBHS4vSxCitmwbxqDVc\ntJckxwQIda+lbGnO58CksXPQls7cx4yKmibyxLZWrIej/eVp2s/NnJd+K/IP\nDe0y3hbGVp5MFWirkJDlu6/E0u4dEv8smGAvXVVFi9UB41asL1xniFsPRJQW\nRsXtwpjCxC9rq/UPMZBySovAHPEekBokL3//hjBXm4hZFz97MizAO6G85CiV\nbYlqpw+ooRQCfIYavfB3VfXnFnZKW2mDy/bjEiJE5fxSBrWsxj4egdIUqvuh\nkuvvPM69UYgZ7hUB3aZ8JZ14bcWPOUByluqI1eWSQ1cx2dPAvMb/ZdQNMObu\ngJqI+sNQ6ZSnC2nCjPM2QzfcuKMkIrQ/SjKEpnhu/pS//4FeF1iI+pjhiOu0\ntbf2YE44q4hSABhB6gCbi5G+gcoCRZabhM8hSMtLgd53xTXQe2nuoYRUrGLM\n5dDXvMqC1BOzF112v5M4HcJ3MWRucEXozxEal6zSu9G9jGpFFmYFsQLjlXss\ncKTzxWKE1Opx3tu9NeY0BPjkHFTQjrp3I1ZdMSS8URb5XOlT4YDcrTtDQF3C\n5zlV\r\n=YTbN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4tA+2K+nbEPF9Nhcu9DsPjIbWRnh3nwSO0ogicd6AGQIgcYSfMcH83m2K8Sogl4sGSlwfVIeMzkvtz7PHavFzHk8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.055fe81f_1542471207277_0.8660987964277833"},"_hasShrinkwrap":false},"0.15.0-alpha.79512000":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.79512000","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.79512000","dist":{"shasum":"d689b8a4fd277629deafee094596467ad13a7e3f","integrity":"sha512-E+MDV6zX28OiK9ILAPHtJLdBsgUcKHgzXLn9ogkMG6ZFX+QA4vjiq5pVmhX/zZ13je4ax/gNOKY6xSlqjNu1Jw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.79512000.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8HjkCRA9TVsSAnZWagAAQ3oQAJKVOZ0Gz8joekjc3abX\nuYEY31A2qd6MaMi/to4I/CdkJujAFoZpxHIcOimM8VrFTmEoy9og9qi7VdT5\nQsema2A26NbsMyySCFRYVISV+hCm0MhQPL7NAMBSSnHRGKWgkfL7X97L1fbi\n/sktMcr8HsaY4NtOej9K9hyA4nWa89nwevslKVgbOP1xriEwy4qGpbFT4FrZ\nDRxHXiiNfwwYG9s0qaYT5mimwtwBXnbkpny3j3TIK4C1JGFfwSEz8XBj6HZE\n92WFTLDj+NtjKx4Co2Muxpvr15Xdoo0hodxqA7iE7APjumZxpfMCI6vcYrfM\nxM4uKH6PFukTo1djqnkyfGFE9JfPrBd2Z11FG3UAx7wMGKGlcgx2ITwyLRV2\nTDhL3p4QR2ZD5fj+5BANF1WFEvjILyoJ9/QfF9ZWLmE9Y12RPtKc+cPjii+5\n+7j8L7D+m4ju1+IA49cXMaTWU6IW0J15LxYrwA/qaiRjcsYcMqanWCdA7JOr\n/VmpsQ1S/ZGrLC2f0i8C2694uJU/vyuoJr0qnjA8513V2Y/AvsAzJMjlZvI3\nyaY607M0YgxcJqP5v4W7XZdaH6tVQl9zb564o8xuZ4G3K9K7904WW29dBiBA\nlDe7U519ga0R2NgFiXRDjRHlB9I5+uncsSX/z4RJe1jP82FOWhEoCJr12NPo\nI3Jq\r\n=VxPZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6hK4U/w5jbtsX09SnOr6wgYBkHAJFS+AF7nYyafGAyQIgVpCoiaJ3mP63VxYYRnG5IOItJbX6LEwrypF9wqNl/ZU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.79512000_1542486244150_0.9793059725685682"},"_hasShrinkwrap":false},"0.15.0-alpha.aa6644ca":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.aa6644ca","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.aa6644ca","dist":{"shasum":"2b8f8e13753d14217110f2f7629a417e8305a58e","integrity":"sha512-5JGhpb8XKbkwYFDiuQBs9HI/soSbx93JnU8Cz6TOopAJnrv9p3sqPRsR7mxzLkg1aibILXyuHZCK/OOTX+YI3g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.aa6644ca.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8Z8ACRA9TVsSAnZWagAAqjsP/1XGOI+8WIQdWdPZHhD2\nFxdRr8yJJYm4APTbesg/sYT43tkPW/E2tEsRNJjI21gbaCpNcqtl9ChhD9Ve\nD9oXY6goV9ZCpg9Cf2/E0j0KNMUxUHctGir+chitm0OQCq3TGNn+sbinaF0e\nzqZ7V2HQNq3XqpZNGWqDn9Bt1aaZn2H+/mYknb0JAg3MWiOyVPbyNXvNyGHM\nkr9L4FmJktOXu07mPEvTwZTdCpMhX9H70CVpX6wQe3j45KlAAIyXZYCFZG9C\noos118aHUIgXHlq8iFE2L55GVs7v9gw+gnam7PhbfmukF8JbAvdhKcgy0Lfn\nfI63GtLUxmIS60GNA5wRy1GnNzS9LO7//PSS7u4FRz9gOiaS0efFQ17ppUfW\nS6rFWov9dpscZcv88/k/lO1Co5U6AbKCnjPtzSuztjYek4m20f1WgxPsdBun\nyjlc9v8Tz9DJr/VGECQ88nEBwqjdnjV13ymOEws7IXUsIFlZhvt8LeWuNm2F\nkdHgu8NycpjJ3C9Nirqfwa5LOZMqaoYG3bOYA7nCuToiSFXPiCIR1pscwDbo\nUmPcqkQR3//HM0wgk1x5mRlWWCDfJix4E9z91N5/GmjxIF9/ejh2MNKRtm6u\n62XAP90xKWkuolJ1fWBf20xq0RrIbtyBZQ83H4szKNf3deTxU4sSHPOpPF3t\nRjxD\r\n=OhgD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2H9G8oj0ulmVQT+IC8a5zTqoG/i4JegwmF/zuwlnGWQIhAOG0/dHeL4J90WyEu0Ev1ssciFDa1ePeLQujdSx14+UJ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.aa6644ca_1542561535418_0.12732376637104958"},"_hasShrinkwrap":false},"0.15.0-alpha.205f7c08":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.205f7c08","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.205f7c08","dist":{"shasum":"499e10e9ba4a8ffc033725af1fd1c29179aa9a98","integrity":"sha512-gprlYwDd8voELWfWQhr0UKukn7fH0zGot8jU9BBYMWCIYfjgUB5qH34Na8um+NRCZUhzXwDQEiHn9oSl1zQ5wg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.205f7c08.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8ft2CRA9TVsSAnZWagAA36kP/A13hPbfKr5t0zP4S6eQ\nsa4LP2dHXDCvwL6sv+Pk3f+vjqRZPMLihPHkqOcOX4EqvBDQy4uZ9ISa7J5d\nGnT8UQ+3rXWiQs8F1aJY+SBaddFNhFMrg8XpSHKXNCGgvrAQq19xmt3U26rB\njvweCOlZlwlota/fyazgp8QOLVlnafehi8ViTL7+y0xFcb6/MPy00ejiMQkw\nDiVXIrROb5XwgdoD3rbuZouH4mMpi8FyHRX0nqLyrXH3E3KjaDuCp+n2ai1P\nGWV4gzvQWmF29+w91ONXXD9UcbZZIsrFOWCOnwv4yv9dz49jKmA2fHVecGce\nD2SLIk5ra45o3mkB3fZxP3mkbSKJhWnCveu8cgPPlZaRW1nxMnBIAvOf6zt8\nphvtdN44UOg/g1sTisaSGJ08ez8YnmcPH7bMV/6X5snr3YZJee3u5hM05WQj\nvBp6n2IMIBs2K1iioR8maCUKHNe9RzVNaAg3N/j3SBnByyBED6RrelUJg+Jt\nYeJPnhf03OJVuWXk3XXj7p5InnNLbtTpvZtKjQbYv5W9aCMJ85udhl/vBpOA\nYDp5/3UTWMemCYI36DKA9E0DHDjtWLuPjrb8RjfkY6k6U2X8q+0rwsvZkBue\nXec1gOPZ2JyYCTdr7t7O+3oxbDddKiLZJN313YzkEFwgxm+flJdLBGL06mbe\n3yEH\r\n=u2zU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdqAl/xRTJ8LKqGizVyR/y9yZw+dErfL++7priV4g/SAIgeCYwGy8FJzdJQMKDn3b8YiMDVIVUDgZsRnAyp3J9uqs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.205f7c08_1542585205624_0.5238039828518817"},"_hasShrinkwrap":false},"0.15.0-alpha.f6bd44c5":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.f6bd44c5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.f6bd44c5","dist":{"shasum":"ae4c58e510686602f0b3b6920dd0380fdf4a8141","integrity":"sha512-7cubcsGJGbkCElixvYu1ojaHGhSaoIc9tZBGVywfKgsEePlJhW9RzVTt+zMKgQKhRrdElhFQjmQBV7dUZCorKw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.f6bd44c5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8gmXCRA9TVsSAnZWagAAYPgP/jbTRC3usLeoklUfEuY6\nDkEvKlkAQcJeEPaDRluClDa09GkfliD+6C/qbeBR+cd56uVpfHQ1bfyPdxat\ndaiFFMmtZjFkweD0aUcBSnS+LI3aBPz7wBY+GOfSMtywIE481JgWo4q6n+2u\nxAVsR5i0LuDoga8OYQcNwi0/JqwEckKT8n2ei5q86HXtRZbteGKtzf0J8ZJU\nM0ijPipkQUKML957CdmOhYJ0hj2LZWqiYWxWALY2oNIkGMZwXpdhcg2yl88p\nqkSu2XQD4djIapQHws6P1QoGEY0WLqUYY3B8weosrF6W13SrMNe9+Xof9XVu\nRin8VU1Z9ODEyP/WMbQnZ+VfsSMQ+kBbaFOL6YsjG8F39XKlCG7zKlz/T2Wf\nuaYzPasaHF0zvnDK4A8BU4FbD9qQvx0gCAaz8V3I+sSsFip25nANZuGBvmjv\nOFGkQKE8YNwKgE00IxxlcA+tFhLiNN+r28CUgHDnS/a/2N30UNhSNKQlUFZ7\noJJaTFNjzx5rNK6MyFPtCvZig3FCLKO1nNAIQBvGs5Vwi+Xq5MOa8glq5ggJ\nE1q2QWrBT3Jw+kjrbixvNCIlYmnukbNYaYn/2CqxCxXvOyHsRowl4C+7pZuR\nfMTreR7vrkjbv+ffL4cXjPV85ZvTRknccNCvZuJpsT/Awaq4VR1en2hR1DbG\nelVW\r\n=+ho/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhIabWJ72TG3iknLk47U4zr0hne0BvAsAZW3viJNXRmQIgC0dsE5S1SFnU05fy1SLVEqv168aGMC48Pr6UVCKSpCc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.f6bd44c5_1542588822546_0.3458793545207244"},"_hasShrinkwrap":false},"0.15.0-alpha.b3d4adf9":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.b3d4adf9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.b3d4adf9","dist":{"shasum":"060a34ff8bee0cdec1ee7ff0bbd224126e5695e1","integrity":"sha512-hMIhTyUNBOFpU7QkkNBcgNaGRRmHIf6CPdjSApfUMW0ImIBCj5A8bae1E1YDuGB/5qv+sVfW3Ou5HDs4BBzxMA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.b3d4adf9.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8gmkCRA9TVsSAnZWagAAvG0P/jjA132ONOz6wN5xagmF\nNjwlZLWns6i/q8OEJ+a2StdwRCm4qepiOQvdirDEWmoQ29qxMHjPNiyW/t3Q\nNhENBLkFR6Dpnc324SambgF5Lma1bKJ5PA/ddkaXBo5hVpRrCg3lADvYc8KH\nYWYAXjKNrOkM24TvYg53kZibuo4gvDIbBZMVXDA4rlgltB4UgdQcsGxQvmd+\ncrwBSCJ2u0RCw+sxY3dDxGczVXzjCsi2yd/awcB6O9GlR/4BQn3V+u+gzfIr\nTxrDuRWBoeWwNVW0jxm0qdTZU1VW9vp7BE9/se4U0xND+tLU7PAtGTvX7fst\n28tNy3n5D8CMyjp0XtLzRBknl3WNHRc4o8umdvLDhyMoPEXFxKU6HH5EH151\nAef8Y+dLAt4lo/90PRVb4SkPkeBAG7dCwp0AMpnaQeYyoXjDIfbMrvwpT11G\nqia0alh6egBA0t/8gqcm0pNjnYttnqQOKCx34MMoXb0qym9OZurihmiiC5T3\n2EroUk9hYQDMXd4+KvC6LD9oqxF87M21Q4FAj6hhs4gOUD+wDSjfoiwW9gzH\nAOJklq8hYpFUsj+EZ2pzdsQksBv8X8YK+xeUMv2a3byWCNb+IrVRozMgJ+W/\nQfFQzzRO3+JGYq9A+joOitHoQJy9FWW+VAFnn0a3YbfQuWqh5uT2BIoOq43V\nnP7y\r\n=+6TD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiS1x7+EVBn8aDIMJTUvaAqFAoj0IYQjZzIYkVr9zeaQIgIzg7YahUMas+SxnazqCNB6lb34sPNbcZjjdbnh7ICME="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.b3d4adf9_1542588835690_0.2873151536883849"},"_hasShrinkwrap":false},"0.15.0-alpha.14aa151c":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.14aa151c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.25.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.14aa151c","dist":{"shasum":"92c1c4c5eb605ae967e1c4f40c37a8b91eaf06b2","integrity":"sha512-WwOym2A6/vTYW5kI4EqdNz/eKr3uFU1Ygkl6mgQmtj1hWOkPq9OwWpgNqr4tD0DQv+PgY/Nt9SWNqL78i/lpJA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.14aa151c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8gmpCRA9TVsSAnZWagAAaZsQAKINOeVSBn2nqR4/pnwq\n1pctmRt/nuzZ8miB/MHM2dkefQyLTLpO7Fyt9iXBSBjpnJv/4tEOxOWxpOGR\nO48LqHU+KtgObaH86gCKrWCzuAu5d4OInaZEUhSNBp9mdOBN1yu0/HMDEbj0\ndbsfD4WeozvQqt3ioPX4jADZk335vJae4YefPglUd9GWcT/2f6O24fAtU/Cl\ntfAI+/fKcxIul2pWldIfUDjmbXNFuDKnH/lEQ9FEUguyJYwWknt4p6TtVsEs\nTvbOZ/aJo+jNFUMWpJYDlGsrBXzoim32jSOlWP2K7qslSRvSxSzm5ugTLhOP\noqCfhs/oH/7ufarh+ocNP3LWK4hq7xyu36oZKpM32xf6KdrKCLt2qhD6Tqer\nAR0L1aDepnkYhzGlDq9hNeC6eQ3cl2zmLVvSG3zE5e+MWXbVLH5/id2krRkb\nd5Wb/Zr3DrI6n0IiwYzMbgsAzofBfR7u7/959BS6trqS35B0w0Qo5mw1v4oO\nhYuPhWvCdTupYOk/YuIvMSLcPO8oAPoCbErtn0XU0/AyMrIDPT7a8FzvD7+d\nbappiW9fJ7zh5ucFi0ZCezgo9EE8x+lEGFUVhoHZCOYlqiovsTtBbmRilwQC\nBzVqloJ5M8j08TUyi3ryStKcxXTJfjSsCjdLgukdZUQ/SyltXgv072615WZm\n0pVW\r\n=Ogm6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICQnJTH6M6ij+09Fl+cZPN2Vbulg1Pp0k7kueqoS2f7cAiBW5wLJCb5kDK3f1/mcc2zrfxl1zKnvoxO9xvufjibw0A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.14aa151c_1542588841256_0.07102872843105379"},"_hasShrinkwrap":false},"0.15.0-alpha.38c66ebe":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.38c66ebe","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.38c66ebe","dist":{"shasum":"89f3436bf87320a36fc50533ba726ee9fbcaf522","integrity":"sha512-2wZlmLD+wk2Vvi7Hg34/SpFU5xSS1XcN7jzKdcJfRo+v8AaSjE8enzeTl1Zdi8aDHyntHuvzvavzveI631syMA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.38c66ebe.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8nr1CRA9TVsSAnZWagAAyogP/2OX709GEZqZmRuCZTvJ\nAPtpWea3l/PtstwbuE0f1uu0AtVDyuvfERcPWQ0lqFcifdpS8uy12oSltIAe\naG83k9bbE3FtRCHENmkt6j1oBZ/qLKi8LJ4cJz9KP2+BKuxdgpKPrLlWgyga\nYQIW2PiC11QxZf7GecShl6spNLliHEwa1EEjxWk+8uSPYdChUz7zs2Kv+5M1\nK7bVPwHbAtWwZlFY00GqIO28p/IlgOrllRHLRhrg53HH6PKxIkRH0nbH/cK3\npl2jMj/QevhNUj5Nn3Ji5eeZTZXWkNg4JY1TyoyOY2ylhbt2ssAsaqWOQtGB\nQMb1x975STAMeIHuOrItGUoEXW8pl5AjOM6l4dUzFvlw6vHV7qwxPopg/au2\nhrPQoAGx413zh4C2besCz4Janv2Pdwkw/KoKYpDCp8D1fPPf/EX3H3FluflF\nXQguVG7REY/HkXiFijHpXExbDEgzm/sWKKVMGQpUaaZwxHJoq4NPv9kvySZC\nCrg62Wc7EZkA0imZ5xeSTf6uMyKSb9J9zyaGLfwJiMeBuV1E8P2Vobr8skm8\ntIDckiLJsR1dYLunILhufxAS0cH7W/mJN6HlcsrWviaFUUopyp2gPKiT5Ws4\nBsKl2Sux4JkV24oIbgtjkq0inhTyif6Pd6QDiHXvUyisrNbxYyyLiWSyK0O0\nv+nf\r\n=cGGO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6aW8C1kSpGQiFz1GD3kFwUfxWp6LMmFCQal3wYirRiwIhAJbFYHGzLJAKAXGHdO3nlNA7Z4pwXluKFWhkr/UlzqJW"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.38c66ebe_1542617844931_0.41629456105353646"},"_hasShrinkwrap":false},"0.15.0-alpha.0c9be47e":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.0c9be47e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.0c9be47e","dist":{"shasum":"d050feb099e0fcd3d0540fac88c273ede029d14e","integrity":"sha512-8hEWC3ulYPNZLgcjIvkNO9gdadNGFvWBUfSl5nkq8k2mdCAv5XHLGuqxWIhdAXPfWGhD2eAynM8lIf4s6yYLEQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.0c9be47e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8rL4CRA9TVsSAnZWagAAw5gP/jla3d0QDxR3CBYrHvEL\nwxLSdSXhqlIIU+Umc7EPncV6Z0taGZOSMkjua3v0h3jufId5PlX/ehf/+A9M\nGaycvkI+RxX00nKhfrutCpzlM0rq409/Q1xxpz7npZq7fXmtuj8dqucq97XG\nHhcfclpiso14dKqRm4d2dVzFfp8CAybplyllSLzTDxX5yApR1g/AG6+bgIKK\nFhfBvdZFAHqAaA85lMFGyiXEmwURtB3tQg1qqnRB7V/9GW0DKq5xBPGxeKYM\nTS3GIHw5ieWtNmJHQJzWMbN5yyTFQTD4EkdY1lRzus9AWd1ya611GJ/4Sfm6\nu9nBfmScPnMXO6mwfGCn3/mwEGkkgo3HDNq5GzUFcCW5jRX16TUhHk9U+BoH\nHGD2I35E77MAsTASCYY1h8A26ZnoslNkpfGs24PJ9lnKeesviy0VgXHKi3ze\nWa4LMHJuGR6aRsLrelneDsNu7aKl7t4TiDg/E7HNF8X1FU1EPyr2nspCdUiO\nr2urbhvjqNBZsI9+N7iWi6DzF66u/WIdoOJN6sRi4EQfe2Q315ep9QJmlcBc\neR4YsSbAm0nREykXcQiPmM6ClOiiOmZnMLH9tUxf+UFeCkMCcRzqdt2+IWl5\nJMmSQy1/RDMpDhkqHxbuKCwvKEwGvsmv7tTIyQPDWhHQxDfU5z6ZqQM1Xsfq\nueBC\r\n=uIwg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB93dMQk9F4Zm+TCLNJ4oEDBDhdp4jDEfIvF1beMHSjLAiEA/kvnE4t5Sq0RHzRWHJCK4CPoynnqMP9Mv5Tbin36iaY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.0c9be47e_1542632183536_0.9141011050252656"},"_hasShrinkwrap":false},"0.15.0-alpha.7f546158":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.7f546158","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.7f546158","dist":{"shasum":"ec8deddaf00fd21f60a6999cb0ddcc56cafa4e79","integrity":"sha512-Oy5OIXzkp4+e7DiXqjAW5MAiU1MBhoS2pjPDw/p6LtEs71fzhMnc3+ASfhbBYU6qh8q8/RTN/pDhGuR+MHXpCw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.7f546158.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb81hXCRA9TVsSAnZWagAAIlgP/32JQglmqGLYaXBtGrq8\nADZD74Mkiq8wflPQSxnFEbBJCRD1dDUyCEj0PrpQEOmY5bDdNrUMgZGcg0VX\nj+p1Q+vCqAb4EVULUjpUH06f9qagnktXtash4UfPaaIH56s+7l4Me79wmdSn\nkGI7HKjwaMHHoCEoNMSSuDHsMMJ+Igs+Gndx1K9D8a/UH9+k4EACk1L+Y/3h\nDqge77JZk9f3lcimUuArBwe1iBk8XAt/DFPWwS9PgSyJ+VMVHK5j9LdaeEmc\nTE3uSyXEU7r+ibwY29R6ZQTaeKIWf295TGyuE5guYyzse9mkjkVM+UOXfs8F\njd/MavBNtDZHBq0rNHUhT9So9yhbxHgTrVo3/j+UMPcLb8Gnu1tEfn1hGnGl\n23RMOL3lZCAgsFXbC/evPmtwiiKaoGLdNbS2toL7THKcZTevAiJ6arX2ZwxC\neLXOmG5q6266JtN2MPsMHMzQrAWw1BEmWTvh5EybfUbxeCmYOuZUqIQjo0s4\nn+X6H2swLUd1b6EN8LHvabOmLXCtDl/neQQ4Zwgj6qcOL7A2m/mdRaPuRhmW\ni+aTJUDcMDmkJjt3FJSHFINAcmGafPcjpRnrWllfZTRmrE1qcf29B7nbWvN+\nQbVOXkCaGVrNZxLT02pB6a7UUlndMLjSyTm6Ejj275Mr2JSK0i/EbCGQrVn+\nvtso\r\n=DaQ0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiJux/Xeb5OlMsEhvUPrD+E7osxI/rxKHKKyJsRN3d+gIgQwsT+ok05SHTaAMxJt7tZ0xvX0o4meX5pFWkq8dM80A="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.7f546158_1542674518895_0.5759116956805457"},"_hasShrinkwrap":false},"0.15.0-alpha.8055a3b0":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.8055a3b0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.8055a3b0","dist":{"shasum":"3046c26cd7527a65f664ac4152774cc9be4fc4f7","integrity":"sha512-39Zkk987mV+67tVaikJDtjToNg3ThTiutIAvYHGgXtEoEQnTijcGqca6JycgpiakVtHlAy5OLmY6KE/fyMwAiw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.8055a3b0.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb81ljCRA9TVsSAnZWagAAW30P/1EQ2gcIXmIWSWtEBOZN\nJkWiBGZRQgcUlfpsuefDdk+4LaW1ChzH9MTtK9kugsJen1/6KOtJOXSxy10z\nWKllceu/2bsnoXJ3731/Yvh4yLj/OA8aHB6CWD4MuhGExvid/kOhiAUizLz6\nhozuYCJpgFAmn7h8c1I6o6ghUjVa97QKcGEUH9FWl6H4X/6pM3TsqrVEz8yf\n86Yvfp/0nPGhiBcS7RmEuarNY0s3zo5z/9CPynYrmxB/GtKR/qHSnBqSLm5G\n37B/yTUgk2k++DFEsf8LsAbqghMqkvKFclcbZfTzsc+XnAG6Y/oHhxFQWkD/\nzDTmG9DV6d0NZBwksJR/i2K3RPOdhGZuk/HeNpvjTGbWhpjrAyDcCsDqdiOB\np2IRBln1/iP2r3/wlSOA6Rm3SmY8M+VSZvmYMfRcMZKMumVJuYMVuh3+mkgk\n7UtotVrHgdx30mHMRWdKhZThdkZLN7093v+1Mq6CS1R4AcuSI1wvwwrC+dcl\niMrzgMem0f9eb2/uRC/dxGvL0TQ06CB6BoEFc62snATF/yK3fkd3NvXrTR8L\no6d8gdAjRhOA5dTuRQSawIfztRyM+WyJSbF3jBKaoLlGhSDJGoS+h1CZCHhJ\ne1lrGeX/tsQFYis2nl+ayY15DIf4q14J1yVwq4qvB4GzB8r98leOhHTD7hD+\nu3pF\r\n=3XEC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdUo2x/3czFi6RsxcB9h/1cH1ANRXDLjeKgxUpNgCHKQIhAKypeIMjNqKCfQq+Q8pA279huyAwtnuoCzpSKN3ZWjGD"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.8055a3b0_1542674786480_0.9666175480598369"},"_hasShrinkwrap":false},"0.15.0-alpha.3736a87d":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.3736a87d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.3736a87d","dist":{"shasum":"87738ab8a67d67344cdf7e21081010276b9f7099","integrity":"sha512-/Py8YhRRrd5IbMLepHDjLAX4OSW9E96eTwwvFHSi9CY7aHbEmrnten50r2dtIvN1wTlGFGzthQOk/f4Cwf8tgw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.3736a87d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb81mdCRA9TVsSAnZWagAAn+oP/1807fxipO3KcLsiRm5b\nVNvg8gJr+Nz4AaEBd2MZ0OEmAV8hXVYHgLKlrILbemsGq/cCE8hHzwuMgsVM\nSVZWAz4mC7+WTc0E+4uBJPYsszgmDadgAzuS2ipZYHu3L7smdfYPO93O25ur\nUPqnqc4DroKDOWMgiS+3/7qPuFI6nZcJjMRHUq1evXO067y0n41WyZNY4Dgc\n2DfQMgFEa/S33CLZ0m7qmyvzBQREI7vloBrRBVprsI90sLux5NBCeudbnplW\nqlh9ZT27czjGCI3J89/XdVRqqpZL7jICpXDBgwmHhypG9seAjQhbYYnMEn7j\nct5XnzNfRqkok8mvhpquDotS7YoZzuw3QmdxHOF4BRlRbGLgzV8mLKIUoKZB\nY5BdobgjecdZy+7NB5b/SjafsDwT+Algd/pWSRNjIwUDjLkRrmAj6FwsfDpg\nL9Jqjkmzx4309IopASj/VqwhVI7eC5NC2SHUqqXcqmWYzGuidOhJ1m12Gr+M\nXL8hYGm9s8c+d8POWWTCD/dpDiaEJ2S/zEBb8GIJFG0mgY2Wmt20JobowR0v\nuEop3ilxYjcHONr1shoTS15lKCcjXljje3uSGV00aILcuAyRXGwKwbB85SF2\nsQfCMmNsVZFili0Y0IfQgiEq03/Uq8XHj1AXWB1gjuu40BX6i5Gc8yfIySQ/\n3RIl\r\n=a0Vf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzvN0wbej0v6WTi7hJ2SYYIJlIKvJdZsHmIOBnZx+FdQIgUiJXtNinD6UAZwuvaukqJv1bI3gBKJNkriiEqtL8dlU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.3736a87d_1542674845058_0.07131033010707788"},"_hasShrinkwrap":false},"0.15.0-alpha.257163a3":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.257163a3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.257163a3","dist":{"shasum":"3e83a738399bcf78dd64a037b5833cbfe20f712d","integrity":"sha512-VTs3tHmZ92BobIQFNMTMgEQoyXSK4dLxYDK0SzjgAwcOv/X3OuSeJgRKU23c7YjvJLHk2Kj6lz00guhvQzT6jA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.257163a3.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb82N+CRA9TVsSAnZWagAAbUsP/2GgUaRjJq5J1Ov3AOEv\n33xKm56/RQRT3Rtoa4GJU4X/ajpaCwfLWJxNhp87NZX3D0b4mSLFoLkw+28s\nJVnItrsRqhQis4UA0Wks34/ph79rWRFiNtJUi3vdjKxaGcxzBWMjvozwUR05\n09VkxsjRf6roSwJxfkTzbR6xUmwq8A1xROZ8eXkxAZPOQW2Tc1saJQa9UXIn\nL7BD9TQcXKRjJ0dlxzjPjKx8vkvJmQuT3FuUK5XqxUz8BV7L0PhEnc4/1ZN4\nZAjEdfia626Pj6WI4ZUpomCPvNQDAVLReuecd/5Zo5f/oy1suVp3VCv2TU/5\niaHmTs2mAOwBzkAEOBaW5n613LTLIX4C56aJKnd52hvJ8JKjWxy8HjMpGmf+\n7CHENbKEx0wqUJUIhdakIthBUNagUH0ApwABa+3hVZeDAP8MC9rGh6sIsKEC\nh3f8rsxRQPVHDkrOwXmXGXgg1Ta9ncSIRJnICnw8jtjq8YvkU3UPJaPyeOwd\nR87AfRH8CAwHAwCOvLKfdXJvowCXXtQ+PZF+lKrk9G7AZ0uyNJp1KCv5vkO3\nRuW6s2uw0o78d+qv/Dr5IwD6rX0qbK5E4THuAbfefGvHPOS8lGjZUpNPFpql\nleqbgG6q8nb6CUaSVHLlCPX8h9/P37J7RI+bJYED6HQ45tGl5ZZxrjHzF/Qc\nWd6f\r\n=jscG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDFwOqG6wjMcxirRrs/NbsA+2vJbyhzQDUL+LaM1Z1wcAiBqPI6vcnFHvu+QkG1hLBclrOrc1YjagkePBPE9VksEBQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.257163a3_1542677373864_0.3764802170729833"},"_hasShrinkwrap":false},"0.15.0-alpha.9ccb668a":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.9ccb668a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.9ccb668a","dist":{"shasum":"55bc5282d133cde933d8f3b4e9e307a734ceb266","integrity":"sha512-iGpmefpg6xa44B09MyLl5fhgGhl/bbMLTVUFOLOcWaVNGOUEjvFRb4Ae/7Mx/4f0dHj/ndW+h13x2USvYzqUyw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.9ccb668a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb82TxCRA9TVsSAnZWagAAVUcQAJ5+ICJSeCar6OUfskOi\nBexp0QnTn5LJ9uYaUlRjhHZ2Ho27aiblumEXpcvDSemeHSTsct3m3zcFE4V/\nxwFAMmb+/JIUbyTSLMU1yZZM/sg3x2B8xq7AV57gGml08CCNo8pfl2pNZ5iX\n+BN3KPFL4e3f0EJoCkYCanZltOmn9HwHUjAbW4Gp3rsm6XUocEiO/rmUZULf\nkcZ6kr/lg7z6SsYoc5o5uCCkN5zpOIiQI57HZMMW+2kHcWk87IVp35JEEMNS\nifi4gbHfeJrS8bUJm8AeHqHwtgSElFeCtpxzVa8bXM9RptopotLhprlt91yf\nIrO5KRcUTpT8ZfBck+b32tsTiiiyOy/lWOnoPeueWeFBXjEVl+YJdzjxbxmh\nMQ6SZIm1E9NRlODuMmmf4xM8VO57qMF0mIrR+LOMJgLl5t+esSsbI3l3YZYC\nupg0fJ4oZN+TH9Z7A+G0KF5J3N+fI+9qDu/LtifWKQkTtPJGACq5n9keIyO5\nhIogGX+PDC9vAbNokVIwGS0c5IeXvXQh/KpCEkJX/UCSVR2LKg2XXzJffAFY\nU0YExEweh+XfvMZnQCUVW1c/00uTJxjXj0zNutke45Z0nXoFfIHQADauSdI4\n65YRn1M8R/Qt71TW1DVORp+5XGOH6JDpTVem7XMvt+aW4G+grCrFDGzCrEFT\nRbIi\r\n=ihaq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGFMQi8+FtESKnfuFg2cy50BnqEYPbZpCTTMKuvcsMzAIhANIXrb377pKqxL6uJGZhppbbbLuHWCh2cTCI5xlKE58e"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.9ccb668a_1542677744372_0.09683912437690734"},"_hasShrinkwrap":false},"0.15.0-alpha.4877f55f":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.4877f55f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.4877f55f","dist":{"shasum":"050ccf691f62b87619f21df9d6a8a95a030074a2","integrity":"sha512-Vd20lE125KtgBbakp6g/yWU+Qa5oTZGKf5xsC6hnoNDJcZ5D7PYtO+5JP/n7F7tnAixM726kqadxLzntGMSxxg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.4877f55f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb82+zCRA9TVsSAnZWagAAqDAP/ilQ/9NvNIdgfc/1SyvS\ntfQHkIBF3bVYgdL5NQRHcWqyKr7Ax5lRzu+Y/0HmUpEvFPQzLGXN9ic8dBZD\n8ncPz/XHJiOsa1ex3qxdTqoWfZcswFxbW0r07tqswfuIs6D/ocS/IZdltXbg\nnpODR/Krr2e4bGvt5aZOFJN+u1nuFWEcn/iwxXIoEjL5ZgaipBHSM/SD/eoG\nkWiAvdU0hSLIqGjfx+gjuXRTZeS130aGL4ZwXccE5/1mH7TzUP6q66SUgkwG\nGsvC1NoztHSobia5EIqaLeG+EnUWYctUcJhqwM9AfIxTFhyG9s2ZqVY1Ul2p\novoYjsy9ApbuyWfXrxwGwKr8iTjysuRx3fbgAGhN63zOBOlFPsAsFvnA1Q0X\n33tYusd3rzjvwuAZ2zAgIiAg+8kUCLtQnwdkr66ENqKjhCvhCh5bH0iuGvIE\nwEJgQTEXgXNpwZXnFNstzWBBHbjX/TdFI8DQmanPrTcMvtpSgw9OMgJxeqaZ\nFT0m0m9ojFvlmdd3YZuOOrSAipnVZ1UOH5NqY/7qh4KlFaqEgV9NsFpnndLg\neBlNLSvHPuve3Qfd7DKGi/WtjjHFUqA5vEYRTDWHRYkxmsWUNHtBVy839Qsi\nRnY8A9du4TqSX2Nv3OMdfDY40LV06WI2yebraoungC90/oVTrPQDSjI4bE53\nLMQS\r\n=9lqv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2K6Mq0osdXbuUhFKnlgKPf1tVg5bPxLSky5Y5B0YXtgIhAIk0GCVGQPZ3R2JTZD3hMy5fEZS5/LKyZkYfeWD22F+g"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.4877f55f_1542680498694_0.21615981986363297"},"_hasShrinkwrap":false},"0.15.0-alpha.20a298e6":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.20a298e6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.20a298e6","dist":{"shasum":"a2a03f5908738ed51f5bd780728b88611a4eec0d","integrity":"sha512-bCBJ1i1guPiNod6qlnNFACpLWG6L1Mc6GzYutwZr85aa5zcSKVA2k0wqMCYjaMpj3uCaM6THBUPSRTnsd8KI2Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.20a298e6.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb89pYCRA9TVsSAnZWagAAeDUP/jjYbStlcRkT/KhYKjhx\nKUkhleZ5hK58jQuOhUhrVGplvoJXDVQaFWH+/8rYy7/oY6CIV/r0lLs3tlwI\nHYwOUxySgR+Uv/eB1X1FWcL6ZEF8vyA+hsp/3T4vENoG0/odOppVwdN+9Nws\nbC2bd+1TIwdrJOrLxLNpAN0lF8wV0iKWpiVdsjUzB96QmZFCh/2weSbLnG84\nIZTfoDF1eKYuXu4KlSRmQI/POHYBqktsCi0uOqSPddo7ENg5zUhMAijtfjMC\nMAAnrYCpyMLoY2hBmhlnhxucALQzI+bPFeB9iFbDWajCCzQtu+jGkaSzYQK0\nyCFKetoX15Eweavf12o+Zw5qnnpznvTeCsmaTniP149FoyDZMCP0XxhWLTce\nOMJWrsHmbcB4UUiKNs9PPb1TBLwCyLLoNHgAaY3sPpwhOv0MAoGsXEWDT8E0\n2sayejMWn1Uu598KbLa+FnoBlotoxxWXo2T1cVKvUakpeB5XfmMpS9p4bcrJ\ngtQ0N9WFtigH+hRC8OAgW5dlOcZhAdHUTElohycniqE2ant02mvLg3DcuVaR\n4reMoDfvMXOYe6rpQEdsId/v62CQJKzaDX6utpM6/THMzpo1WTbLsLiepuPG\nFJarg5oYrPaydQBggrgBbMMa9+i2TvrV9gTp50tTJ3sJLtMkUjYLJDRps/5m\n3VdT\r\n=fXJu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGYcQ0h8zJPPy6Xt48GMLudCuhhbxThhJqfI39S2O44yAiEA5cSx0gzcALY7MT3XybjpSRrv+iZom+ub0tEm479gNN0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.20a298e6_1542707799552_0.6019216972342298"},"_hasShrinkwrap":false},"0.15.0-alpha.e6a49ca2":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.e6a49ca2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.e6a49ca2","dist":{"shasum":"3699f7716b87caeba672124af7b82cd7df26ebb6","integrity":"sha512-XcasXvQU5AOv4L4KDM21NH9ac736IziyQdUNh8jT2KLMXeWkebrMW4wU+wG81GC4L7Y0pMGSKYyIvpp3rkaNXw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.e6a49ca2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8+D2CRA9TVsSAnZWagAAR60P/22ZTLjGWYn7u32VcNOB\nDk3FzBsMIhouC09FIFwHVl12Hgyd8Pc8M3gfAbj1guns4kNXekk9fwY2vXkz\nHpjAzmf0ZzLSNZ4YCwrU8nDIECjcrHriiBfNPkkjADvFPWA18+FlH9YJHBb+\nCf97rcZn/y5DkXiw+3aSZyCRRLnMC+9akx9+KW79YntklRLzaHbdRAL3fNdV\nR9RsPG02/hiA8Iq9RpcG9ZuYxkbtxiOk5HNkxF4hSevUzec5VklF/A9qu+FE\nJD2Qf2Wl3QaiCIlDAyfzxxsk/8VBOMC9qbqkPO91CK2UoWafjOfSzYxxf0ZS\nYCDpxT0A2+F8hK3VhckkkNMDdk2am+eNHS1xn2r0HZbQQrUlKvtgPOQJp7kF\n/PxUJzw5zmMXj35mpMvVT0MvWQRWjJxVpgp54ji0P0EkwymJ5hX1s00F25qB\nbuoYxeMoDcVVSZpX8/yxuf4gI5kQMRxV/HSVQAvdN9DLd8xze4zXN62IBsyR\nN2Kf8qmd3dRAo/TwM1ixePmdAUoF3LHjadASwhFAKU+eUuBUrZQEqH1xEa1F\naiy0InJATmlO+xtx4exDqS9HbzaRvIQ8P0F344Mqla2RgNLA3EYPjiUkXMtk\ndPycHNfO7P/6QppU39JaRxL/7oWb2+oLGSWsrfMTTxSUqNHQXSY0TAKODBd8\nwzan\r\n=P0Rf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHFlGC8TDYlaZSgkhruP76pNh1gCHcvB7j4h+YY/Y18MAiAMZa9rLpWpzztdfnQy7Mep8/oQF5FsSpQCTE7M30B7vA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.e6a49ca2_1542709493620_0.8300480477348444"},"_hasShrinkwrap":false},"0.15.0-alpha.7944ad7f":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.7944ad7f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.7944ad7f","dist":{"shasum":"d97350c1f1da38680eb5ce9d5a2b719ddc89c7b8","integrity":"sha512-z9JOFFDTsSqNy/LjdPHNKSofmkATxofSc5SJZMJT/CTEQcnmrgi1m0CUvkDsCriN1qekMsPK4WD8gYIqnqH2sg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.7944ad7f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9A4sCRA9TVsSAnZWagAAmAwP/0VZwMsu2so6fx4JP5VG\nfZ21nw94/vhVFnt3+U+LRrCYvGIv6IiuSmGZimuYg/R/7EmKxf+bg8v30PoZ\nSf6OvIFpRJ3F+VWpMQKoGbC+Bd9pwCnVFFnSxG5vwIbFwNO3GVjZPzXSMiMZ\nyo+SQtOnFZqskfYySc3KyEQ/5//xfMmf/Me2ja2UdL/Dkpg1ISLkIwgpeKYO\n2O/csLiKHIEzRx2AFTqVBdQ/oc4a208FdPOtlQFiy6X6/JrftaJM1EAjLIi5\nizRjXPkC/wAOWVf11zUU72T/apl0tZ99wb6tBrHvzw0TnnAxkc1la1rTLKJm\nWtuOesUx7NleGeA9Iu8tFnkfBVLcgJ0PNqs2Adzj0Mvo9ISMbiL1cXgdF5yM\n3eWui+TV0+33Avmpua29mS9FiMnVsQ27VYLa8V34N+URZbb23L5knjAsLQSZ\nCDX8cKE0B1/7sMrhtaugy4l7Fx7US46w9u1IjIKoAP5aryEbX/lPkPmdqAo8\npKt09Q4V6Pfqmch9kv4ByrhZlxMZXmpQZkkK1J85EILiqViiAChdhhV4WWNC\niMf3uaiEvYE3ejfM+3n4vP10W1IKBvpvbkYDGsq285mnCq//rJsH09D27LX9\nmVyKFcRlc+FSZUUazaBBgdElxWK0Zn/mUFNcdXGMvAf1oWpGAySPdZyfOI9C\nQLsc\r\n=DBP2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA7PekPih1wxP1bs4xkqh6mKUkz50SGAS4C7UDfJrLK8AiATtpbjhqa9/rJCqL2ZBa7vulOR8gJ+1Uk8GMA3cBtuzw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.7944ad7f_1542721067705_0.6868941797941419"},"_hasShrinkwrap":false},"0.15.0-alpha.fdc14503":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.fdc14503","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.fdc14503","dist":{"shasum":"79bd6ab546143b9b9d9b63dbe2e162342e53d0b4","integrity":"sha512-jvn4y/nDP0t3b79L5IXVokArpLVWLcEmWWcfNg5m7YdMq+X5imwVWYonMGO5sUSMiQNUoIBBTA+YJ5ds58qEjQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.fdc14503.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9BmECRA9TVsSAnZWagAAOjwP/jYIA30Pt39aszE03k1x\nH3OO8tlOmiJ/AwZQdSpmfeqiLLFG9Uj6oBMlJ26ADCR0ZljDa4IdVy0K0m4l\n8R1drAn39J09uoPKXDrS2BUPKJ9612U34VyMk5M3AB0JBs+LmBi+Vzy9Bm7+\nWRKQp71Ft+KENHZN4DqPEG/6Op18t+UEzElnxwbxgdDWyK9MQG0P7a/Jhau/\n/LlOJA+O3HElznQpUcHGyJZnlTaXN2FWLl9kVmbfw0REIa4mPMrfoZSu9Nvh\ngK/HfD659RmpbpL3PLqj54AsvyoJOYNKRg6FuwQuE8e1+DKbFNmoqp5u3j24\nHGLxgqBaak3hIAhKy9aahViM1CmE8dNyw6wdPp4qJ/9ygM+BZqfhiTrEKNOn\nD042cjW1C2TYPO55qs05dOD/6HmL2O5BX5H27UnWwENSXqtxgvwd8rW6BBFL\nj1FxqfmkKOqlZvIGkwE5/Ay0PBUwhESSW50xroLqb9eLlYBxaxg2nh4TGLIn\nU/2uacDalTE4uzFiJrvkeUVeI5hOyIgkygK531qt87Qlax436YKDFimOP3th\niAIcIIDgVBPJH3U6+YCMrXbR9jYXarsLqW59FzeI7+kRs5cEO0SBKi+hlXMx\nRNsyDtwBDr65R48WqUJbvEkigrAGGTQGHj9i0hnV8CYJeWXIhOT/dStPRcbf\nXCrT\r\n=cgQq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQlIRWIY9BuKSSEfH2kJ2v0NDhLIOzMiPC8aARH8SwXAIgdsqNgKkibOt5Gbf2djrnGkdMGF5lJYlXABpRKGLc82w="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.fdc14503_1542723972195_0.6780486315975418"},"_hasShrinkwrap":false},"0.15.0-alpha.771c0019":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.771c0019","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.771c0019","dist":{"shasum":"7417a73ecb661cb30ff8c5b0fd998c02a38d7c18","integrity":"sha512-P8ORTH7RJT42mt0fmBQW1JogShf60OmZFSYTW5G9bWPgGlO5zQWz6ymehfCU3niKIcJ0GPN7o5djAmUCO1g4Ww==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.771c0019.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9DlTCRA9TVsSAnZWagAAULIP/2zuxGBzqRFZzscc3uko\nMfn7BWQ9skr7lEkVuKz4Mo9EAT8tTl3Xf+ub52P/7ENselCWo6fMtJ+uoO9e\ntephNdtpHp9KdG5o07ohGFDU57SUWsO++g1CLnFyKijxbVLPnFoZl/46gdfY\nCT8M7VS1BTfdPvTNfukrwdQElFT1elqNvDr97uuieoULsHmijXuXlCwymHek\npRHmlq5jWTTg1Dt0at6mWBbJRdy1pojmJig4HdUn/UxWbGzpb7bM6erYPL7t\nOhze1me/nezN8AMHWvfbY5KsM6TSkuWC98Lz4fu5b8wSesVqLu8xU3P3o40q\nEfdYjXEdHIeLYfceMA0skhRz45fm5fFROVc3yYp5sG0ptqL+8J1GDv8x3S8J\nFuvryetuFaCw94MGUiFFx2ufMQfurDqJbUTjdSTmjtxKdHEws80WcctjLJep\n72HGX7NghSJo8r5UpLZORaVoRcastwNYbAhUE8MxkjqGZ22vCqF+RupM0biY\n4aM3SHQrJ0uI5n5bymnvnxlBAqQGU/EUaN+th9FRb9mVyuHklfzr18fwxInu\ncMNcZppKZsF/iuPUjGbd1Q6D/bqbQ8+rL+vh+qwVt0RiFPWbCIzVLczmIY5O\nHNpuzvHAlpQPAnKiARYyTO10fuqalkDRIf+uMy7Cd54OSRQIoiq1cQW8JgSS\nvi1V\r\n=R0if\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG8nDQ4etZjREbrGSjKKxYjJrq3+7LG3a7KTfwT0anC8AiAf9O87JUFFAUJirwvFs4n/aZ1Xt3P8NrWLN/Cg78VlEA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.771c0019_1542732113803_0.6814088314248259"},"_hasShrinkwrap":false},"0.15.0-alpha.b1bf6983":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.b1bf6983","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.b1bf6983","dist":{"shasum":"a50e8a5addec1db1874a5c10ae8deb06724ed513","integrity":"sha512-Qss6BCJ5O0fE1/RkXyQ6/0PtKvxfQ82S+j8jwLp67RVex8GIwWCXA9QW/f6kNeDmz1HrviXcR+Q14XwKLkg4og==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.b1bf6983.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9DyFCRA9TVsSAnZWagAAQuwP+wczzVnYXUIvQLoQFedg\nPRbsCtQ8DubJgypo1HgscU4Gupk9kJ1qJJX9PzvR+xRL/Ea+rNDY8GFab/2a\noVJJZqwNgn+xrojfqD6B1OL0il+eaCw58r5lwkIDQvj5quS3UOlr+8A4JIDu\nMWsJI4j6GwE0+M7gC/0cPc9hYX74uoAKkyXMtCE01E9jypUqsxYt3nsNthRn\nQIYPXAZnGj7QacRvyEx84P8NYW1GSRagPs4YPqnLmhFmnhZ0P7K6+lZdROEj\nlTO07S1VWKdxm05JUav7oOjL1DT+mGbASXtUJcrkZ41g3ZgDA4ZB1cPYlAXz\nW+WLvIvS2ijknntHLSRJuY2TTD3Sh5hHFQjBeH/OmXksjY3Ym0UyaX1rBkHQ\nAOBVZ5IytQdVQP4kriREONtxTOl2QBmj5SUF+P/E7RhlgM+1SYAyj+kschoT\nm/HcTZ9rVl+HnKv9RLHFaGGuSnv8w2uh6JyREzawF5pz8HIx5xyaQvMIRsSJ\nhh3vYBQrJdX7oUUlovWUP+bl1k34+QXaJtkWvNQxGTOm9RZ7SYU7Xqs5Ohlq\nw9ps3UJCf8I9bLE4S68e6FJ88CraBEeB+YNy8HrH/+84dbU5FsThU6cJD5ka\nDnE9QkumJRX0FiQjZDVRqrVTWq1wD74LnNpYCOMZlPdbXpHFOyRUg1ZQUCTX\nRlZ2\r\n=twgO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCP4I6Mr3bNQqsY/5BDDsO08fAOTN8BGlquignWVOGHkQIhAIUWrRclNoSpBeD+1GsPVwx/8BpnxRmP9gwNItBVPXQZ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.b1bf6983_1542732932391_0.9229220956337802"},"_hasShrinkwrap":false},"0.15.0-alpha.1ad55ba5":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.1ad55ba5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.1ad55ba5","dist":{"shasum":"52bb0a0343c69daf45ea98f96bf0ce8d6125b71c","integrity":"sha512-Pdswe9hwsng/UnoPRT6PMILuaugP0kwsVF308UA0Mty9FZRN4ZWPEjXZ2PYxanFoQFSZnR/W9rqDfsBV9itDnw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.1ad55ba5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9GCKCRA9TVsSAnZWagAAMGUP+QDkBxTRH96JPbjEZXOT\nA55jQ2j3+4Ggz8xTHA+xPiVP7UYTww5289lduQ65bjW1+TTc4nzC1dV3xvXB\n/hw6hnj5zb4PcJz3vbtiv7q89ADj7MmI2gfPF41eMx/I5hLYuLwx2cJ8ttNW\nS6aBizjLy0a9GS6XQPpgHCdVmOeDtGnS5y0PTAQ4MSsLgeS0RtXUQ8FNGGsT\nYXtXGTBWKaf04EXV8Zkr1mND3atTkTxiIb/JPMSqupDj5gHLF0ArcPCwnp/Z\nphbNRp5q4JHnapa+LuTqyTMtxXMp5v1upaFRRA79dplPleJgBIguj4mstfEc\nkPszemdLhCX+AeuhJXXHjjAavwVAPEBA9uMgs9R0RqPk5jqaZSWGMFvIwK2r\n/mX41yq/46uPPCvcR+lG9HvCEgWHHvfK87aZZRJlfoMdDsO6uustLYN4Dmx3\n3wM6SC+4pWqM9Rg5UNJbyOSZUIg9NcpSLnKpYNZ3gl8qoqQxhKUUTu2eHjqj\nmiJjiYjYYhVZCYiJ/E9O/DClbYliYLN60mX3zNrF5aOlz778PD9bqVdB6BEO\nDvoa5ER/a6pcFBGkMlEeJc0cRe+iGpfGb5P3Y7PmN9KyLLbybmW6iS/CO7h9\nuVMgbaTtNVAUW2L+ZAX37YprWaBp2PXv8nED/LChY8pxqLEE8huMmpLxEmHl\nYr+g\r\n=O0me\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBQOL5AU1k1/6pJlEutwz5wahsjYarKjPd4PDLjlLBYAIhAOuQcLP8f/aseFfUbq7bpIRjomuLc7UfVUb9KwTI2+dW"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.1ad55ba5_1542742153289_0.10259287852401955"},"_hasShrinkwrap":false},"0.15.0-alpha.dfa77049":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.dfa77049","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.dfa77049","dist":{"shasum":"6b91526703fa22fd7bc288ca301c4220e5bb435f","integrity":"sha512-eKBLob3WW85h5t57GKR+QDXBo4z9CtNCq3dsM0VMUK3L3n3PLIcJ3KsLyRFgYCILuenCCtF5rjOip/1psf7yyQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.dfa77049.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9KEGCRA9TVsSAnZWagAAFtsP/2wQ8dEzvrRs7NPRM2pl\n59kPdvaBt+yKdeF4K28xsmZejAzn5I8yFOzE6nUABIbdtFRfjvgJcvKjzwYL\nCj1/2W5GEJOa2iKyC+tcV/CKGrLpEYUldR2cg2UmXGtHX5kfSQ75bNH/KMp7\nm/QYMsCypdqAeubWJptstOJ52KFEWi5AR5pErycWEVXwgCAz+elaWAjHXmq1\nXJosic6Da2ze/f7WbhT6UqNhht7g5fG5LIkoskLPum2WSD/pJljm8EB0tUa7\njTVnWALI1G18z/jW7vflQAZJTfwX4k9ngsejnw0WfpTwI8yZUe54G0spRuno\n0Chjp2H+YjV0GHWl8U+PwdsaOxaOkYNjsnnWg1tBa2fgjLD7wxBv+hb3l9qD\nSUz1p7XpNP9wg3ejzxF+p6R2ydzGGFN3kDsEaIF44H1/GxIuCADGk7ppPIGb\nJdULlpHrgzKxm8yMOK2GD2jii9gsVn4zrQ5xHFobMkSwGoEdutj9xAi8dPmv\ntVLFR4Ljg3Csr1ak+g4Jz5OMVuZf6JGVS2mebw/Qofo9nhL/7t8Hi4JPurqj\nVU41cFnCTy9ueSoJaSZXui0232WiubgSCOtYJ5n0RecBFg53oLIpLr06L0Ai\nRWPb6vJgvVNPbii/7u1YtWz/rGGImaelGjvyUfkVz5wGbnc/iwUOY6ctnQTI\nmCNI\r\n=P7SM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrOr+VcB1co/9QUBzmCmRXfn/kggXp4Zn0lA7hZnskYAIgOl+QTSMQLCmxJfwZ+9IB4kkWSkInii49MPpfWyjOXhA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.dfa77049_1542758661563_0.8007674349747482"},"_hasShrinkwrap":false},"0.15.0-alpha.bb94998c":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.bb94998c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.bb94998c","dist":{"shasum":"6e8ad4ab890b70bb33b3c8357a0a0175c5c1c522","integrity":"sha512-tal7Br38Aml1fGJOBcD6FuERzdS4+YBS+y+FkrfldWUHjUKdhoIeC7ogHXjvF58PWA+TKeOLGj4RiDi49eoqOA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.bb94998c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9KEMCRA9TVsSAnZWagAAiMsP/ifaYtmJG0yEHy035x40\ndtCm0PE2OIQQsMyJOkjxB3mhIxKVPnQ4eFTE30TykKbwyxzgOvlok/JQHJtY\nQPAV9C8oISDB7vWzDrgM76kiqycoSvwsEnaPAIpMs/atspma4+c9ZTSCmbkB\nK1CxVrzB1QRcoddtbHqxdA1Anx1Ceh2/WA/+K5Of3n/E1CFV7UVYlgUVGmW8\nJISp9Pql2S6zziY1BisYjJWaVPKwi9n9/5Qd5chlsqCe+86gmVasRflgWOkb\nU7HXKhYMJ4nYjjQ9LwYG3HU24g8y5s5Jn5PyWZgSSsmsm720IOP0ITVq733g\n+DfL7XKQgZuCf+HzOZYOWpA7e+yrN+9t9o78mrGcig2vzqS+e1DAwZgCbZ5i\n2J+3/VEzOQ6UOi7DgHzgq8g5z0tQ9xt4CNZKtNgwevn8a37K3TW248JnqGgy\nerJdujIiRbLrQgEEQZrcF+Dm8m/QiU7Nqd8BvyIeBXebkmIZD7s3v41nGa6y\ncsxf43XglPf8kDrFiKKSwRAvxjZU9kbQyk1IuvVmGEUpBvAYh0hOEVH9maBA\n0rYzVDGXs+BolloXRcHOrfaURgmreuRFsPXv0vom5Twn85B3ibv12omh2oIu\nC+pCVxQo8wY7lV2F/VBR/IbCdQuEcNUR3Z/4LsaLvqQVkhrSJob4ZJzIyzLc\n/Obq\r\n=cSO8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDCODiX+nfXtRQKwZPpd23oJeA3M46BURdT53nfkMhAhAiA7QFCuus0U5K2EaUiJSpGiV89mB0cQJjUJ5up58vkjLg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.bb94998c_1542758667865_0.2899131581954819"},"_hasShrinkwrap":false},"0.15.0-alpha.4e56f4d5":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.4e56f4d5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.4e56f4d5","dist":{"shasum":"bdd71eaea16c970914f549fe9c9fa820da583760","integrity":"sha512-7edd0HkWDaF9diSg+HvysUi6g897Q2wRmvtq5tiqBpBuO2MVj2mNYCjFHxi3v1HZizPpn1XnF4wBgpEXq+lmKA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.4e56f4d5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9KEpCRA9TVsSAnZWagAAx+AP/05CD7a/eZ/RWHa4dR6/\nKOCHCtZDQQzbkEicNOqRyEvHTrTV1dJ68ELxpQtZZmfSRZVJeA7UlN0CC3zm\nbGNn1aCB0A51rjm/O/setHDZDOjMWMCy4RdgxFC9c84SVGhvwaPHhUpv8xi5\nC0xBocrhBah7r52cccxHwbP+ChQrWBNPpiOaUxTTccyGbAG+e63KVPTytuV4\ntFUx/stQVNdfvgW3fUMT3x+MMwa+cuKMYqb1kkzp1fEZxlfrfqbm8K7r1VFO\n1JxNGYbNg2ZIUeoKLVt9VcXvYEm72DQYBzi/1X0m8B4uB90s3GHD4r1+Lr1p\n20kj6eB0J2lmsUEiDgQOohoutbMWNbsXz0KdPAGLWut6svM+yVWOR2tNa2NL\nq0tDqI26Yl7vHuWDeaGxO8q/ptMINcNoAjnpNj1Q9ETZi+4p/HqVZbLgYmaW\nkupJziHNxS+M1zTsMXZC/kKAHcZxsVNdNx86YhDXYQcBEkTVPGM4pciV4cOr\nJ5Y2yBhSQCCu+hTbt6azTDcAKFO27DLcankmK/kYUxUS+RJvSl4iXQPQ8leN\n3khw7Qu5A7vxo9WNBwJliEHjSkOPis7AzN0l3Qn9F/1gPTFaqun4cHfEsMcv\nm5qMLlps4RjBm634RMvdTLMgHkDIK8V0oBoQ7fB7Bt8xCiYkXiAd7DKCLnMK\nkX3w\r\n=i7nJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXlpvoR2WJ2sTyRHDoTdQU2etTlytw9qKnoow6ov9ZowIhAOF80DqYrm1mMRcbR6rrUXq78IqiuXaYB/T7+TsIH1oA"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.4e56f4d5_1542758696976_0.44651168717875267"},"_hasShrinkwrap":false},"0.15.0-alpha.f145e023":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.f145e023","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.f145e023","dist":{"shasum":"7301f583188632760f29c572f825c2ba0024966f","integrity":"sha512-/+gZIzS7lpvRs0JHNqe8OTa88ENz2Bvz77ric53nDyVlKgSWN3uZ0IBGkxNkpTz8k4gs4yriSXyIGC+Hzr2BuQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.f145e023.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9K1+CRA9TVsSAnZWagAADbEQAIK0JD1Yi2DVn5643aXt\nsm0DvANLP05dDh6LhRfzKWE7o6ErxIEHcA9EwFGCwLuvrENF/A1vO83BAwEY\n2zBi3B0u6rJJkUXBi0DeX2iew4dbeeW1NzE8VUTgDD2t7cLCTb5lMhR3IM9u\nJuuUat/xb6BaFyQET+doFdQiSDl51yIWmQqJrldRBeSi2Xs6rFxqMp6yficC\nHZJ3qG2p21hgSgjQ9sZ2meEk0+pQY4f5e9wW3szCdsllE0a7RKVuMSXPWaxj\nkBa7EM4sa8XxyW8Y7vECOvKuazCPyg554db+fbRkqtkW+TOCmahnryos/C3+\n+NynkxM2uVT1EubSGDT6/7FOrAx4j3EpImt5gwWmZ1UMInT/kFyqXarS0PWn\n/c442l7N0L2wwmsxG07kzDG27LDSodR6v2TuNFqlLbF+K//lxzWOretpdGpH\nNhb/vCvberZ8jQSk80CPXKZRzD/WGXALA0QGUnQbuJdK17FTHdh+HzwDtL1j\nSuIpZWrBK3PcJMMJXqNFCUjN6kT4socoAypI5ewYkd4MY0twBbC+x82DQbJi\n8F4FCWiyeICaReXF/35zHD6s7uyE533d8hHjpV/lweM1EzQ8BHhp1FBLMGRo\nsqOSkCQDN80tu+VboTxPqm3B50uthbk5OJSVdILCyXKpPiPpUmcfoHTOoXtI\nkzwl\r\n=67Kw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoRKIXhNj+7A3eo4gIHAGhyLfZ6QZp4XOrzvqSbsfA5wIgJGIrK/ndGRyj1LOYlGrCqxHXgXDnotXJ9HCebIJGtko="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.f145e023_1542761853963_0.34383354875044425"},"_hasShrinkwrap":false},"0.15.0-alpha.02f4bbe2":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.02f4bbe2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.02f4bbe2","dist":{"shasum":"e7fd3231657346256fc9ea1ce13f83bc5ddd1587","integrity":"sha512-Hy/eD6SXqnidIeVhl8gTRDis7ejvbpw81r6mbDmzpd13HgLQ4vSSwIyB/2jenAeooCCc4d2jYZBJzbQ7vC13mQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.02f4bbe2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9MriCRA9TVsSAnZWagAAp24P/3Dnh4ptnuKt/iaq4M1B\nKfMY0PJcxc0nxq+3xHOhFi4DKWIh4JQ5druc03HO57C1R7/PZzASiHo+kyFx\nAtTgGBTPjTFB/3aXImY6HRhkGOKB0Uou5zMfRKFwCIjwUNiQ0deXKgs3LgHt\nbjQjIOvnIGaethGrkSPIr7OQvhO+++z+1mNyPzz1LB31rct+kzqEfgYlSI4i\nqy6E10yyYlukRLHbvQXMJwLWPOQ86bsSH0mEfrCryw/+uo3WGeX9xgeK20vf\n7ar4Izxr1tDaqes52OCf0oWSJPaX/tJVGYf9ZReqdQea6T74/SNt1gxzivND\nYdF1tRye2SPwDI6AQ9NxuLMZNrRGipdwEY/cJaK2fhw9FRjbGaRE9v9bc+vn\nwG5woegYXG/e6BZYkdiFxCL1sMdkCZwf94J57Dk9oZBJSL5I2HZGAv1wDaN8\n5o8zvlnOwgupDRgxavE/5kHThg4cyAw73ZSVcRO0OHciKuFIF5ik/K3nf+2u\ni/hBVSSOZRGDbQRh2zmRnELqqjprylbXJBpXvNckcLBC+D9/InaaLhbonBei\ntwEWo8LRPhJYFxZykBhC+p3tu2h+gVMw7fbp16csPZYdMdxowhcChD3AOpP6\nUsRykSDDJHU3KDvPXHRdba4K8zNmTb8nwRZGJlszrWS+T+LfagBq1Wojrlg9\nN9+6\r\n=lECE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSD3er6VW2kECHp87jgR4mbv/D1PB/wRiDeWvMx39r0QIgPoZQjcE8+zXtpCrnALvXlfpN23lRgmFsfGJ5wdwXNyk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.02f4bbe2_1542769377582_0.4358064260205685"},"_hasShrinkwrap":false},"0.15.0-alpha.47ebf08d":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.47ebf08d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.47ebf08d","dist":{"shasum":"f1cc4d1aa456e439a2b36aa4a8f37418138fa949","integrity":"sha512-cGyY0vFXv+TQwaMB+4BObJ2Zv3AkGIgfm4bOD3QuI0ToCCWRVWgFiGJb0pUm9wTIbifZ/rrxPJru9pHKC1C5Kw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.47ebf08d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9QckCRA9TVsSAnZWagAAYWAP/Rqk85Bz1EE5khHc/lTk\nbjSN5qPpdriNhnXITQFWk4kcJ1quLJN9ejJtfk9xIrZavZiI5+EQkgDwBjZD\n/zhJP/BYFTEOcKbgH3Fhu7Xwi0E3lakCdNBzAWo/iIxbJ25Pz7/nx5hpcxn/\nvpcxBpzqF2WEbQQabk0aJqKqMrIAp8Cx6zhPqIuqFVzP3CMsYgSSFmOtvPTp\neMS7oQe4uWmQW2jThhBviJscjK2raMb3y6uJucMbpMF4eelV1ac1rnRN8MLR\nWbfzhkvLmHPyxeiLLGSjv/kNxKJByslrhg0OfsKcd46wcntp2bTCLeoKQ5/O\nzQD0P74YR6w3D1wxAWFMO80fmS8hX6wyKrU47exeXU7Gd5LlacbLlYTydlla\niihSsxnP1pI3snB+zjnBAnKwu+pjgz4wSDbdPOUxKa8bUZNCL6HTOLVwrSGY\nfF6mCXzDxE+sB+k0ds9ErtbzB3ml0FQC5NQqUwOxFDyg+oBZ81wCtb6lVybG\nbmcXqNQszMj3jvKcKlMduTS9Mn+8+DxJHHMDeI/rq5oDEKPvf+nVvgdbdvkf\nfR2zspMf0zfn0aR/mYKHYsHml+Ib8toKyZGI0SOgYUGfRFMgCXIBy0dmvr62\n6/YLppxOUPEKau6Yy5IzOaz3KI/f7MmMilTbqdcAIdexHfDrrjkGrbWDXXsQ\nmMmx\r\n=5/XY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCEDSUMDVDuMTIJCf0x2vIzRs6cXeMddBXuR4dRV3gkJgIgKw8S7uAZjLbt9iBL5dmNlTUCt2PEuw/i0MfFjtAsZec="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.47ebf08d_1542784803201_0.4441546067161726"},"_hasShrinkwrap":false},"0.15.0-alpha.0795f9c9":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.0795f9c9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.0795f9c9","dist":{"shasum":"c7b479d12035ccd6bd520a3affa5d3b2775bfc2c","integrity":"sha512-DmO0Uw8QfhxuXTC3NSqEA15YgsxA2bNZteMW0iTBZ5xHCN/k+6XH20u2V2oyG6D42pZuRE+vVkrNFCHcFJlokw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.0795f9c9.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9RDQCRA9TVsSAnZWagAAVecP/RnrnM00VfYBygfPD3Dk\nta9DbMVxqubbbujthF4+S8QGP7H8E0Gdvkiqxcv7eaZuMwo+vv03PfJsQifh\nH6nchagMfM+ls/PzcMrDkCCKND1RVWnUlQqDVxGQTdM+6SG8Ho7l71uzw4Fa\n6vMBva+Aj4e8De/pqRyKV0Ef4qcIYmmULETaws1nyXhcEt/EVW3hOKS5DXPD\ndJnPp4n5Bd30WkKpwbpSt9Pm1/Ij7puoNIKLUkjSmi55et1OaWspRj5NasDr\nojAKrdvsnMQi/9aBIcrRGRF3Rn6Oa86NIAPZPrLVu/HrKjkPLb3CVNxDODz5\nqse05zK0QR+ieXV39DWIdfAwJIa6cBIHdp3mce/IBBpHrnO6e2IlSKmPcIfM\ntLIrrFrMThLfV3jP0B4DauL5ac4M4azO4LiVqqZ98nA6TqXP9bPC+KtgKoL+\npWlzsLuNbLv1SZUHTYJ5YR65hL+MCTgGjUhyBtZ0uJ6NzgOjNSg0tCzpmNvD\nzEHN/6SwW37x2ca2QeJuDCLUqdgVsYc4+ySlrMiBHsDFezNPwwbxTOI77MOp\n8qK/0McmtXuReJU/8W5DKRwsUKYpNVtKdVzfxQhJ2ifhRM3jcOVuCGmVzceH\nH0m6eVVMEpaIdALSXUd3uYRcgGQ2iNalnwbysNLsvs5gYzehvFmCgB5GniQd\nMfEU\r\n=xU8S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF/iKYjSTKZcVStPBjGYTtnq3MLlaWscy3wk8KpLxa6sAiBBEBJ7g9y4Vd/9735q+VZhv5mOy0P8EmIEIkeS0myhxA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.0795f9c9_1542787279300_0.23963089147077765"},"_hasShrinkwrap":false},"0.15.0-alpha.b5a7dafe":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.b5a7dafe","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.b5a7dafe","dist":{"shasum":"cfe730b47d5d5973b43e016e8293628eba006548","integrity":"sha512-DAmDAhtxa8yBRSmm0Yg9YI4h/uSa8KEKwlxg8Swe6nHy51a3ZNtLPMhCZxiK1JMzXIAXHvvlKicLlzJMu2ZEoQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.b5a7dafe.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9RDgCRA9TVsSAnZWagAAAo8P/3xPIb8zDAPMZ4dinkHP\n/NPYPEUi8Xrx/gVga24jTFu+EaqiPJ0LCT2Hn3sg0rQqv4VUT0ulrsExG4Hu\njElr+xGF+X2OVYjmY7VFENRJIvOu1BafwilBbwMTczIHDFjMhV3/91B0hEtL\nG3mxuN06I7kh3+nnAeJm4q8zfclg4iTMZ8SATY86E5Mb6AHhJQ7lvNEVEfPS\nkfuElf76HtD5TPHMC2JgiQLtqB7sjyRwBL7u0q5sZ+ktQ4gQ4Wh+S2pNVGcC\naflXXhGzNI4C/lJpq8HFN/QU581ywwm9PdfWvL9tg7/EkMdocAU8ImzLZOHT\n4tiRiZjVYHSE787Fwvka+GgCUYKooUOJrfYlbQKFxeQsgBvp1RIYx/s1MiNH\n1mdR38tw+2VWpfaZO4q+mjo6e+ViGVVHT9V+oBv0w7zhPH9SjQD30tFqEiic\nYQpH84SC47a7Iv7wXQyvfbpE0ytgTpk4pqcbk3/kJrescV23/PTpi8AqawNr\njmj9MaV97TS0Cq6D2DJ5bAme4TNSvq8YjZA1NeWk1VLRhrM4ZvZa8gr7sSQV\nO2D+UjFNrfbvd3pZPeDDNBMk3BmrIykSfJ7tSH3RcwNPUgi2DVRYeYiqQwkY\nf+uBf4bW1JlqeUePlY3dEMow4ysE5fu0ertkFBgN3Y+GuDxHZD9VYbotVZ4C\nX6OA\r\n=J2+0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC/5ZaZE+4S248tjFoCzzLHNEjgcu2f+45D6eqj2B5sTAiEA7rHvHhOp4S+zoidrSUwaXqOirrXBLCWV9rvpOLgB5jg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.b5a7dafe_1542787295872_0.9578456393105987"},"_hasShrinkwrap":false},"0.15.0-alpha.2e4bc5c2":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.2e4bc5c2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.2e4bc5c2","dist":{"shasum":"ffe343740d72814f3b11e3cca1c19bf151d09805","integrity":"sha512-RN4/JrzJe2bKPEd39cI4dNyHKDoRelEk6pSr1tzAmhNGmGFjnRmOdK3iijXlijmndIyXl2/a5BKp7EqNgLOXpw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.2e4bc5c2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9RDrCRA9TVsSAnZWagAABzwQAJIU6KtTTSsBHDrD26J7\nOLWJKIqfLXOnLNmZPBMyFDUQzqdFcxd+x/867FYbWSOUGQZJRAsggNaq44VU\nvQTv9jN36EjfreLEqmX9l7cMpJG0wH6ap4c+NhHQud951WEakS/Y7yQ4Jy68\nFLy8XhTQ01wNu3op0hm1t1yVGVPPXUDdKYPmAN1TYm3+4Sm75Xo9eIcDe4z5\nV4/HtqdOUFL9NZvnISLJlngjVd9rOiYr/3gNGVBzFvjbx6urpWZTahhYJPuz\nxCcSe9X11TvgXQBdZyHEYzlHVx0kaRtS5LN6+yjm4ufaitBbA8ttQzVZgE5m\nU76Hag4euIrZKR3rBfgTLEk0P2kaF+l2K0QsVmLNxI+LmViYEFm42IpKTdeD\nOKxZiS2pkpFFCEjJRtl/WF3nN9EhDX9XgP+qRK1P4DkNaPXdec+IkAF1ENo4\n6RnCEBWj9zKaPtdEEmk16kK6lnLRmOJJN6wLh0lK4hGQPGMa35QljmTGq94S\npJAbZ2d0ztzzIMocg7xLsJk3mc54Lha9jO4xnWJkFgzwStqeKVmUaK+PLktG\nDpdIjboBd64MRlxGaIIIzCDmM3Vsy2S/8ybpetSw53kwN1EzuCP1JM6TSTcg\n+ChbimGenQzR2ry4fkdLK2HvFv+ZV4KU4Yel9eKuwHs1uKBuB2qKCSQ9mxOu\nxxMz\r\n=DWeB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFFGk9/woy5jb86sxvLWxSSLDgVUFIvoqTZkEEe4os3QIhAMPF4GlgAxf+QvhE8Xn3vcpqQ6R6i8R57LVeVFn7cxhL"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.2e4bc5c2_1542787306413_0.9752042838216264"},"_hasShrinkwrap":false},"0.15.0-alpha.fbedd413":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.fbedd413","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.fbedd413","dist":{"shasum":"fe099c9e6cf24034bdf0d1d065eb32f2c415d114","integrity":"sha512-wTS/8QjUAhnEVnjH4jOiCXNUrYNc9A7klpUrar2X+mO4mTkPzs5AcQI3L/JiAG1+6+QuaKS3Ok4Nl4faN4D15A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.fbedd413.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9RETCRA9TVsSAnZWagAAQ5QQAIVOVsHQA7LOAI8d2ao5\ne1+QIRrmoEH9QBYbiYQMIBDIYNfyhuMXBLaXWxHHsk888c87WcpNYBhC8WSg\n79JDD22y7+DRs2ZiGuJqugSmnNaaRttSKiilDA+8CyLGCxRjszVzeJYuphgs\nJL/C2rn5/8RuIxgjL4m7BqHYuPOSqHo/YhtcJ8nPSLj6NCVxAUA/NsL1Y319\nekasrfdSXpLSqwrWNWPOXhzWMZXDQ+2OWDGrYiw1EUlmuqY2BhL7N2voMzLB\nxxJSySVayUBO5qIyNzphqXM7YeEHjQ3ypV6JtD8m4bUxsbRZzdNxwZiyQDF+\nKLQcHlXotqG3kYrFH2AHjOU0uaYA4+e0COtRQFGLeUyhLR8EteqZLi1Rl7AK\n7nwBizJAxblHVe9E0XvW8Ln7IDWUoA6Clj2gYYoS4JflfP9IxR8zEV//NhaR\nJuoLwrDmbfpjZUihz2XAinKnNSxIn6PzBXVxWAtzWcU98/lrhYcU2PhYDcbM\nwZuzNssGrI4es5EvVZRIDWKB80Kjfhs+PVXVrUE3mA7zwyXaWjmBgki2l++x\nWlNmwoMPn3ARvS7MXqN/HEzrtd8cFPC5mcpATe/KsmbkjONQHk02EIvYkz1s\nxgu34u2RKUIFiAYbDXNJ1r9XWCZ2T0wWTEuentCbVp7cQ69qXXsFwKZP8uj1\nfWXn\r\n=2KLG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNwTODQJCnbtqUwhclanYA9hvUnWXoOLHCV3MWwZ6mXAIgF3CYcrFLo0/iqRjeB7xOJ2WRds7ivNllluFGpyjqWWU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.fbedd413_1542787346629_0.026812362597338657"},"_hasShrinkwrap":false},"0.15.0-alpha.ac93f032":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.ac93f032","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.ac93f032","dist":{"shasum":"b025bb6ecd012ed3f24ef864266707845704b45c","integrity":"sha512-KM89dcKMGNXAN2L41pDhRmZ+WqmSaYpNwsU3Lx2/2+sUpifvTRjDy+jbRh4pAqn3ulSs8uXuLYRBBpRA6w5T1Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.ac93f032.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9RP1CRA9TVsSAnZWagAAI5YP/Rk5Wa1Jb5QNcKshVfT8\n0t7Q80e0Cdaod/VPfuWI9yowXGUxJ3URUmUidz969kabIettE8Mg7cHOBmh6\nJxkCCDG0KmPaq//AJlECvrwgI1qD0LGBFC4SgbtJ7qEYCjRTl10urjv4smth\nuoE9qI/De3MJXQ/I5l894iK2ZB//lOiQyn3tSIG1tu4a1EU2BPQJUkmB8dEP\nkcl+JWQoO+EqvEBwYHo2F4cg5Vty9R1ptlikP02sWwdtO4PbaSlJETQMbMUO\n/QwLs2unJFI2VniJrsAHlZF7xs8GlqF/u8VoafQGQJfneVY1u4nBsL2lV696\n3kJYVw3S0JG1lzixnZmSnhyFika7fe2LD6c2VCWZnb8v+3Av3I7gWsIY08Iv\nM3oGZcqLjLiqudXef+OEh6Y6fbATEbPcqpq8Eh2QoOOWRq0G8BRyFUR60Xp6\n8SUXMZnGGgkVlgmfxdehmhgGxdxXSDIln0FTUHIEO3VWQv8MPWe9Yj+pWeJm\nml/P7ISsHBkyIHOZvwgOIk8kmrJR16QRA6t4Qe6Zn9YNJCG7B23lwqrI+UFs\nXVj4YYBD94ivvN+6s6Bgsqe2gkbQJrML6pRN5YwKKp4awsYtfGRItgtRtXqh\nZOL422EJoErMDHTvfApIcw/0s4AqP6rX0aV4RhaRXthD/B5MnyfErc593K1p\nAprG\r\n=EJ/2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCd87u6HucHZrdx7qOyZ9sYDAkJjXvC1u/Fc0FEsxyuHgIhAIMHfqPfzEYeWXzkixXBc+BgRdh4Qtx605/gjDUbvpwW"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.ac93f032_1542788085034_0.7878607522967838"},"_hasShrinkwrap":false},"0.15.0-alpha.a2305377":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.a2305377","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.a2305377","dist":{"shasum":"3bd08338ad83f9a8c7423884bc2db0942a878a78","integrity":"sha512-hgl1r1xyb4f7O3BAoHHgzBkVuOGWPq8ZyQzaZp19IpIplUUVET9tdyLDNOJPeu6WRmvyUJNvfBZY2r6BVk+lYg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.a2305377.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9RQzCRA9TVsSAnZWagAA6owP/jaFur5TUWuV61buFUfU\nbnLM0R3lgXOMMctprpTIPCDbkpzbr9D4ovx3lLgQ6K1GRiMh+jIjLpdhIe7y\nRlLc5zMwj4CnI2m2XiM6lWDsuuRh9mpN9gUz/vCUfhIuTVge5Z2D2IHz65Gp\np6B45yfZdy/YC70opcjk8k587Xcjl17HJz9OWkYf2inXEhD282m8uD8Kz8kw\nVnsBiW8sm9fTI8gAV76ngWK/0MLD6jrE+QiMflmGKZcpOd0C7GWECm09YJt9\nTh5NZtS9euDE2kshoCEWHFw/GBt2nkxlJA+Gbb9XS7jDZ3kmOVULDAm40gns\nYk6PSO/KXQNrzZG1yWqbm+IA/KECie4gkX3GRcWHc+7xFu9ibPWepKyEdgWD\nUyi6XfUnfodP1O9BTpDitBJZhwUgEAcKvCMHo4H+ud6odmiQmMu8xI962v7d\n3zfPISlIR59ZKTF+9T5JO5Q4QB/ZBG42R6YFX0u4upWFd5CmCNvY0WfK4uhM\nwQD44wn4EkWoZwJVX+uIzwD/6yyz+9Cgy/sg9d91pt49Oq79SbOQ8Cc4EwO3\nGkIHlYzx4yIEOi2apxMTNvH9mEURgSPdFJHsVAXoYbxwt6QJubyMLlCz+kjC\n/w/uCAqqGAbK4ZHnrJLZxPsDJhfnkl4kuNjS6KoLuSe+nOBIjaaD4/kDK77J\nWLb9\r\n=o9cH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHdV3q0cK3o+DqZIQtzJwMX0xR7s7YTiQvNGPJ3kdL5sAiEA39X1hmI9t8vtobbMmO98W7WHH00zUx7tKr6UZmDCVqw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.a2305377_1542788147162_0.8152319681775628"},"_hasShrinkwrap":false},"0.15.0-alpha.26dfe4af":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.26dfe4af","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.26dfe4af","dist":{"shasum":"ea838e42d251c402a714eee94478a89050f668a3","integrity":"sha512-N5j8Rs/T1Gc0v9hZ/kJ8miYbCnxfdQTGfDZ/FwyhRqgc7BeK+hw5OtioCRyTBgKzfMmlPfGBsOY3+Xr7mZ2vGw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.26dfe4af.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9TG3CRA9TVsSAnZWagAAr4UP/1E1LZg1bGkEUOW6NspF\ndO1jRtG9Pu+FDzkZ/8bJj6DRNf4H+xVuUm+omW2lf+zpZCT3TTjPlC8Sb6nO\n0cp3t+6yNLzcSNTeQdMT/AdH9DIYQEFNyjJlx1ay5ZBZnFjjd3+rO64ZefLo\nlrq48uS1aThSm2f6JM50jqJh7EWXolGdA0ZtQoMAnZtj3Sv/qfss78danVzr\nvspajDgN04cbRqRzwoH25ndw5Oq0FFvj1KGbE23qiR+9sitIexwiYGBNieyD\npGkMdCuyuig8lKVjoSSG4WbdvHtZmAdABzaSdS21n/zfzlLqu29IttamwBAs\nWagY1XLidAUTIQRdvMNJXjJH638+HCr6P/xGA1jdCquXmSrqE5u+9MZj24tO\nWTlcZ1mZ+rj7G8dfPsM3eM4BcdXChlEFwGgv/HzgYc8he/U3z4a3y6WYFbRh\nLXeKzogH4ZTpvhe5P9bcPfauDyj2rqin5bm8Mi1neBMN6LP3ubgc7oTV1ndf\ndv0Xfdd7h/lH2zYymlm2BxYD+6VHKloDtIczmiLg+2fGS/HecVepffBeiHm8\n0kKDfg4bj21nRjneuYWxveoJS0nuYwD9jRLpmoJRqZrhrjdNxCD/HkW+uBh7\noFa2US9ImFYx3+pdyU1nRnFWvBxoPPPfqVmu41bsGXT0PTgYX+o8Mzn7xCI1\n9YeL\r\n=GqAY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCaWZE2SRo9xtEZTRCiNFI80R2Bhr63Clc3wcnT+9HACwIhAON0OvBUT/El45+tT2AajJa9xEJZUjD4lOJeXj7D6uSU"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.26dfe4af_1542795702528_0.31421514850944443"},"_hasShrinkwrap":false},"0.15.0-alpha.dcf688e5":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.dcf688e5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.dcf688e5","dist":{"shasum":"b34a5c830749e5eea6d570874e3041aa805627df","integrity":"sha512-vUrtaKa2Vc3fsL4XofKxm1AUls1is7uP7JM90rNUN01jZnxwkIUkaxZ2dZcZQdqPnhNQAx56hLhQO6NPTNoOSA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.dcf688e5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9TJFCRA9TVsSAnZWagAAl+8P/1/2yIkS7/sNRwcMk053\no7jZ6KfllJjGNBozbOJZPOsfXaOCoUkYxDEGb76mMju2EyXTJu/RVJAKfNDW\nbgGot4Obr3mvSfiJ3cE/cmlBZvd1USfAFMSLtxrODFFuFR68wayDWlQLz/R4\n25JLM+uvgfpMjL/SJmj6Ut0qPQyjePMxanBGX5hOezk0hU5aSN5Ku6jcY6CH\nvBu90x4weG13i9bxl/b0L4lc6M1Pvt+9bi6jesTcQCJKWD1byQge3dRzsKJL\nUm05yAiqvJanWUaEsJM7xfn2rpDAOt7SQQCWDHt5nBSn6hfurp+CJ2jqWznX\nNTkIiWNxhHfCZaQaWVJVyIFVd7PhB6aPu3gNoVmKBTXY48PjRKv9R+te/bvO\nA/ZyTLrbFqH67d2Ecmch5oNyqy/8NTDayYYGFrmu6i/1JxsTG27giPSkHbX9\npvNpN8TWJg6No9QvFs8gmYMHq0/yMmOXNbRun/A8Mi/oOWXPZDUUCIQao58s\nBuuijkreWzOb9kbLSQs1ztZRdw7dAJsNEx/32wQ6gYH88rz5GwBHkQpWfOIa\nlwP5ZJrxXl2LOabuQWQB9tXs2jH1XEXNMIPqWpS5umzfuqvZyMhHlzpLeeaC\ng0WEvxZoNINstRKlnPWFzNhi6dwMILDz8Ew+F3qpW7Oq/PgP/epCtlJFGOeK\nDuFV\r\n=IZCT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4a/Oe6UTHBaM3oPfM8gc71xBSo+sdHLvQRbu0tt+TkwIgY9Eblk+Lax6Chn3LT3oqpqPKWtrKYOV0Dx00LPDcc1I="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.dcf688e5_1542795844303_0.6289431319717804"},"_hasShrinkwrap":false},"0.15.0-alpha.7c1a7d2a":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.7c1a7d2a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.7c1a7d2a","dist":{"shasum":"0bc9c23e4791f55e4194abfbbde1331cb02befeb","integrity":"sha512-IAm1NMjSxZGfNX3NDKvqeGSJzkvP35nUrQyMPixnNFKPlUtzMOFDUGvruHI5uCWSgV+uAeUxAMHddUOBn1cE8A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.7c1a7d2a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9TwACRA9TVsSAnZWagAACtIP/2q6Rh6B90TXrwkTUnwL\nvhuU3fq4svj1uJtwFOTwC7Z8KBV4XR3MLyqh1RnqV7NFlZzBPWTdwAtMIGl/\nJ+U6UENFABm4/9xBD1ReHiuFzOXmYPzc6HK9Yy2jDFzxQMjpo/TjfpD+NmdA\n1FmJO+Ubp4C9Up0ii9dUDwETcuwNZlWsXfYwAVUbOxVUjIeUjtphRH7ODlCM\nQGgW5lPbLz6VDLprMe/3gE5i6dUQSuRnRipd06dnqWwNkPEivBkSELzhEGjy\nbN6sXtVmcnsOaR9j8hEgd+PiO6RLA0BTjQ+kjp8cSvnG8RUuAa7GsA8xewLY\nHtFQ75PUwWpbOUtRJ08pKBWj2ApRhfOrvkCsOn1QUl5pjdkipl+VAvAUyqYN\nKOI/GByHnUvt1uRHGO1/p90+O2XqbDsZvqc/P+i6lvQga0Sa9qYymr4vUpZH\nLxq3gm/tgZE6mZBdZxGlMl3IrgSclJ/I6maFUYzzClAmQUR34Y5NX872RFAr\nZVBbnswFN/vd8fQ8Xk84ICTSoWMi30VuRj18wJurLQawLBTpaiIpZKeOjJtM\nzUZbx9UB9Qx2mMzC4k/M4YHnLvsdl2vNjT8oRo5QQ7/bH8E3yM7J7nr+rjOR\nAEkOHSt/pisVJToKi1gu+0sbjvbXr3CrcOjB0T+xgmdoBFZLa1Uzt5PbiyjG\npInt\r\n=sDRl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyG69fUQLkJvX/eWA+w40vPzjL2uiZDrLfoUHb+LvGmgIgR0V13CKI24Rad+bSANnVQcKspl5Z6MHBMkCkhDzXxkQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.7c1a7d2a_1542798335528_0.7725199287449387"},"_hasShrinkwrap":false},"0.15.0-alpha.6e72038a":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.6e72038a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.6e72038a","dist":{"shasum":"93754d4bbfdd81c8cb40296c826c4769d8f12326","integrity":"sha512-4coLzDC0a+gVZ8ln97JF2RbOU/cz5SKVogpcfeeJoS+pONqFuS/RS127qCGcfPGKflgELDHrrs7WST+D9ytKow==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.6e72038a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9TxVCRA9TVsSAnZWagAAsykP/0fs5+bHKJoy2L0ym47k\nGngC5AAnfocy4+Rcx2WN/7UtY9HbhcBj577WFdYyWVBzjsqXiXDnSA96HSoL\nAzuN2DZPe4BJi7aprUxmDtDxcdM4LjStxJMSIHXSTx0zCbuv346aQitAfqDm\nGraiFocRBOBBaMhhyjCV904nVq16cikTGyO2NRQ0sEo8i2T+bTjwz6Ylxd+g\nrdLmz/4r31m57LXboC+nI3vl3we8nFlrC4PVJDeCn25NXV2NHpR2mBKZMXQU\nTg4q1buWKie6CXpEGcEoFbm4OV86IGFNUzfACxti86+NdkCDFVy8GV9zplfw\nMELQkynLoRu1EdFv75yWOoF//DEOQA0/eRbBl/oPS1tApLRU/K52ajkbUk7x\n/87bAlaJE0RMz+OReVOL7A2pYKoQXVctHm8tg2gLluhibixsmF+buJQCQZ1m\n6ZnJIS1c6ugcO9Y6E9LKMCzhdH2x7vSfD/9dhlicg6ZUK/mqbjdI6JxTdoDt\nfYXMaWJH5gQBKMCl2T7SRg6ANug83/YQ+Ero2PYk6tezQY8bRENgBG29SVA2\nQQyB/x0l1M40ZUSmI64EuOZAXAn8sbmB958SS99MHyy2f0x16o7ofy3kORik\nH8BtC9NBYjOi8LVr+zFy1U24fWlHMVIRZqRrQtBDMt4Gmt/tvBPAAaK7zaVw\n2/Q5\r\n=9R+W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBd5DYe40zJqOLQg7Ue1yjBvAX/ob7lX5niIULP2Su/DAiA2fFgicY9Wc/jLbpJD2oR1ZR7kHxzEktxOmZMyY8v0Pw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.6e72038a_1542798420777_0.5269533972320377"},"_hasShrinkwrap":false},"0.15.0-alpha.abcf5f6c":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.abcf5f6c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.abcf5f6c","dist":{"shasum":"3b342bfb65f5ff1206f825a25a7c7a808b9a9357","integrity":"sha512-/cYRbE/VHnyMRJOl/qaq9xR0LU2HsLfNeQOek5k2Gu1F2HX4MqUJkyCSTGAKj46nqqciMXJ4Ky5XBL0FdpEgyA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.abcf5f6c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9Tz/CRA9TVsSAnZWagAAfTkP+wc23NWBTvpCHjM5MKeZ\ndsTF43T+tvj389SXrZAFBqSm381/8tFw4kXam6hUvdd8aO+Wmz0joBjD79eQ\nHDbng/yFShcHG4WpGM3kQGn//ogVaIinrKwavbnlhyaZGrFm5fBuH+FkDaqA\na12wAYHGZaszc7VlaJHDMBHVPAPkt327nCBfU4FU/UNzu2zJEANhx4y5Mx88\n5HApZ7enNQ5jvDPiSat2BSUr6M9OJILF8LJQYIcFqcB7CNnJeYpFsvv3dm9x\nHneRtnzC+3/18QMVt0ysz+eN4Oo/5bofQL4NfWSSoKGIcB7PQMCSIM68/sQ6\npCYnc/TAc/jNo4hkk2uyhmJkueNPTM2RQDz7ObqhIlB38rYFhl1ZjhYIDOg2\n/SHWAh+ii04/4wG1JJxZmNbxGVG0Lq3w2DQ0U3sgJ+XAbVAvQFIXmha3Gcfk\nmX91Ncie5kQPjRbo6DWF3kYt9ZvG09cjK4ZoCG5vY2TpJmfWenbURSMBfNs3\nX0csOOQLXFokKZ2CvznQ8ocBlnDRlXSPYgKiSyFMqiDsar/j5dfZOq8Ust7V\nVEUS5vlCnEtLGEgNMqZliyjp+JyBOYnwmuzda1WPcKJFmcb4XIZIM0fo9qtm\nSMgdvWANEqaZooEyZ71/1oFuNSHm8Wkf5MKv/mR+i9Su5T4dXCW8h742/06J\nHR/S\r\n=S9Nl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCceyhjODGPuViTEmJOneWbyySC2KMe5EweQYK9goeGaAIgUaqhMfpWj5ePZLbV0UVEK5rd66F7Uec8lr9QoKsbALg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.abcf5f6c_1542798590992_0.7131402353186793"},"_hasShrinkwrap":false},"0.15.0-alpha.4fbf1e2d":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.4fbf1e2d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.4fbf1e2d","dist":{"shasum":"582706872abefdcf8d908862a7dfcead4056fa85","integrity":"sha512-HR1cZBacAtd+ASa/VQjzzFhaolljWIymYuXucFkXebnLcRBKX8s2JGJDmeaZACm41BQBrkQWv5t6OVKl7N4/aQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.4fbf1e2d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9VS3CRA9TVsSAnZWagAAwHQP/jHfBGNRZTvUmT0rsLfK\nLxYtCB2rKPBLdckCQi/Tf78mtSNNeK/Ai7IOhQ7Q9azNEbsImw9GFkiY0tpE\n1Gr0a3wFqOOPywAaW0yKSxfeeUvhNAT7J1cNZLtkkP9/OvTfqMiTitW02FAr\neDwtSRix/dJAHX7+WA0121UyYPbA24X4xJ707ynAZJDTRtjiidAu9g+ZRkr/\nbtFiqRiHBHlSs3Szjv1lCxqs4BG12LPyCbZEKjHzJ5yAcKp8r5J2bqIZD5vq\nIeb6fOkvdA5vllxrj4RfbPArzyIfhh/v0pRka7zWGUVOtSdvIhU8mnMJOcCO\nF3E08xwyF9NpQVtOa1Dv0sHQSwOgzqkXIuU4ubVa1IfnNMXfldVO0Fm/XpoK\nwxtrZSsrlcwWTDioqxQMh5TDC2jaT/y1rA8YSypGxfWA0L4Fg9tr8NlGc2cS\nsMvjxhcthxheHnJf6zYHtJGpu2VDV7h3FdE2z7YqMaGI4P3dodPyeB/YDTIh\n3jZtgh4OcGTDj1ZYLqJSFc2u/P7Upr25OYI/V0WCEjdZIm4f/5Ja/QG0aySB\n+BOeioIZRi1Uw+MQFCK/a2548cxaAm3T+EeC71w0tmmHcN+bR1Oot84MxHbb\nozmsHMsB0fNC4Hmw1JSi5Rv7fh4tu6aDMOBIciHY0VPWm6b31qQj00vHM6Aw\nmUNT\r\n=Aly4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRbUIhcNhPxUAGUUZK6TPXO4D1ibk4TdDd+C/mg09esAIhAPezRwPaAWIZz86IVrDcgW68IXVztAi84k0k8egYrbci"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.4fbf1e2d_1542804662559_0.9390623890636676"},"_hasShrinkwrap":false},"0.15.0-alpha.4b8e24ce":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.4b8e24ce","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.4b8e24ce","dist":{"shasum":"73c24acfa795a111772908be47b3b71f63f9022e","integrity":"sha512-xZ45kzsuEP6oSuR08mWQXJ4Q2osyRhExscmSYKLTTB/NdVg4lu9/nyRsBWVRw6Y/r8EUyIL7H2nqHD50m1FhTA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.4b8e24ce.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9VcHCRA9TVsSAnZWagAAQ1wP/3WB5WEdOX1D3FBVJIoT\ncDnjNgvcKcaOBz5Arm75adITDFnD4jjfny3JE29P5RLRRU7Yznku+xIb1BYL\nKeRCp+t+o9vBVHdyZqIP//SmXeWxtP4NhPE2Fe2jHhZA3Xr625WE4pNeiNtu\nf0JRCtasx1B5gXpxxB9m53Dk9FCW00xQzB1CVYJ9jyqBHc5alQ1d9sp8gPMq\nqoGE2QmR5kWk9hkQl/kJJMZtVj24+vItMXNlr9yC4XikiEH/NKMQDgjHpWMV\nU2usmwluhRV6n2wpQsfNzxXTP0bP0cTnvFDTkXETzSXUqzMMdrCQJKnDatze\ns/BF7k3Kj/oQpaAo51cOfpnq/kYVHJoR0DQyA1/5sTALoN0IIiuSsnuyiRFn\nDCYcmFqWPzrxAi+z+iXFH4x2Opw9h1z1g0t5cjPhAoenH0TDK168ckIXgRKH\nGQJB6Ed7Qn2L7s20X3eWYM9jOqoMoukld2jNIWvh7gVy8MB5lHLIZV0jYcY5\noPQq13eXWEaBG9MT+GhnV1w6zumL2d4xFRNVJ7G5TzYQvDYcq7bj7Gm+hj4Q\n1rgcA2G81JM0S/ShuOwsOisv6u3F4iaTrxU2Pm/+2RtNn+RpQ7NWMEcYAQm8\nuDwPGeN5LFdMaBWDrsVxE52cFn2R82Eepr+rWG4ozFFhyfQ8w2kakdoTEilZ\nnEIs\r\n=ZzU5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFf/IgsBPt3224h0KPY+Q2NtqS6CPe62ah/0I7Xf6NvQIhAN60zOj1sWZwFJvYw8b6+ymi9oVUICn6lnCgA3WzuT1I"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.4b8e24ce_1542805254372_0.8722808269348146"},"_hasShrinkwrap":false},"0.15.0-alpha.0c41270f":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.0c41270f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.0c41270f","dist":{"shasum":"217a27d223639561eb14849e2abd894d74256730","integrity":"sha512-hMczG2E8YD+QOtXul4igbHKdY7RlNFRUos2+sHyBCuvAQWIjpPhvF+f+B/qc61VALYZAjgPc70AiLawPirTsQQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.0c41270f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9W2cCRA9TVsSAnZWagAAjUoQAJ5PdR9YoSVpUji3C4iU\nRB0yOFT+mtbjS4oIRMgZUObnRT7RfLnrhQss/bgBPqoNbaFhkDn/eMoDEcKn\nmov24kZMeIzhXaLcRj1ZAzs/RR8iEwqI3PUq9x4G2Zd7rgU7D2Y8V/cjWjaM\nBTx34sQHmNFFtXIsPGjxURkskqNkCukHAD+BHbmTZEcsQ99o7Myc6c4rfJ2W\naqKqY/O9/vKzatPauZR9Dxcm3D4OVhQXEp8B1RsO0pmn4te+FB2HjCan0Y+b\nX83jFz95LV9Y+k0l2XtCEbTAtnCqO753K65HWmSBPgnM7mF4c4uAUHYw30ka\nu1YyGGUeMx+RB8DkgV4FFjETeNf4hH28y/A4Pe7qR6yAcDUk5wsSGpQJ0+Oq\nH6VBRsm2yzyv+3qSdz9rO2xinQJgYtbOdH0gryhTwrA2tqkOTy7AGo49NerQ\nOe9Z4P39zUGD/8lN9gHHaqXb4MzjKimeJgIuQdw2kTKtPfsos2vX3ZMnO4/V\n9YJQKXJzKCqKeCWKlN+pN4Xw0cr2y2YQHDuK1wcJKwgFndoTYsKdebDJJQhx\naTXl9gYiVhH4OK2hERyCh0kpJDF74LwWVsFPvhU86imAH6QVE75LSOviLC7G\n03UwTIENe78JKsV0bA4uQmZVx0Syovs1uso0nXhBMqNZRhZliR5VVa7pNUS7\nzKNe\r\n=Bb0t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFT9hBChiH39o7tm11cgKUSWSwpnF1ra0voH8S1y/T59AiEA7iBLI5UX5kSlj/pAoaywyY0TP0/NbPbUyGlrU4KVFfQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.0c41270f_1542811035699_0.8680424587684561"},"_hasShrinkwrap":false},"0.15.0-alpha.e7948b1b":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.e7948b1b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.e7948b1b","dist":{"shasum":"8c399b99548bd7a246d6efa73e932b855c064f12","integrity":"sha512-l/C0mXzDP0CHR12+n31hmXWXcwsJ1ZsS7mOvQzyeMerR5GOBQnErp18YVWf+ZQ9labm9UEWcEoGV9GhJuufvew==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.e7948b1b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9YwWCRA9TVsSAnZWagAAR8QP/2BXd+dIqDyaNXsyWwl4\n5BOD8Qt5guL9ZYzNyMhMiv3F8owp8TLfykJxKJa2kMRe1eLm9jpRdJs594fb\nFOIsgh+SQIzYb/1VIJ2FpjZoKFJaL0MizBL0S2qe82mOO1m6ptR5PT+gZhef\nC3+9RMvoE6RV1cmqF7o2wKFe+iSE3NjYhxVbO8+4e/K4rdF+BEETOpp7biaf\noiWrIuTyL6KwMhR5uL6a/SC3TcUH9lOU8fOEqNpvghFVwPIf21NiLuYBItLR\n75ukns4vPkzsUYa89P8rvB1uBLVzoD3syjpbz6iULb7LVVHO8cD9PnAM1ccE\nKPuH7ZL/Udii9wAJemCni1Q8RNUMxU7dCxOXn0UKsE4zrgyFfy75A1C5rFGY\nGhgs2ewpPM0U/grE5D4tc/1FxOcJKARz0apQDjeU4EBuz01UA9SJ2QHKKgAn\n76oPr5gDRFZT9cuYrJvXKtVlG+UY+08qBzfZN5GgESlDiTs2g79YhvsTI7Jr\n1Ex/tTpuHWIOw6xUUF+61KAcQ3VsfkWDpogt566iBiiRPSJbUBcrAofBa6AA\nmNEr6m/ahCxP2MXN//ei9zzlcXs3lCuh3zOrpRDV0LrgSADKVoR0N/55BWG1\nFURCBinm9VRQgP+fJHRy+eE1QNRQSGQKUQ8LcD04dR1k3JFrwzsgVekoUMgT\n7bgC\r\n=hNQj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBaHnFWITBqqXxyl3QRt1jKI5bD9G6Zd0rSG4g6oJjC9AiEAiw9+P/J4IFYv2ssYhAvQ4kfXKp67kvxG2zm+mVw71+8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.e7948b1b_1542818838238_0.002530566464181927"},"_hasShrinkwrap":false},"0.15.0-alpha.cdb1e423":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.cdb1e423","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.cdb1e423","dist":{"shasum":"d8cc2e9f2c10b2531f590e7a48e5dfb113d7986f","integrity":"sha512-7JaN7WYkpKPZ5KHg1wnqe2joygUmQUr8gUJj+/cgX7ewcjK+zXb60Z8rM6DgW9h2OHyZV1q0SgsXAFsPC/lXdA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.cdb1e423.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9kDTCRA9TVsSAnZWagAAw1wP/jtGgc9mZGFx/BYLDANm\nkY8v0TvrC0bCsyQ2f9se+c4KgDnzwZMtf6G5n15uDnN4rcgCiJmNozipKdoA\n9LfVSJtS1V3IKmu3dY5MYjXi3AZAokd8pS1Kdbc6lo4YhgkgVTw9GqzOh2eE\nxHzdwTFhJPJpp5N4YqrlFwN59X8Gjj5taKHKo9V/5ZzrsGIbKctGXmtd+vvN\nXqPLdl9D958+sMtMu35K3CRiF6UrdoDntcEdc4L7mGrHKQPe30gU9pSxCNSN\nA89yzf/5AVgBtPC1+XMfjCQlNPZQE3322g1Uy4fZOlriAFGGk2I89+gCfAOO\nc3ys0EVCdRT/iRxzktwWtN44jen4sOnzezKJw3w1iX3nraNVd9kb7Et797Oq\n5v9HreskAGXwYOfNiixm8gbuqot+vP13zOtlSLGhvOWqsk9I9ppO2HG45w2U\n5QjtHo24YMe/6ckEPK+EIHhE9VMpQMnFMcJJztINAy1oqRS/DtA9HG7QnPUK\nlFO4cE3//jlmb7goXON82H0ehmuBks4KLRWyR5Lb/2n0GObQWR5LihgAxXLi\nwm10t1U2dF6vLn/aJ2wSldIDRRDHmX7HxnymJ9mrj8/z65nSy3hIs10YsZ6v\n+IMiiN5QM4Oon5uch6dxRkW66Ix19UoKDtoF+j/8QDmqhXWN/NIRNnu9axNf\ncjmg\r\n=3PkT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBuTr5KosptuPGFgslBjCT5qyQYWUxnJsq+Qifz8TcAwIgKv80BhM6wn6Q8FRjfx4zFXiXf0E02vp5FekJCND+5V4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.cdb1e423_1542865106250_0.7951968831519354"},"_hasShrinkwrap":false},"0.15.0-alpha.1914405e":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.1914405e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.1914405e","dist":{"shasum":"f68961fbd33aada744f6e773a62566ab7a47874a","integrity":"sha512-BekLvZTjZTRsRkBQqHYo8EjU7jhJvVt2QgpBbubnCJJCc7qWDp2P0SkZI4Ku/w5EMvkZzYpm31IdQnlDvA4Ysw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.1914405e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9kDeCRA9TVsSAnZWagAAP0UP/3330ovlC62RzEvUvqFP\nneMEqW86Rin6dczX87qG8fp8njuKc3HHxcCG8Rl66Y7W7qBHkD8BdJrZstts\nJsN7n9D0Wnfho3BKI43ljoC1t5pxGHQJiwfTsZpbrTJzfiddiiJcqIq27ucA\n6v5UWI3B/ocuxGMDunit7toFY8ZICWNek02tam+jUEf/UdKjbvnQCa9Zp9zi\nuno7/fPQ3TlDab2UhsbmSSKaP5sbUEQp3Q8AOkaxWPsxBYOZMTZQKHFEB8oM\n5HQvZA1vi46O5tIwu1qv07FkDHL1vD3M88GekQm9oCBx+BtPFDcMrhXe+/cI\nrmasMC3SmFYCm/De4AstwRJCBZb5rtYOjvY2r2bjBLpMHCyvytJWCej8Ndc8\nIKYLShPsp71drk7Onjxxd5QqqUwr3yMKO0zK3NcTV7HgRe5YMwVj24Nm3PGD\n+jy2gQWFKuEwo1U42e4eIfTu++YUeEmV/n2GPY230ut8ia0SzbJOsbXVcpko\nv4Sl5HsO2uqffuflCt8MPSGOh+TO+EjIX/toE8DdUDc8g36vsf23RS/vfN30\nijEqOKaqeDseXv1dwq1YYX5MUt2+q7ZlQNchYTPBHQfdEc+SbGyjAvu5agCA\nfeM7MglH/VCmNirRBZ7YZgDCHpPQ2BnrdJ3crM+iX7BqgDMFQyqTb95K7wlp\n6nyh\r\n=hWOn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFFYH5KxqyTAzN7900BA80uvdx7tBOwr37dECDB5EaNaAiEAn2yEHcdQHfZwGDM6qqzQyZMaF8d7amhkr23jyzLJ69w="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.1914405e_1542865117623_0.090972669598959"},"_hasShrinkwrap":false},"0.15.0-alpha.6344c178":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.6344c178","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.6344c178","dist":{"shasum":"646a108135fbcdfa6a5fe4e93607644d0bcfc038","integrity":"sha512-BAvgb5WrmrpqrHFZydzRz4iQBdylzhaUB6Qio4EHoXxU5ZBQO0cZUcr6qEBS4I/BzGed0nvDNSoY0Aq1lN64xg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.6344c178.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9kD1CRA9TVsSAnZWagAAviQP/R4Xq8wkm+VSrbVBqWNd\n4rvDsw8M8K1FQWUaR4embRIHkhD4RRj33b9AkoGFaWqSrBNZJNhS3IzOm4lh\nSeT5dEuFcjGntXHXWphSTuVit4ZawtAiHrWdjPid1sBMisDZL6Ba+WfOBQRS\nZnH6GD7we0uPEdRnCLXyLK/SL9jSvFtu1LKdKFfBL2GRe1YUKsDEcvTIKj4A\ntm8YY11uJqrFNxwMfG6ufxdoA3f74e4cMV/skqkwTzJQg6dRlvR8ixRcH3Kz\nS0t/M59w+jiDg//75rQWJqCIxKeRqcuVoRbZbleLGEg89UgCDSx8DgHOvKWv\nZhtgt3yIgGjxp2rrqLkFb3fqa8Ws1pv+1PZbAigqnZ5F72CCKYsSEBjdzCAe\nE9V3x+5wEkZQNUbpYhGMzkQ8eb6hic95t8BoZa/28F9LBXlsTBcszSVCQjwx\nAqUDO36k5GKo2c87rxujE77gUODLqAML//33NmYK2zDEUaGTmizAYYxVYSKf\nbs7XiLYeElq4H3ybxIHGQaZiBFI2fb2IJmwnaL2CC0L9qOVSwc+5JdQthfK2\n7wPz2dm6MAnUE2To1AOmYkywITiG/0xGzQCtZc2TAqBfmU83aPpQe09oh1m7\nG5dszviC1HInHrfrPjkAytlprgYlEdnJ07K9obC7tA3/CKP5TtMPtj09BfCt\nu1ns\r\n=Cimk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFywvy54fXbKj3R0Qh1NFmA47KapBqvkseo2KKVWiBsdAiEA2XyjPJgKAwJi3WFNl5m5R4bcZUmvppkxctAJXPM43Z4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.6344c178_1542865140465_0.6101018350069365"},"_hasShrinkwrap":false},"0.15.0-alpha.9bcaa5f7":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.9bcaa5f7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.9bcaa5f7","dist":{"shasum":"bc4fd83a12bede338c76fe5c7c6a52c55d8a3d2d","integrity":"sha512-Mi5ykSyVQsuUPuC3oF2ghn9e3iyHfyd12f9ZCB1yBhRGf7zi3VeXyJIW7+Z/sXSUEGVc5uR7HMmKVv8Ra/aCng==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.9bcaa5f7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9kQ1CRA9TVsSAnZWagAARz8P/jnW6qIyD4K/R4hksGsY\nf2KMVu6ambXxnY/MHK+gsfZ9aWmQIQ0sFTRFIuQ8W7r80sp/+/6v1Me7CZi3\nEtBihAMqOO+aV+aJdw7lkLT0m9KakKt7DyG5RE+//0IFSxQynUY9etR5qTDY\nuN7LR5PTRlDic6J1yqk+71KYt3YmhXafbrqsvDqTtd9kKk8mHrIrICNNAGQa\niFWjR9WRN4UzbsGI/O4ETop9Q7QFRtN9ar5P1XLFai5+irDkSHMNoye+4OnD\nLWxMPN6YYI3fYhdUUBbLx92Xes9rrIHLYEzyo6AEuaBsWAeAfXPpAv+Ioi4G\n3vc3tgcYrh8/+aDlW6mw0TkS1jsJ5oQjDsWw4bAD8DxCNCeLFl96C+i8O8Eu\nIjq1p52+zqkfR5ZwU/+5k9ZLC+t14nfnn+HZXRNwfIp40KWI/ltEkrSQS3l1\nUOqw3JUoa+kLNhGPMMYI0qYIq+v8GSYoIz7Oc50yWnZecPs9CKySW0Ee+JmP\nQbOQI+2iLfVYlukm/s6HX2nSJkx8SsqLk+ZQWJ4pX820R/wSjzvNqWUB5hFX\nW6MuqFO+2VJvEBKDOMjikSwT/8q9zZmgLTL9pJHEQ035Erm/xA9qN3WHeSxH\nZ12c7EEXAK8UgyMmXMb/GvVEBm6R73XY/sWnl5pJ2/ScmerL75HFQK2qbJ5r\naMlL\r\n=KI48\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAQ8c8ixADD7DRS17Ffg6tlVZhpjaAdNeBO4+PjyYxFgIhAKwlWkc8qHti2u3A/y9p8dYLO+oLkzBmx3o768zlrqsJ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.9bcaa5f7_1542865972828_0.5686382977782056"},"_hasShrinkwrap":false},"0.15.0-alpha.3407d212":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.3407d212","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.3407d212","dist":{"shasum":"4d490fb1d3e9223bdceecef21932785233e55d21","integrity":"sha512-XAq60QcoLVwAOjsCo6jEMSH33RMBP2CGiTDWv/OvBwHgg+/cWtHgliD26mJsCQ00Pl4rIqzE0IewO3JnMnc9TA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.3407d212.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9kyrCRA9TVsSAnZWagAAm5AQAJ+vsZuZCvL9YtTxc7TG\naKQB5WcpN4yaG7QrUkIO/yYYk2taW+5S1K6gi6oNkJx7nl/VANijrPX6/Itc\nkANRGzugY96QEKBuxpBRn3jCkDO3NK03WsT4WeRUwb399FK3/rSUWMU2fkv/\ntAXSo1w9LTr6rFG4Bc/T3jd3O1GglveivbTllU0mQZeDeu+h3tfx2x4tm94N\n2bepToRSMEzMvPHCn0Ml5o62fCf3hx8KdXC9jwllXM5YhFhs7aZU0kt3S/AS\nz7HUECz58L27PM0/ymTbfJ9StDX3oxl3VXJYznvZ3cnZv9mvJX7Nx8iGjVkB\nPI5ZehGlQng/lztRfYbd4AOl8VBIGC4SeLw0bqU/x0+F1R/X/rhLyVbIyEYh\nVIFujklatTPJNTL7HgcJzrAbd8rG1tfRuKJOv0TbM4sTJ7I7PDtd29N//C8x\nYu5h3vcDpAjnS3WLerTNawreNGIGpc5Tpnl07oAsEstMhkM4+72GNDTFX8mb\neGRkF9099Y47aINZp4J1vQDx/ZGbZWzwHALFDWNxeH4IJGAI51fdb+jedMFE\nfJKKBR0djZguVL/x2uWeWlinsdMnWUQAvUHHjxCZf683YEvTccEJWBZ+joqj\nZn/tpComXixDT+aMoycQd5Imjf7nBExaog264AeCyjAaWcphop/jGkgqMlzz\np13q\r\n=9TPG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA0ny0tcG/Md4JsRsUVgr8fE4OpgFdeLm6hPndQs/4BtAiBdlw5zLKEGWwKMmk6HCX7ivxsUOwTDMAPAL6RxafIF4A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.3407d212_1542868138554_0.5515231727345671"},"_hasShrinkwrap":false},"0.15.0-alpha.dafadcd8":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.dafadcd8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.dafadcd8","dist":{"shasum":"e8a4a015479d997cb3d75c602559d47a68dbe2d4","integrity":"sha512-/dj2jLGjMPN0adpHG5pHjeqmMzRt5vzmae4cW1JRl7XtrLbBDv4ZAvtm3iJ5pEVnyjrrgsimNJNswnCVg9gJew==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.dafadcd8.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9k7iCRA9TVsSAnZWagAAGJoQAJRDJb447RYM7A44qfpS\nIHmwO30AaarIhUWI6mada1RQzQpg0FBjyNUBcgblgfLJsKIa15FD+7eUa76J\n+EpL+24TEa86RgF0w4+K57mP89tMT1v1ah/zUWdXn9DyEQbB3qp8nigjStOd\nnFTUlS2HuI6UavcO7fa0b5IiBeYvV6+jIt1ZjrssW/XVcqiQYAe1ddX9fWpl\nI9HbTBS15eop+pttutAdWREibvqNPevlTul+X/nK7PzAfzof3L1nL8k8tDk+\nAKv2GwRlh7IG83gcAnnf+n5srrugPdZgxChX4tYDHq3WBuL7fkOclrY9pbuk\n3qva2POI2/Js3aFwPT8HRBN4j6Y1X0k+m9xIXhYrYpEBEHrXtzi+Eax8yrC3\nDtGDWKfbMfvVVvpKcik4G3N+fUujvIiUntu4DZqwVdTmsewIcGQjteY7E74M\n9iLp37WvxwmkayrCjp/LgpCIhw1/2tEdiuv8mKE3i8IagpUlXzLETTmsyI4z\njIhlbUY6m0o/T+Lzf1teCXibIIQQyt4aftdMYuFcjam2ZHSa1pLJ4rilFL0P\naY/UsoCWaBTrCG/pWPfVfnw/tSgKgTYJIZzz+KoMJIciaUOs3Ya9iK3rUIOc\nmmmUQpaHAP1GVKX6jW5m2sCVk2P3c8tJmppj00DZWikGTz1jkJO+QyNf7UCW\ndCGA\r\n=5AJ/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAK+inhogPQOoVgpEJmVY7rufH/OxCiGGtmdqupy3xJgIhAMgwP89AJR0bTjcXYJGGYTikOhayFqgwOw073quimc1A"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.dafadcd8_1542868705855_0.3363745888069769"},"_hasShrinkwrap":false},"0.15.0-alpha.019c7ac4":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.019c7ac4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.019c7ac4","dist":{"shasum":"8dad30116b8d6156cee4eeaeb271e3cf35aebf25","integrity":"sha512-MBzt4scSMtSj2raqRFHfm5fsdJ3XN8sUD4VBCr91upjI962qZVWJ4MIycRvpPQigJtSCVNrmtmsUn18JKX9seQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.019c7ac4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9k+dCRA9TVsSAnZWagAAmSkP/3yzcjxsaG1H6eH9m0Sx\n6zJAcrM7TnrEXBKOc5dzMlHfAtk3npRBi46vHckiuGQ5vzWdlxOGj2cnu2ra\nIJqvS8F/W7qST6XZ7AfxLOXxuwTQGILnKe0t02cBzP/xXeBU0a5eU8Vk+G6Y\noCyGFHM8M73jhQ3RELRqKyOtza107Wab1XZ8nTK4jxGuOkFG55d9CIPaJz19\n1xJnu/KQbfBXGUgGu7njdaYg+hhDKzGeSkzEXwlx0NU15D9vKO4qrujyrwdR\naSBE6LzldyqiW2wSglEzf/v/0z/B1AZkaW1e//2HnGXRJNxU3aIoX+UC273C\nCovCFVheVo7lApx9XZBeUL7gEw5fgLts7LU7DCHcj8ytEJwewHIHKO4Ow8Pp\niMUhC5MsoD4YF98zaTfcqUC8El/08IJQZ257QqDPu5lA3xhD3kFqsRIdVcv0\n9MU8R66tGLyI2ahdqDD1E4rFe04UvAPL0wVF517dQS7EZN3YEoIT9SIbxDiz\niAPfQNfvVN4mAQNeN8sK5wC3LgWm1FF3NyURtMOMHIGf1eBdCEglhndXsAPu\n4hcCMfHsr/ItUkg+rsWyeqXBJXi+5+Py6/1oORKKatOR7IQNlOB7rlTVDlbD\n2OZvY7MTNsqjI2SZgH5KUkk4hju490Jci83n5BtrLPiYa5h4wQ3MDsh5Afo0\nDPWE\r\n=QJhC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9AMNEETJsIpHTlZ87wExynWDHTBhKSKnCV+3pxZFA9wIhAPdRReBSsoxKNmReuPmUK+JjjoW5z3XX1SHIQ3RpoL1l"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.019c7ac4_1542868892911_0.702753228720052"},"_hasShrinkwrap":false},"0.15.0-alpha.74fd15ae":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.74fd15ae","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.74fd15ae","dist":{"shasum":"1d66d3f60faa7bace853b40f3ab43f1c8105c9ec","integrity":"sha512-7Qn2/bITiixiF3pTFmGzidu2LJdPIP9uMnuVB4F1huI3CZAT+EWiQfV4Kva6h4HyGqBA/ayDHW/rwLBsCWdo8g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.74fd15ae.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9ly+CRA9TVsSAnZWagAADKEP/1yA68yHFCnH1O+z04sw\n3JP/0+5S/6XYmJ4AIWNLRZpwwZr5E7sQ77wmClSULDDgqOcdb+PK4MyeVqR2\nT+yYaT8S8iPXg4f7Fdr4qZAqWwNjTABY88aC6Qv8Es63UK/2bqttulWtqWzQ\nW0ajnxsyOQGZjwH1gOma8X9tu771D2y64WKoXBbHPP8Du7TYENutkUH1sFyj\nYFkWGOXQZZy3dq/Xo9IbzFZNHsZjPpn4pZwnvvpfnbT3GEaiNll/qwLcdC1K\njEsTxJwz9IV5Q0iMEU2LRpk9y5OgrUGI04jM8YiAWZ0epGajoOhuWgFBltVJ\nBa8LkA2oLoq9i18xo+vzgn60Et8cfDoZKGlJrQ4HDty8So5ZNELskAroHenC\nQYuoFZ1c8QsVbdcQkroMP7GqhVQ3ynknKwvKpNtURxJzEwb6Ir80oDgqhlZN\nxeeiC6SBZmxP4EcLsddM6JOjJgfiS3ClbCyphStpnuDxik1wG5YOxblmdGcl\npwoQ5O2IGwsJVmawbJts2kv8EyZmL0DW+ashFY4MR2AcqAkmtl6d/PSBTCLb\noJ40zvW4iIQC680ewc3ZAcnUF1jxf37zKsoV8qG5dFRv20dHmHHDEre6MwG5\nK+MAPXkoeNKHV4fc03cfj38N1tscMcmcq7Q/8T97CIzzINR0vhp1VyBvlgmh\n9+37\r\n=dSuV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICjkgGy82eTUFKQ03WwoD1c4etbOyKRrTlmtLnH7CFd7AiEApE/ipjuDtqMc2jQpHi5rOrpSeYJ3IGTIEL256BY7FvA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.74fd15ae_1542872253763_0.11492982848903255"},"_hasShrinkwrap":false},"0.15.0-alpha.93e13fe6":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.93e13fe6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.93e13fe6","dist":{"shasum":"930e1b010d83b3e5be49facf6219f2b9ea9a4203","integrity":"sha512-9cLCV2hLHfa1jx+LfInRIAW6Sz9d6ru2HwduVTqOsf6cu9v+vTDA4RCNQ/DmogyTV+v+t1GaVNOrzfLLxdGJKA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.93e13fe6.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9l42CRA9TVsSAnZWagAA8vcP/0Tw1PTM+W6fGiygTLZf\nNxTrp+9HD3PbUS5Rt1U7Klo4pkSvRJKYqe83mDwU0LV8x+9/90dQ2pKRTBXa\n+5qigWSxNFz+3yaui1NDnfROibp8QdJrFPl+TyI1GgMQIkAXNEc1Ny8vgUSE\nn+KeG/27/RA4X7ZPcbPWYydoSMZSqfRU87a7gCUukV0AX6FDdVfSZExLcryN\njmUszJuyNZJ/rPe5T0pxp1aceDAhx1zfD3oBBDKxGDPRvOvQ7uho6BN1/hJ/\nxRWoM06ITqTwUpkLTdiWaJw3Qb3fEIEIaAANHoK8AxmXL5CfaBW/Ithk5Muw\nUpY+kwRzpL4ogg2Vw1qO523scd6Z7IPAB0BXNshEtvwoj24HQJQpMdUoywKa\n+hOSFFH3YqSb13ldq1kDilFrtMz7zU11Cent5lr/kqOWpxSdjOKyLnRAHgKQ\nlMhn4Q08tg5b4D9yZdwUA1DC7USUjzz/y1woLBMsdPs1H5WhL58CqKC5od0j\nHo1mjl+Ib1x3muCYmuFIert2GJ/KdzjxbcUuyz1N3HuPlrqfgpLz6CiQi6r/\nqr2zUpiHT/roffQO0nQrhR2D0Mgi713TmpcWK8BMs2JMZ+L695bqCoqwS2tN\nXvJQu68u+h8ejcBKSxNhBkjOIGug6vVOXge78f4js6xNqp3gvd//kzPr+gOy\nSiBr\r\n=tA/6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEYWhA57ZhdX8c7akhDWBO418k7VwzTE1rnvYpUUkEfMAiASJ3eqYVndllrj7aGd9F23UZzNz9xjSNQSPeT70H8zeQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.93e13fe6_1542872629755_0.9293335943407051"},"_hasShrinkwrap":false},"0.15.0-alpha.653934c5":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.653934c5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.653934c5","dist":{"shasum":"fae217aa514d79269cfed3e158a18efafba01b6b","integrity":"sha512-O8DfBcnkLW7LLBuz9NrMUrbIpXqi6YpAEhjLla0wc9jEghEGEdQy2PSfb9Bqrdw8VcUzi0e0/voaQXgFsbnMbw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.653934c5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9m3eCRA9TVsSAnZWagAAyS4P/jeEFGxbEpA/bD77cqxz\nHf6+yT7wQVMYjYN33LkbGvZnVqmbAh96jT/qo2DEaa3fjFO66krtZ3Rx3RsG\necEKdbB4BMx5XBDuXoNcXobjBswxyqhAWR4bAGB/c7QEDQzDLvZM3cKCE+zR\nvs2xwC3Dm4QueHAKGlI5l00Tku4wd8tnRFydmqiupyNXn7/mxzO1pANQanm3\nXprCf34T+772sgbk367qYgaeGJ5DJfQ8bUlaYsuJveMJr/j4mexVgFw9TSUh\n1Xy2faxdZfGi82SiVDIo+CvJUD3h1IN9MrOUO8XDSsEviVvQIyr5Ucy1AO8j\nKpdYZ+XGXgdPgIE3Av10HHuEOGAq10d62xp62WwMcezNtJ4DPqkD1xxNf7Fe\nXyb4pdQ8diAmdLIo8ebZs8xdYs0+etfqz1EgHAxkqFTB/Wt1UDga14GuREu+\nLVMUedg0etkozZaYCtSmL5IdHj0r/SseZnWCd1jfvaSPvWFusbtLJkhC+80O\nPvAfepLxIcfyypq/i4wXuHP61dL06M+kziivyX7f/x0eRya1zbZmQMJaPsm2\nriDtSjJOGRsi3mxkHdZvBKvldy3ipCDY315kdz/u9bTGjjlaH6v7tlbsEMdW\nBIDB50QPeXOrwAswQUXr1EdUEUyIbLsKtk3gET1lUpfnm8rru/G8goT74+Kr\n1Zto\r\n=3zxT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFYylR/AFE6iC7L7Thy2yUPf8G2fDRyTTNrf9SVVfxJmAiEA6ys9ZKURMkNEfEa3ow4w0rR22dGNlh6iAUjfqtuD1Zc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.653934c5_1542876637790_0.08278451159562894"},"_hasShrinkwrap":false},"0.15.0-alpha.b5b4fbbf":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.b5b4fbbf","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.b5b4fbbf","dist":{"shasum":"1178dd48400e11b425cec5000c7ba2f6b1e82fb1","integrity":"sha512-gB+HZRFv2PghEc8ONHuq0isqvhKbWOqBFspqZA4VNJkYwyFCX1b3N+ZcuG0zC4uvBXICgAD4iGsrOrayfAfu7w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.b5b4fbbf.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9qBTCRA9TVsSAnZWagAAdggP/iPIFZvcZUuAT3gsvaKb\nW8nuL7QafLj6h10mh5ZOg6WNfLYRcQp+u031lDmqorWXduM4q/eWvJC57quo\nDKb0RCRZW/Mqg3SKeaCA/0Szvv/uUPMU4+dLwg3y5Rqp42id20856Y27eLSd\nyD3BuMYJ4pTza/8pj23/Zj/hdD3v1W7KdtRUheQ4/3Yjq5mdRj4ngaZ4+63A\nxPYrar0vRiTpUI8YoNF0yF8Ilw747+0wT9Lw71Zo30KXmoLEG+U9dckqYBSE\nQdC/KVpDU8HHhGEPPVQUNdIRwzUD4ldhfvxPSJLRZ2Ap4l00STQLWoWNudnP\nlvFYAyh4tlEewkPxlq0npyvaeQQG7teoyi98p45j7j3yNc0vQghIuYSotwz5\nLgho0hajA64XVKtoIesqBV9jzaSKtYJ9bC/++wpibhj4RdpTf4y0rF+yqE12\nDHIcZuKiM5QXlu7J/UU2YiWaEFb230cf7SK+wC6tDq0mQHmMMyAGv+v3SHSK\njJBFQTLG/JLiDHwchZnVSpuXefdk8quATLvMK/ncyegujx5KNA9Gj8UE/lr/\nCL16zhBTNN5y0yFwa6jxVtaL+ipLSK9VQ5YOfu4X5GEPVo9GlSleEi965gp0\n2KHsIqk57Yv7668RAqhN7VPWpI2Q35s5zdawKtAJq+8r4x8d7GYDnQEiuffr\nZq5C\r\n=9Icd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGSVK6d3SrV29KXBYpzu2z9C2qLrcO+wZG4D0FI1YrqlAiADHrRGMTck+a05NAnsmTqACE2KlYHU0wNy8Jr86/lMvQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.b5b4fbbf_1542889554677_0.5939534098211923"},"_hasShrinkwrap":false},"0.15.0-alpha.4b63a542":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.4b63a542","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.4b63a542","dist":{"shasum":"69f8156a7f637f1eaa6fa243c6e1907aa76c6844","integrity":"sha512-Di7OsAzK6JVnpRzhXlm6py0fBvU6pU6IhYeHyzFEoy4fMLt/UhaqQ48YHeKfurQG49CZrCMBAzi5X1yBaO2d5g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.4b63a542.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9qFuCRA9TVsSAnZWagAAxLsP/3frcKyiO1YnDsBhJChp\nLzJPYHoWQfqgpvaJPdbW5msea0P/meM2BWp9le1lglnLQrzasW4l17QW3ji+\nAm++0t9jrTKActp/YNcgEBr/n+BiQnKwjdyDVNHktmFeruO8lSJ6OKoG9oiq\nP7E25hYNsY89156bGPJQ3P+UhK1u1lERFNA7rKLJYRAd5SCuEnppgwFqJiiY\nZ6dgG2yYO8Sbm487nqoQt0/SkgloESFjQIKK3cJq/48gdm7B3fnXdC33pJ2/\ngvqnidmBPwm87Eau0mL/NZNhsIOCAhvIEus2vJtlsrVh44l9/GatJpbAw0SR\naNehdGrS+zNOL3DoJSfzdDjV11jPXzstKeO/OH4+gj7XPq++BzmLXQvOAT9M\np9ZIUi3fclGeay1NSlrRw9q2uzDLIRGnVis+nLNZP5F671ON4svOWIUbkbKy\n0/5KVFK1M/zjfSohc4Me1Cw8VQw5+9PazWY7/iSFDJiOuMSC4wNM0lJOIw96\nArey3dokXwnCWXLZF2tLKGWURKLV66zFZyOc6fp9ms6B9LlCaQ+f/nJhNEnZ\noYk/vSWfYj42rjdVW5LkNK+XG8/b1UzMTEIQUI+AGMQGoBnM4D8iK1zBF5BE\n5xXKf1dV7qU1Y9j+s1YLRLcApfDb3tVNXGIy9Cadq2BqEXAr0bfoymqw9UN+\nGlYL\r\n=v+1Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIClm/jqFHjH0xxl1G1csc2J0S4iS6HDWzdHKGf6q8hb0AiBz4OgLoiqKvwPnRpqpa+C7bXePmMUlHSvNvP8j6467wg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.4b63a542_1542889837691_0.043265151172738436"},"_hasShrinkwrap":false},"0.15.0-alpha.d93a2950":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.d93a2950","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.d93a2950","dist":{"shasum":"e8663ca2ca851b6d2458387dfea0b62035205d29","integrity":"sha512-oOC5zXdPPA8+80IjWHb+HNE7vqlUOvCFy22d4U71DqAvBUG3FPuQJZ8iYwMYcGu07FjWN8jxXaBkyKIJzDwy8Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.d93a2950.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9qqFCRA9TVsSAnZWagAA+gUP/iSSCGxpJHBD+/45UvFl\nlsYJ5KAli/v0OkeBpS60/HjC9DQPQmWB6Z5VXqvzP7Fcs5jnDZGjPswqeDpV\nM+xFTYM+XwqLT9RAFvHpvpxBO5UM4Iux+g9inkaLBb1GeLXzQkra/7iKsl+z\nUMQyYdzLDVNy9uezVvXiElyiGXU3GgeeexZe4RS63fOKabHzrw4o63ibHUCd\nfUJ9MDyWnMoRxfTCfZu/vm7SAsmgpJbybGDB63+ykY9QvOIUkNxjDLBEtPJO\nnvKhbmMLypScSVPrzhq5x7JEGvwVLvdC83OTfZ1OLw0bAtjwcVXtDoD2bcRx\nvcG3/oLWKI/+0DD/U05ypuE7RZAWwijDuLmxg7ta3S0zOn/9/IvoGx4dxxSY\nKe0yN9nR0RooNm8avwu94jS6PD2UEzbxSrymXB1Q8AI6EdbRWJKEWT695K6y\noHL2h2PcMMAqPDiLdqH88KNUxyKJtMn63lwQM+NJU1Gl2iVqnqKnMWJhLuYD\no0DJ4kxtcPU8H3VY2P2fd2AY6yEzXEzzZgp0s9y2qTBodXvKSLs8rTJyrpsK\n7rpwjMi/4yKebTj0aUWOCgYD/xEu4WYhN2XgaoNWsa2k5ZHiw/1radXHRqQK\n5l2pjIqKdSPUF+e1JtRSY85NGI80gLyhNVArDSgmmcW1MEeOXPh9iGQE/HzM\nPivT\r\n=vvvo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJ4K99PdmcYc1atrsaSBK/A+WONqzEP5Am32L88jz5cQIhAKJOPHHjbs50lW7W6C7EUNl7TQltt6HYZGm42kSKEJoe"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.d93a2950_1542892164625_0.43483448572808814"},"_hasShrinkwrap":false},"0.15.0-alpha.9941f643":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.9941f643","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.9941f643","dist":{"shasum":"8cb8f2909e628492ba3b381a34386f456aef86e1","integrity":"sha512-whQdVRokdlFpqAKo2Xumwl6lgWqKc7EZXegSuh7dL2CbihR68n2rmurFs5F3xC4OKqvibi+57RuVMO/uTt6BzA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.9941f643.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9r/0CRA9TVsSAnZWagAARWQP/0xsiUIwJczgxmg8O4dE\nhinbDAFgz0N4lP4A4BDUMUiZ66qcs0ex3z2b7OVB7ocPjk8btwi+1BdlbQX1\n9kA2HrbR6sPm7t7R0tYTexPyeqYFKtbyspRBJGXqBcuYHGTL//fgsGCIvokG\nAZ2K6f7y4T1gBHA2Ly3IIHmsBV1SwwkcxNdSoze620RQl09YQUjNguQZodS+\nntQb7IYc/M+zLo7hlNEoMo4FpRVPY9zPeJK3LU9ARpRbbvgDKwXwIYbBzSSb\naAt3+Ug2XN1iOey9A8YkwL/fcze1QIr9oX53nI9zCEngPZ5yHrnNTtwJ3agI\nUEq8JZq4xCjVlZZQJdcvimSebsgVErHiyxmVi1FpZDIPxc1GBjNJOi3y+265\nEHeoISD2O1wRApSO+SIqkRnX9CXGNnol6xQb50CiyucHNwFEG5J3ta/jKfn/\nmo/EUsWuiQ/WwI8rX2qS0tMFCdzZtOQaVJwmTZWIx29hVAJ/lkH5rOT1NNEI\nZkMbJOXthOpZwwaXhk3pZljN5erC5/Q+sA+ufT0s+mSGmrnZ35SOIjAdDxLK\nGs8GJpeTGK48j8Xnf66MEhj3OGwtsdbmvKgpivRerhdddXNcfqL03prw0KIR\nISXVMQhiNw9UQzBuCYh02qfCruoWXxmiz+ti4OszVS9CMuiE3eFjzo9Lzt3k\nFaiD\r\n=BrnO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3Fq0Qb81eKx2prHXofyu/QHOP6lomA6BBojbdm8HzkgIhALjTSIUwsKFvH8X//0MZDACUZm1tzVz+UKyH6Sc7Up+o"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.9941f643_1542897651756_0.3599367810769565"},"_hasShrinkwrap":false},"0.15.0-alpha.05a4d048":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.05a4d048","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.05a4d048","dist":{"shasum":"afceade5607c492494919b855a38baa5f4c96322","integrity":"sha512-Yy9JwJ1doOGoQZcXn6UUcKmq/3BnoucSAxyNvSlXimEieCs4IPYJRMiWSCc1SVN8Os2WXEzZAA1OLSktS66hNA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.05a4d048.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9t7YCRA9TVsSAnZWagAALH0P/iFgL87y/+4IL8i1oL6V\nymNqAppSBOAc72smPHXEV7wu+ZoJhe8WBu/ebu3Z4XuJqdAzguu68+wBcLJ/\n27M1c+YGm1Gjjk7suIlq4bm8zlpzmd0a+SineKvYziAQjam2qXYu494XBrIq\nWbm2xhHmjrjDbnmPyolbD7gVma928t6f5zpomLANsj+vXZw0VEGHvuPG7b+q\nuNDjqcGE9ptWAHH/BMs4zeVWR+vEd2zhZixdoajP7brDHCeLj3yl+gaIVJ0E\nAwcyfiqQ6RhN5DCiE4BOiaJQvuz8fWy9MjHxrsC8TvYJ2WcNUhmu51WFUcfk\n8Put7hfH4A/cMWFZU3ir+nkz3j/V4V5RURmGviRPY8wy0gtgRmrY/7J+RXzI\nFTFS4JpRb1tkSYk1Np8dtwt16mSeeJG9hRYimAgYY5hFAtZHJg9LN060w1F3\ngOFrKycjY69l1Ucxc94WVxrH1CDw7DMoiKMIBf3kMS8gY9tEwW2UJKBNjpFN\nhHgXn+0w1yYylJgYimuigaS88q4wcnbhZZdxpNxxG5if1SLH3c+9DGxlHF6S\n0EFONfCUOL9m5DTJJvKKXDhewJ/VDRNO+eCYi2KgTO8cgkv4cIEBzSVaOijr\nSkMTufgg9Jqefobvj3lEs4b8HtiRpDCNyAkhjdMJbMUxp5I97RaIRv+BAu4+\nfD6t\r\n=nIo6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8+zKpI3K/7RpojuG2Kgkdk2yy639eXRHaR9dHRzCUyQIhAL3wtk+FsTwqOC+z4RdneM28CrBbF2hA/Cv//MLUnT9w"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.05a4d048_1542905559869_0.33953309573601675"},"_hasShrinkwrap":false},"0.15.0-alpha.d353734e":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.d353734e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.d353734e","dist":{"shasum":"66a24c856986a9810fcf59f09f3b478a24325a0c","integrity":"sha512-z0aWl3Fu1N7k6SaceTuUfN51NQUcbMJ8pLrEMcYZVnxyt5YD7B8kOBFqXbGnNN0mnlP6shVExdhlenRmVtAQJQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.d353734e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb90U/CRA9TVsSAnZWagAA1hwP/1nG+TfUImmf5UXD/38J\nM0ZUvJVFNzkVm7A+6p84LnI94np1TWf7FlR6Xrzsh+ieepWUNaXtBJtY5h+d\nY6+FawjF5AITJ6Ypp04CI6PkZD+/Z9tl4SVK4dvEyre+KBZg3q2sJ53VfKkM\nkTmGnBVFMVhfgQHIh9Eqya66idDG7uAv9wTvVqJmw2H39Cs77aPmzGOgKF9E\nyLWz0BkAuYwmr01TtLc42jpav1WGgbTxv6BeGWwf6Ul/7bhqCEFeLoH1oAMy\ndBLJgIXGbv5YpOeWxzRwbFibpXF8CZZy1H7ozBKcZCwpbfgUcRd+942/Br8g\nD2vd/p1MHcfbnZEFITSGgknnwA1VhIduRTk/gIHqzyBbzC6YnxHfT1kfghqW\nKfzI7cPkcJKn75yZQA8kQtu1Gc7MAWcDj26aUTPbbAvIGrBrgSB8BXbVNfS8\n6TGT4f/BATt7NeBWftzp+fVCMBBhARJJ0JKWw5YiCJEcmZ/xRN9HEeZTBE3M\nK2uk5t5N786+/EytGuvceuOqSZZm1akCNPN8HpN8MGAcoHTSQx5uhIKgDENS\nJB1RWr2fG59v92PqaIoZFjNIkpFNohGBpaOCSedf5lSAY2fj8nbKdKfcqp4O\nLUxRZBYqcsi4HoSYo7amTnusjq1nk6Er9O2nZ5CABqbVvwxHqL00gU7CA/C0\nQh1O\r\n=Q9CN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGQrFgqJqvSfQeIR1XF4hYwdaEFwkGMeSzQUXA5Fx7rAIgVVv56B1u6fhr6lICgVg0TUhB5ei4XPTCWBpKNZ2pT6A="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.d353734e_1542931775014_0.26379505457018526"},"_hasShrinkwrap":false},"0.15.0-alpha.c432cce7":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.c432cce7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.c432cce7","dist":{"shasum":"eaef7792f15170665a96c1559ec48766610ce656","integrity":"sha512-tTP/ySyTVf+QjPsNkmiLWAhkEQ/KAFbDsHysOvgOzQtirDZrye/rFQ/gsMuagMMh8Zai/MKkfm82uuEKGBvk3A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.c432cce7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb91byCRA9TVsSAnZWagAA+3gQAKQ0FUzrTUdPcqNxm49s\n5WEus0vaQSU/v7cWnp5GVhd5VsW+2CY3itv8VrucWYkbZ90o+S6nHZJ6D1zs\nBg+rXuO9rmtA8AaS9M25FZ6Fl/+R3pJ+EPy9kTlhW+9Il9sWMlAo9BKPf4TI\nsdGvw81KnP37ZQJJruBm/FMNRkXHaf+doVo8KXl4I0mZ8s4qV0uHutbbunDU\nKD0oYhDqCJ96BRatN8i6MKtk9DqjtE1HGdZrF1lGttHFJtJDMK6JRHMxSzyD\nmVKgXy4ewAD+nV47zImsmWB00pknAPscsma3hSRiVJKCZoKObN6NIZWbBdUR\n5fEUcEQ3fDp6QzahWzmQXVHMOiLv5q9mQbat6M7yu0J7/nGO3tCZZfOMMmB9\n0gmGLsz8paz4DeBNJq/dYs71UlQMFdLzhcuamgvAt3msqdZ2/1Ax9aG/jBfE\nHfryjXXCpX0zwQrSXH7OGIqHKHBqFhx6biB2x8dBWgo6/PrFqdmT4/5cYpTc\nDm92AyAZQhHuV9EMmOGR2aB7odYg4rkOx3p7v77PGkraNeqA8yyIKTMal6+G\nwy9yrRqPc6sW7pqw0nnLTlGZoH3I3Cv8tt8dbuT9K2x/n57V6+k/AAnokwNl\nPnz+9TNsLy3AfMDa7CGymCTP06jau4cA60nHBhpXT6rfVVgkQZ2TFuWNx/iW\nzf90\r\n=tRhT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCr/INb90mlomfh2hPjsGvrzoJ3NlO1adWEoXJw9s+ZKwIhAORZL2e9uCJJuZ54e5/JW04yNfxMeqde2/eyDpLkw6Mw"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.c432cce7_1542936305375_0.19975635651680945"},"_hasShrinkwrap":false},"0.15.0-alpha.43d3e5c4":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.43d3e5c4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.43d3e5c4","dist":{"shasum":"113b82f2ae12d61a9c58c90605d77d0c09aa440b","integrity":"sha512-xwc9phMYLVvSBgd4muKdY4HszAs4IMoiPV3A+rSBUBlHBL5NDrimntR4VBkf+z1PhOvctxPM7WC1XXzc2phU1g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.43d3e5c4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb939BCRA9TVsSAnZWagAAjDgQAI8fvGDfKCmWDYm0QD7Z\nTD6FGcz/4mjWaVI7O5N7tma6rDJTEGr7Qf8LUQ2Za9g6e7SIuxKRE2nOeZxn\nGLMlEdoCSOU1eTRPfI2zeeLOcPZ1sjM6AkyBGWjC9xovBl8kaIwTIz1k4ClQ\n+RHWzsq+uvfjjIDvAh0ClUjPnCTDBl/rMC75SOZ5uekcKaF9K4yoE6dsAlLG\nNO8Ip7RMRaJRdU6t1jGFUXFY2K9XZN8pVylOdjGqRAUIiwNRPR5Sf/YvewmY\nLEpddwNQTKO//uL6DfIHmupqAJhY7xdGUXe5qglaR2DnH+wHve79cusAMrJm\ndEmchvaZUW6rq1SUOYjdC12YmjZ6Dt1b69ZXR+UO6JKeG+IkxkWvwIzHcayB\nuzpyBdhmE9Myup9O+1XrJeWA0R/AQd3s011Q/IptXmHBQITqdFPP1lZojefJ\ns/JUGsjeqvQnMmvpNboSP9IzuoAxcS3Yo3gA4om49CXRQegVgIauYIG5KVf9\nmLJvuaXxIZXnn3FPRH6HLvdcBeJol+uvtMavzQtVmkEGGDg7027MiNjJNAOR\n9be66W2/P5MggkypTo2xfK30kdDbxi9lb/ZDvHLaH5RDc/mdZ0pfc5OG//+n\nkqanU6OQ1OB2dZ3vPVmSBcVlm51+CRyu3H2zk0+rmu4ZJn7TgN6VXcH9/d9V\neCAz\r\n=y4Er\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE8yVcrj91Xbg3VuBmsqYEm8y3P7ebDMyF4/diSA0TaDAiByZDqZibl2v2VAzwn/vxMUFtVRAMGiQzqiOWJRfsJlUA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.43d3e5c4_1542946624281_0.5828988400280115"},"_hasShrinkwrap":false},"0.15.0-alpha.5e223896":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.5e223896","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.5e223896","dist":{"shasum":"bfc77a6e12e099dd04a6e17968bc816b9a7836e0","integrity":"sha512-5Fx5fqAFXZ8ls/zpZfQHYKHuV3rvKuv5MYKQzoC/lnPkMu9AtzzGGizvU9j+c+AYVHukxnvj/FOsItxsqU1SgA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.5e223896.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb94CYCRA9TVsSAnZWagAAjZYP/RE1MDO7CbMfjrqhM/Mw\nlK6a/KUJVFYpu6BhMaNaBqKLxLPJL9emfan0JkqQPPPoXnk2k9wpSainEoct\n9RGApgB0BEjcIO9FTO0SuHSlt0FIo0D2swv0TE1Xgi/Rf6TjL7CyP+jx54RG\nqYBtTcb5il/HwHefN4uI8LxeUtYBevUvqYO9eGCbfbyhbbK76Ne1njIplOfW\nDYmEf4N5bPM6cfMAC1ilnx0sWV1/ofxcnUdInn5+RHAshbB/+7sbrJxrFvOz\nGKJ/OJCUvuLMOafxbBP7HW25iubOSPSx71Z4XZmRQBVgMB2D8PY4amqhcjHZ\nmX0jsUhGe2xyPexfMK4KVSckFTXup0wHANwCEH52UwvtdDJaKSJLnLwPj9OT\nRoIwwJzElUAg/gVEv2lt3lHPgAhp7ssnZ/3vaZqYwI3kiSz8jPykqWgFxt2e\nbCGRCw3wcunaZHnntYl0CRwHr09XDascZPj5f9QqtxLF0YYhrpjMdXy3xOhk\nT8Is11vg3vM7aV+qZhfxxkN/sW8LT7AxZRtlTv7iWPKu24s8/XphIc7hYKEA\nZ05qvGUPha1jN+fcJnYXAayG+fqkAgt3mNaxXk7fUvpgu6NsSeEELbs8Cz1g\nMeVEP00Xayn8SyvbZ/hP/rB4AEV2WXMK5LIlwvWeROx/8mIqQbRHX09mvSMm\neG4c\r\n=7+cH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG4B8HDnghdnuALXQPCQMdxriUIMBYJpLv258GnGGpjaAiA5lhWYby/zRtqMWNFi/fqeN3ddYi9L7v42IChPcMoVyg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.5e223896_1542946967697_0.03966497873001984"},"_hasShrinkwrap":false},"0.15.0-alpha.e976d492":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.e976d492","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.e976d492","dist":{"shasum":"f820f1c42d48ac7cab6362bcc4f55228ca852ba0","integrity":"sha512-wcZzBcrHsz+RUnpau21LoeeHWblQaMrTozAwOyEprqrPvEtjQKSVG8Qs4muzV8F3JXrJOrvi2SSxnimwXzg+gQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.e976d492.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb98n/CRA9TVsSAnZWagAAdpwQAINmPoVbnzrZdA+/rQ2X\njkt+7/ml5azsZw/rfZXArZzQ+P3GfWZ3Wq9vUqowGPqUCWb0egPmjdVJg8QX\nmKIjAF882IHvVRvSIfVu6mYdk5VeBZXGArX6O9zv0VTZm/J4hisvfJ3YEmM5\n+MMTvoiFCtcB4DVCZdcFnrrNtHeyvzuNRfJSZ7fEryZRtePtE24l9sFax56P\nAmsrljmiUTfe02rTzG4YQPLt06LVQPVtDdGSj6zrwBsnKREuDyd8OrjXmbcc\n+rbk02I03lO4TJhO6JGED0LkVdrGPvF9bY7H37xe6DT83ct6x+6LMM7XoKZ4\n/4Dds8Oa5I1kUnm7yPBS0p8MU8pVzJrwwFKZu/qT5cBPN4WoXyP771BeQwm5\n4bITi25IEbMfHx+vjDqm+pZQ8jGtgCUpZODVbQ9/TTh1O0fSAytvh99AnTgp\n+xpoasBpB7JOUGgOGwWvxTdPKZw06K4nY9rtAFCRjf4UlUQDKcHK70LY5XPN\n5wVXqgGZzaL9bZqEJwJhPKUuoVOZ2Qbtl0h11AnkUflYzCjM1VRWkxtGeGnf\ncvdK6KqGmjUWJPc7niQlRTR2LKUbYj4Y7IAMzmORaiUy8IVyeMw2arj9N9LH\nUMvYIwPcOLqYj6O0u1wnHo/Njax1fC30U+ixJ6lt6xJFtBIFd9y5eNmHunCS\ndBhA\r\n=mjCW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGI6izemog8cZ/ABWi4MQ0wOgzT5D4cTlgBWyPLt1IcPAiBND2mDSx9yRdwAnb8Mmr49/HLHydSL8CPJL4gFJ/5ssg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.e976d492_1542965758919_0.7496446916344639"},"_hasShrinkwrap":false},"0.15.0-alpha.c38885d5":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.c38885d5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.4","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.c38885d5","dist":{"shasum":"7e7954f3c38564cbd79f9cdcb6936b9a304243b0","integrity":"sha512-Z4nlWpynA4T1h4/n4AxUGaBnQfBK+8L+KwwSbACgDslmo0pyPqIHy67Fdx2EBrHHip8EE+bJOxWcOxl2Nyi44A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.c38885d5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9+5JCRA9TVsSAnZWagAAowkP/2avO+U4aZEh09oQNJ5e\ncQuXDycceXdVJaxnQ4xeLrcuiPemaFrRonXIwWNqZatUR6lopiCxc2NuTWlz\nb8i77ff8QtwG2R/e3af6Ar/YOL9YC9W3PcIXE8mitfIRt/oYcBwHEhbAJkKe\nbVqa6CgDZ3bNBT9GlXS8fP8kXvhjy66dGVPu5NusOeAemTdKDohRdUAkToJf\nGSM8qcGN0DERFOpRwDR0wrFOXno5qYz9kzhXrDmmVe+6Ch4aQPPQzhmBCv+y\nd7mYAMdH9vJevrjJqDQZjmCqQsSkzQpNRqXBn7Cl+G4e1kP/w2r0RWXIRy6t\nwyHTJNj6ED51CIyMJAMGdnxFSdTKXU3hFOvvNZi0lrPm4iTK/5pRrQo6SnWY\neOifH3K3dN+4BfiUdw+TI7AKz1/cDK0lx19hjKVjtRKJBgbb/decL//wRZhP\nz9H1HK0ieyct7sqAB90uXds4tnpq0ZhlLcHgqhgsYM1tnOb0SvPwXkWWMTg/\n4sMU5sxbQlorIfLVXF346jp4XUV+CL2y38It2Yj/5li25Z/Vxd8Gh0xokuKM\nZf/BNwhS3LRRhNkER8L6DO6/5YzlBEoN3FBOrvol16HNEBKGemNIUYkwmNbu\nr3PKxsV9gBUqODY1FTx5Yo+z2+/OR9m9AAOICUAuqGHaphdJZv2vtmFfTnLa\nrjVs\r\n=hnur\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDepjHjQw02KSAADkSN9FOM2pAh77ANi0mmlHR7Q3W5fAIhAN3yKVAn2qqUxoBJYJTIKDTGf2sz8kpoQNoCV9nU6yrz"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.c38885d5_1542975048616_0.36707080638846423"},"_hasShrinkwrap":false},"0.15.0-alpha.4bf5a40a":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.4bf5a40a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.4bf5a40a","dist":{"shasum":"fb385e35c6450f0871908c9bd0eafa53158f8029","integrity":"sha512-p4aa2MNQl5A0tKjIkEdMMHWuXlPqR96+MlLIjH4mM8iouoJCPyRZEepQbpVwgm9bRzNoCs9tHtVWTwF81jFvpQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.4bf5a40a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+Aw+CRA9TVsSAnZWagAAxecP/jgWCKXo/GHZ3zoJupC3\nrEnxke3jzEGUQnnDTR0v5scyD42n4gPamD9sgQk7hTHMBCVbYEPj98CbXGnE\n1lnXti5LT+hs/ZGlpDrs/HH1MGk2PbMte/VxCSf6oZBlxTzYobwO5o/G5FgL\nzG9QZkAUrhk2Yby7LnLiaB3RQEI6Y6EidWq7jRys6Jvwt1Pkko90rmhI7ZMV\nCpHPNLmfaLEGby0MSFKEDfN60PO75WrkarAt0RpJsd2OuoyVxcSadkee0HU9\nPOcMnWmJjn7PkqPe5uDc6LkuT2bAqeAf7/Jx1y215J+u8ZLeA4JYrrPyV/IP\n4bPqwwF8mj5iDPGs16yQCxgu8eFBXrkdUjVbjsfPTdNOGLbNKkw7PeP4/90+\neTEmB+H3nmCvGWB8b1/2hEtudpIpo2+Is/xjucG0kZqbcSqbOgjC/xT7kXtU\nZM+/+7sX3A8ywxeMO6zHlBtmPsjC9RcGCRL1B3FVB5txmdvG/52mRajpGHjj\n4f1P+X2H1k+fOwVCuMzSNXoe54gy0LRB4WqquUwpcOkj1gyg1W+//T1RM+MW\nLobFNRHELugPHrd4wzKyi+S4zzkUQDH0vgtQ4aPSbRCU1LgyvTkSS0jS9Ife\nKKFhE0xFYNUnO6C8UYireKxFwMAxBmDNDA306VECAB4rYu3k8Ez70MiqGU/F\nmNl8\r\n=wCth\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEIozDuEn+Q33/AFGLhWiCuOAIU0QGC4o+4YWQrYoqhyAiEAmz1xjMXTJvKhKdlyDc2QNK39xeRXC5s8kzxrtsYY3FQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.4bf5a40a_1542982717486_0.571794813364396"},"_hasShrinkwrap":false},"0.15.0-alpha.d254850c":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.d254850c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.d254850c","dist":{"shasum":"f453813d155ce0cab63f3a6f11c3d1f720dc1786","integrity":"sha512-uNMeyeBsZ5J45WD4dtEsoam94jTMDNJq49J0YTodq2cI9ZyZlf8rE0XF4S0x9b1EKSRVgwBcxeK12W5INPiXIg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.d254850c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+BWECRA9TVsSAnZWagAA9Q8P/jGVyADvtXioTzLYq9h+\nCN+Q5K/LP4VgiMd4M665Nwv7jrmGHrifVMxHiHOfkVVWflFQZwEHwO0SQC17\nnt2iYHe56gfDgZpLYQIcCzK4aJGj82o9ccdkLMyfbMZ3EJSJB0T9YyOlsXKN\nrm4N5Wgu0taxV/VVcVekz+EuxRMfeHPJwLTO9n3biTGXSeRE8nKErX/FwdNu\nrrY0pmpMKdCViupP9+o3N9QfAepe9qQ/rz6vuD1laadzlfxchmrO7FLOYlKT\n654PzY9rFykbvYlReizM9HOngEevV16RGHcw7n9P2rJscn1jRakf8f+8OiXr\nlpGONkqdNP0U9SkKjVsXFwLZ1cyf7LIRcFgKc5x8TzoBEvO0nfunc6srfyds\nSKNpXKCgHbId1mTCVcT/FzfdSqjPoLYEMxO8tgz3n79CBFmDdFtc9DUo16ZM\nR/MLc/3+IqG5/zCr1tEjPsdKg2x6jNtCkcwId7Lno3mRxLVtNVbCR0LZOq7T\no536UB0rAvNKVa9SS0FY6r2B3Kx7gAUqpnn92xGFC3U/nLlKRQ0bm60Q8jE6\nFKTw4/B2YqbxUvEIuyNiT3FjzHNHUYc6OBis81YGiyHde7UNn4+ozIAM18z7\naM3xPrkZZrTaXZcKQXxCRPMAMgw18Ar3mBqFrohTzr20JccNfr1/eVtVz5uY\nU71g\r\n=lCR0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCowARSrU8raUdCsycDTt29cDx4ZDhR4g9flckL/lH36QIgTOk5tZVXBrgyqdy8Mw8C2MAAQcglcqLNkV6+IlWyjJc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.d254850c_1542985091779_0.9681214464230024"},"_hasShrinkwrap":false},"0.15.0-alpha.15cc618d":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.15cc618d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.15cc618d","dist":{"shasum":"a509b4a0e1c4d624c4e120b83f55a3536c99d652","integrity":"sha512-//8A2whTsRiBufRcri9I2jnAvawFpkhE1HT2s7mdt/kdNOhxbz7c5SRnn/2r0E87u+hZPekW9VybsEjfhOzt1A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.15cc618d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+EJaCRA9TVsSAnZWagAANIEP/3TT443BUUHz3ob7E7o4\nrTdzLGQ0fHBgJ3XBi48WzlUWGjd+1cNieUhOgb0qMDH3mAvuFMQnlOiFXGwO\n4aaS49H9B7mwx4X+MX/SsTexz7S48TIwk7i7SiCcLf35ooFFAxCwJmzyXslz\nvSV/1QalyldHw/fJvq2uLaXip61AWww8+9parCSumFLLz8wL5dXzVHhzd9N1\na2IQE1Y1IinKpy0wVDmyL+uYihg36d/zJvz4IXoBM+K5HjwyQZeDaS+jZR2B\nlCTrkQ65sVmQgR9vi9dLgXPCywIVfo+3NsQf8W8IgqhHpDXRPU5LcwIPvFW4\n+jewusG8DPNpNVrkGKoLpQZO9xUItx3WVf2EbGoAp7sO9tEjCYYGGjg0sTwj\np++HYkaBt4FB7+ZYsjbBORXPB66aOHs6pQ2si3pvkEzC1Fh3tcXPxnWGx+gH\n7GpgLiDhwC4u6lNmDYT1zSaXoyOL7hjKIWvz6AjAoCY2cflxvt/gAXeVG33/\nq7jeoxFtCYoVxrf5DyFYe9UNrENOF1+0hVyqAJY3P9XsYrg80AHNlA+En2VJ\n8iII6kMykju1Y8dbhQhEjGe+vB0xwLKr8yLSEbSLBb/hEJwFcdvJXfJBCJBu\n2BU1RQPptlVLlJirXvACOoA7XIuurgK9Mi9zw8V7LUe7p0RMec39O6SHc9mc\nm1fQ\r\n=o177\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF2oJ2dpc1/CjXXycBZvmfGKDWcpdHE2ODjgvg9BHG2KAiEA2aLygD14TfWY12kyluewFeNNxMctUxg21v0rhiAsKkI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.15cc618d_1542996569183_0.1802298903812385"},"_hasShrinkwrap":false},"0.15.0-alpha.274b13b3":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.274b13b3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.274b13b3","dist":{"shasum":"e5a11f3c547ab95a82ad0e91901b69b7147021cc","integrity":"sha512-cD/C6yWTGkx1owytU1KF+qXiUqq3Po9HeJ9p1gtWyZA0Gc13guqte7bOepjIxFnrkmZBde7dM1mJk29IoVCYiQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.274b13b3.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+EnkCRA9TVsSAnZWagAANDkP/AmSSsUHrUDu2JA8bKcU\nejWaqAX8FcMsYx4sYbPHhQm6+oYmjUtJCuMbDMjkGb3Nr08O+QIq+nko/KFM\nBIsQcOxCsQg0Ibn2gXEaZKJGY0Yl813o0Xzhf5yhZr4L7xqJZJHQBIMiiSAH\nFMdFJYfOXVe7XUggYlvScbvkOvM9sgSi4vZHfV9h0Qe9g4Sk+JAxGswVjVz9\nVasWA72wMwm/9Y/6pX+L7MAhYcKcSjwvx6yK2eab04sZycnvabVZW8IggRSu\nEaEFzPMrfXSS/NgOrSidxPd+q4dfNl+3D+YjLgw6JtKcqM8Bp6eTIzfIwuu3\n/RRsrl/oS7eBEog0B+qpAVuWI+sMBYTDNwcYRcTt89eKcnnLD+vLxbNfx+I4\nm1nNSNLuk+BsJX5JfRU0CPrh3Kvp1AWR2mwrtVJPMMCdm5CP/BEgH7kHLaUL\nAduiBVwwhr+rWsSdaBweeg4zioWLf+7gASaUCAPRHK6eRafnivXlrBG+FKMa\nwfWhhBqfhkKEvDUuK/4mq+0DD5ov1SonlvqORK/teTUyrfGGiLOPRJlymDDW\nOefCE4bzwAEEmSdaYakHiBBjrbWjPWJHeq4nsuIAuCk0e2MBdsuXLnE1kC94\nQvrWhV7f5KjUw7HkeqFh1Gs5Tp8/1+VDQ7ZXxZi/ip2typYW2xshpdWPz8Wk\nNOrO\r\n=rK1b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFlnyPcPHYzb1grj64HCzz733P2/J05rWNz/ovrOia7zAiAJQQ0h7XvKLoGS5KV7VIG+nQsltKI78qImx6PHmkOH9A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.274b13b3_1542998499784_0.7953291754518805"},"_hasShrinkwrap":false},"0.15.0-alpha.35d61f20":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.35d61f20","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.35d61f20","dist":{"shasum":"09b8192e6ccf154546069758ae4ab2472ec8db5e","integrity":"sha512-/pOKqlN5trQ+SW435mwunHsPchZ0jAGW8mPb3Yjn/AoBs6WDjZJBVId+vuwPaS7MfEnYdwQ/k+QJkWl3ylN39g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.35d61f20.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+KZ3CRA9TVsSAnZWagAAXqgP/1AUHCNH0O5181zZ0mKF\nWdJwAePkUpTGTcayJlseusnEwv7SIeqNqVha4drpkeWssiNmgFfhNhTOUy3B\nzeG7O471z8w66RrkL9HfFIGp10p3WqByYX7IAgy0PM45IlHz76ikW7qsjdIT\nlu6JgwZ6xhIukxRK0Xjz0sSq+JVEwYqQ5Xcn+C5Lj3Y4R5EnpQWjwWfB90hf\nH2lj+dD/5TrlZVOhoRMCsKWLbbrXr4ySXtbC+ETUOltfQu979m/60+5eYaQw\nhPs3/pOJ2ynIWcoZsrt/vb9p+JwM7Mnz04GfmHYTA9stH5vFeZVneTjh+6LK\nwM+CA6MojJeruEBQLAGxqPMdC8AYxifWsHTWfkBk0CspDBCqHC210m+J7/Ht\nR1fD2HsCz+e7HkYlOwBiOmnwCi4mGEKL6yJ/qCcuIe8Slfu+9ndG49OQWmop\nAVgxWcRjFkmGEQuvgljrOLikJ0Xg5DXz0dV+eX3h9b+P9pg7+cothxUUnS/w\nAM+mG5zGVa1H0lLPs4bHdOK2G1AsEKn7FOawTRosft8nT5ucrEXGIeueHnlc\n+XSv0zHBPY2qgYKzSz83hNmsTyIpxGqZcohiBFyZ2s6UpQUc4iwZpMmgUqGr\nxaSHp+coiXdo9yQrKA5vFrclIp+O+VoYOzb3PSDtBegCB3FdqtWe1TX7ohB8\nwHUl\r\n=XZkU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG4WpRMYt5l3927BYZdysc1tpLPCVSm7LMPVMSR1Ml5kAiEApj0FXKn/ELebDK0LZA6V3c0yjtwkES/nQfAPxDVR5wA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.35d61f20_1543022198241_0.1429985011179391"},"_hasShrinkwrap":false},"0.15.0-alpha.29d87ef4":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.29d87ef4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.29d87ef4","dist":{"shasum":"d328ce9802ad6f5c8f2472f2dc1890fa84951891","integrity":"sha512-jZqKn1BFlcG7tjwxalsLfqiTsGsFayurhxqfftG+OikQNvsjn4JG1lVP/tQnpAPJ4lT3J4I0Q3LfxdyGNWGdMA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.29d87ef4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+KfDCRA9TVsSAnZWagAAyw8QAI06RRML3sRuLsZHVhVI\n5uDQ+nK3BeQCxvNHheX6+YLmbtwmiY1kx1QNqVZVf6RUFtFIjBmyuZa7B6lm\nCWi8FgT4sF6d8axcs7PVHP8ESLnopoplCNU/D2SeWED4eRbH/vRH/PLUsuSV\nKAyEOCURtP2NKzzvvdU8YwvZIigTYqpCM9dwRzjBoGI91iuIa6WqJOYEhplH\nY65tTBc/zuS5atmCjUWAh40+eadhWJY02Dlyo5zAukKAwid3lEEWOw5qpOdw\nuuiC4nF+3xOdq5HtJLpJRaH26O0hR3b1fqvBr3nHdbssACK6I3pa37Zm8oLC\nkHwWPYaqB3cdOrERoKPrMtECPzvAyOhu/lNO/yqg6e38sigEwOS2UFjh/lCH\nJq2EFkpsm5R5eXUYl00IQ5wHS5nGvaBeZSZ7s706eVB0sr1w1DWQJmHRYShf\nvvCliV0405IxkkWmWtuZmetfRGmR+hXnzg3tXVVh7TQeXcELKozjK3RVjqva\npSI7wMAh2EHUwRs1c2iyvnK2WwEQLYpIBp25WQhxywmUISkvVQA8/EVTbSuA\nW5dM4iqnmPt3t5NHNwcpS70XydNHI4XBIKABEAEppgzuu2nJkwe15BBBiaRg\nVX6clloWZwuCbziuWUW8KwhKoiEuemuWTNsMzoqWpcw5xElEGoouHwZSC4Pw\nuz3D\r\n=B8co\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEpQIJ2+gPe7n/MYSMuMOYTTWGNRjAM1Ro3Jf1kLt6wHAiEAnJMS6qR1DKOipzwYz/uYM3QygOGvN6PpONL+7F0efCE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.29d87ef4_1543022530531_0.40762403656596957"},"_hasShrinkwrap":false},"0.15.0-alpha.63fb1244":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.63fb1244","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.63fb1244","dist":{"shasum":"c6539e28e16ac91a09fbf477316c00bd4db397d2","integrity":"sha512-ruaEdYUqD0SlIoWB7AC5rITS6tpa34/lV13KQ2QVuwx+T3xaixH5F6HV0dpTrpe+/kfywhyZcWculmi0xr/iOA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.63fb1244.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+KfqCRA9TVsSAnZWagAAFsgP/0YXL5N1+VNGgI3e5Dtq\nS/GolZIhJSgWlcc6qN1Pr/gDUmrGdZkMkaYmAhf4A6LhpEncZCVBHJYHQo97\nY3veFt8oDOa3rg6mmcVli7rowS9lYu5lifTQIKea9VsrshSu8+e5o/5kiJTX\nCwWUYKhNvKzESc0Nlzve4jpW/mzzZ4QkC+Ii2F6MHI2rB8PAmjfMprtACoXX\nOz/O/VDT7zLBWIcKiAh69DTAcOsRQKCTVBQgCf5kkyQK6bZ3yRbiEUCp0sOR\nYY9LjpQeWQ+rSgmTxGkxGbek7FOme4i9obDmHooplciQ4VktP/uYo0r7zGQg\nufPcH+0qvRs18S9OG3wMUSgIQOFjwx5kTtEP+ok7lcX7mqKh+5/srVAfHOvJ\nvRC1or0Lxl5AtsoLj+N4aLdCMcGeg1yM53ilVgwf05l08zgjRmYoN0xHK6DV\ngODE6zoPHbYGvFNhVSjeNVl9YHKZBBoWq/L8Rh/wsmUyuNUX76TRpt6t/nm5\nC6PgEe4PsBaR1prX/oZIF/l8xKpIo3XGoV1TryzJr8ilCvluvl728cVfjR0t\nMNG4QSzfmIh1OXJOiYglHvrfILXWJMlJjm3SeH5xNHfd7jEchfERbPmuXIuc\niJ7VB0BwjTV20X8eEyLFQspJupArQiQ3MbU/C44SskD26IhArWLD7JCy9Zn8\nUgLZ\r\n=way9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAKMfZuophf8Jl+OYNtLEzIbmvJ1DA0boiDf6ypv+d17AiA2A1VJWIOQd8RG6Ycl6UluvLuZhWc+euSITzq3Jz4KwA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.63fb1244_1543022569870_0.6637439074027598"},"_hasShrinkwrap":false},"0.15.0-alpha.63faa20b":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.63faa20b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.63faa20b","dist":{"shasum":"d44d9d3e92663c9dcfa71ce6adada54f49711b66","integrity":"sha512-aiC+RkGkNu0uYEg6nKy0plKBLnsXn+yTMmgfH9ugDROaH8Izx9HwaSd9t+ytpucsFIjkfez2DTDCIy00uey8dA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.63faa20b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+KgSCRA9TVsSAnZWagAARVgP/0XZcCkjdyrhteP265zZ\n5/GQ00FNub7xsZuhG5aVPGVVhVZwXK9cr2z7TCnc3ZeeuN7C/3+k18dWluXq\n/+HCoZqKy9TR6YCi5sONektc3/qYG8mU+obhtqJYMSTHFqzuC6IfIDnUDWBP\nu/R95waYlTDZKsZzg1LJs0+3nL5YnVqoyy7Ea1K4N1f/tJ1pDBx6uhIPbcb1\nkH99TJrlh0ylwLOHV0pr2uLdihqJh8YX+A2RSOTxsxPanW41LfW3X4dlTpUl\nKPu6qmjlO/yZfhLlX549Uv6Eq/pD+RrEL6JqqtAPmeqH96ZgWYfPIKDsB7J5\nWIwM7QENN6bCGSOLGvvZqcN2dzruIx+vmA3L8V3kXTSBLDp6RqoAnUU/DIOy\ngS1AYhZBf2q6HC+GN6JvxJFy61VYrJsfI4T+dM7ib6D6kljkIcrkYmtng1Pw\nFy2kYtaS2cbckewdzJ796PdKRPQKjdLuzP0qiS830KhBAoSLfYjvP2r1ApJs\nm3c060jMQQu+vlgBzwe84gqRw4haJ8ZzD+F9pU3FNxqp1xkVRLOaF/9l0Isz\nhXmV13lIj3AtoGliWWtd0ox7DGanQpF3ULIIadlRxeRmQcs33PxwfK+qHjlT\nU1zbbZSv5SsMy2oU/2wQZsjtk6pU4V8ehgTpiIchMP8iz0sfFBLb4I0x0bTS\n42Yh\r\n=9zWg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE0EyZy2N6KMWPVAqNlGNNbcy678HaauUolngrG/GzU4AiEAvz5L4lBQIUugt97dzYYcySJrGKlypjisNRgAWugPKDs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.63faa20b_1543022609554_0.49981581431173416"},"_hasShrinkwrap":false},"0.15.0-alpha.0ec82c35":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.0ec82c35","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.0ec82c35","dist":{"shasum":"017c5cec871955275a76ba32dcf6b76a7e3ff4e5","integrity":"sha512-P3aQd1JYRw2Qj8MY2SEsFnzJubCXJ+4UoyQM/D7AxSFfQSCigMa/E2Olr7544HDcvshJHfmiw335qDVzNo75bQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.0ec82c35.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+UpdCRA9TVsSAnZWagAAxAgQAJuaPcGBtyszTtNmYV1D\nO6IcyMds4DDbrMUveLj1XMKzeOJmTehZM3yY3JRlJW+T+e27hmz+n9VTRb3c\nOXfJXS8GJxugQkds1PsTWaGnLPx2r9f5RLFrOvktXDJocDuYb31KYgaVIaxZ\ncO0wMAjABNcpTuKdsS1jkaE+PaMBtELskLlVtbBIt/JnBKDW278hRhJsAuam\nhxoZt8lMXfC21QLEmlh6olIivJ+N5bBZk0GTrC4fUHEBMSH20tcHfd0aQvM5\nL6x5+0pSC+YNK2U3G6d4BiA8RyocNzlSxqm4JUaFOQfoZmjZVUTAfGOF/XWA\nCDBiBiK6BEH89+DevYc1+Pb4pCZzBGjoVtVFEmkiJM0utN7qeqGF+LzF4aUe\n0u1pE9bPb1vdYXu4sNOJT4wTRih5xnl9gPDLrYt2vaHlhI9azg9UoobWvGil\nAsw61zL0SD04hZ0MBSNsCrMGgxyMkLpX7QN37ht3GtvxYt+U/COxCmB9na9W\n0VjVW+2ibz8uZLXeMMa2tTfpDnZtdjg6QHWsTGpUnfOwGg5MT/37ky0EQkzJ\nUPwIJvMvYCk0N2C5muxpwS73JHA3BMJ9cI7gdOG6tOwtAKGN8qKxpxfGSOHq\n+mpVrcPjaDRS3trB825Z1yx31An1ZVh2ZpI2xHMprmRIdr4oBrJlbZPAWerH\nKrWt\r\n=muEV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICiYylz5ktdZOhmUHuGfKZMr4X5Y1/lJ1rp/VAs5Se1GAiEAoutCWTrmbUXK5EVm0EwLDvIJWjwAIUzOT5NfTeHkqA8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.0ec82c35_1543064156578_0.8631768191950606"},"_hasShrinkwrap":false},"0.15.0-alpha.50bf6101":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.50bf6101","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.50bf6101","dist":{"shasum":"3ea3df05183de2db56e8cf96189724d9de5909c5","integrity":"sha512-cv4duE1qq1iY7giezzev36Tv3R32XU/OPbJvw6m10iwrQjr4AG3qqyHtjSZ5D+GIH2+bitcN5EK6rk1lOISGXQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.50bf6101.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+a2HCRA9TVsSAnZWagAAK5YP/2gec1PNTkQ2PtSPYw5S\ntYLJkn9A9lO9bLEv3kKaLn/grZnbWvUo0+MVQr2y+VGakuqBDRgvgEuqajh8\nAJ2G9AjBQn/EgYY0XYFrOO1WQvtkFf9dGsBRtBYvoc6nqc1s773HR8A+IB1x\n778lvkQya0snf+G7tgR5+mP3kttxeji2ieXgOOy7KacpfnwVLMSfQcwTtGg5\nh6tnvJ/vM1FKYxiLnpZk83mx1d0RVhmsna5HOOB30935WKAxoic5SFrUlDK+\ncVhV53B7BzzXaye+JmH7JA2s1ZGaBJL8hnuMwzjsEcJNM8paaUMTPzRCwRPB\npEUqDZQxHagHtEapTxWWhsnszpuJMMxSFLVATBqDLyeJ0Fr6nlABdQXvv0o/\n5sRFnY6Ro3CWvwEtSEDZLrvmFzvcgdUAGtS9t3JhMHR+CAruUCiYfCdD/YWr\nvpBVyutC7ZLmT02cNqHdFD5Jw52m9lup5E2GS2RgOUBldnEy+RNmBhIrySDV\n1+Zah1BTQiu4N6xzE7JLaRxP2tbHHVLRlSWW28v9w7sjT4GkJ+A7O2XX5eIz\nZWmEZJZaXZvZUg6W0bpmhejmEF3QSYsj6u635C2yQn7wpyszy3rNWw9K8vAh\nXlQapf5Mpr44qmMmhD6H8RahXBZIgOpOQlk3+0uqJZ71PCk6mvRbpq9lHNw5\nMgTX\r\n=Ltil\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEZRokUKcFiLKh5wKi0G1iZu25NHQhamRiICIYAVrYKNAiEAzELDAaiez7a8KZwo2HCXa+nzAX5yb3ymtT5wf3ON+dQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.50bf6101_1543089542186_0.6903792105761721"},"_hasShrinkwrap":false},"0.15.0-alpha.44b0d85d":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.44b0d85d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.44b0d85d","dist":{"shasum":"e105fd7ad8d56fab87a5e8a81f681302be508f65","integrity":"sha512-xlDG+SfV6d4v1kR9AMKIUCBJoa540RyemLWfNqS0RuY2utdDGIPZKbi232lmvBJJCVZBfY7JoW6bId+eABVA9Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.44b0d85d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+eXjCRA9TVsSAnZWagAAqqUP/1vWweep0ZURO73zmUh9\nZNNvnylQh/HEbRYYg0j/dwwfm4AogLLrlNQLWjLywjS5G5wStEUXjRt2JWZL\nnT+D/jSCLCW0fkjyPtu6WtUaIjZZgQOZ1W/fGRlTMufsAmOvSP+zFWW8XDNS\n1+gI3VW2Pl5dpM7oAnhnx58gUJ1j1Z7RNq4ckn5BZq10UMwhUQxtHp1DV9CN\nmPDu+XhMNlnhXTY0xBp1nPeOSUfABEx49W2c2ggtgljSjzzFSm/Sh+rfJpg+\nY6KEBSmc/WuEoD8Lk4MPYbC1HmC0txo9EgeXdLbJKzmZ8lppP78LCD6qGPv3\n3HRJHmreOqFAlfjVzgnIJ4YRuOJTq6N9/nugOIlLnszIWD3ueJqjf1nph3ag\nJ0DOgVBmP3eBUNFpznphHOItBx+s+HJuCXuPJk/gnfErWZJ1YUu65kCY5Lc4\nnna+8s0FfpBMo6/OnWsPUSHa3hnMDppQ2IuLFp1XwvqWz8TMIlfXqNiA3Qxp\noo4p7wg++R8p/ffneEpPUFzKzf4KFNJgQFZOL9y/mGxsOsadSqpkLvr08xKk\nKKQ/5kBwsFrVkMAVoGo3+yb+zPO3lfrY9huRkXWWYVyZwxMJnZH0F2W0DA4v\n5wN6qzb8cbJOKZMbLgkN+3M22M0SVqCwEl2v2Di3GHwDOqGPyD0IW2cAxJf+\nrYVq\r\n=Bh78\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6BtHoQOmWv3rWA/fYspfzoPz2ALvmz5wRZRj/mC5F/wIgJCTXs8klPcV9OW0ZWT9NaCZ0+X2WrQv0lgH/ig9sMbE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.44b0d85d_1543103970470_0.3669162054157771"},"_hasShrinkwrap":false},"0.14.2":{"name":"codegen-templates-scripts","version":"0.14.2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.2","dist":{"shasum":"f3ac6bb64e8002e6bd62d68117074bff85ec525c","integrity":"sha512-s+I93vkr2c2jqxyt6JGwn+qnOz56NBsZ9rjcAKGSRtE6mfnaI6atvfxgIA9jxMOhKjc3XBx0oWI7uAJWtiG0ag==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.2.tgz","fileCount":22,"unpackedSize":16711,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+ewgCRA9TVsSAnZWagAAk9UP/ibZYoGvnvQUCdiM7qpv\ngUDc6FRAT0JTPkI7AjveemUOU5jWYzBxdTrsLbmxowiL9BaGsQGBy0uGUPPa\nE6ajXgMzcsDpk2O3Yscnt0bQCSrwQ2PcFpW722HWXzwbAk6+ivGPcs1r+lJj\n++cjF400/qYikS4vI85E56sTnuUq3Sl5ESi9Fjk1LVmr4OZF4PjC79pehvBF\nsFJP5pTI3WmreBrLjaZshksN8fQ/e7qCqX5swU1RXjg4Ne8yF+yRaAuoeotz\nLuEvmjzgCmSRGB+RRSf+/DIa4n5uqzxGW5rLuqPqoTxtbI78pi8vUgWObUtM\nScITLz5q8o+gUdq1pjXyvrbmVF0lme5yV8pZZ99wLBhF6xgMnUpR2JDqCsDR\nIv2Z14tmugQpD7njXJJoDvf2BWjVfUunTkE0ZfeQHQ2Bj7BDzcgnTUwka3/t\n30kolEqVMrGLKJUXrSEwr2Jw7vcYYBg6JdIH4hJNUosmIHde7dEZAJ9ZlSsD\n8uHY0H2sWjiBjmcsw8LrKYfcxCXFpDiMfSTark3JNjss9A5djZDhKQWCjcg2\nAQ9kU8f9g68FT4N9Orip1ZkwYJdnWx4ztTEyld7tqk7B1dIxtHbZOAbDQDO9\n4aKAOAjoj7UxD+U7Xi+Xt5lccLTDT0iDuXR+3QrCEXcxjFG8fpCdQmUyt9Gx\n/hJ4\r\n=bjQ3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDn3HXZioAeLoPkD6l36C3oMDY29JYdYMVUD8qQ2KFLVwIhAM+HMSobCV7JVWK84dqNtOBtgOnw25SqFuvHUB/qq22m"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.2_1543105567668_0.8816067277732742"},"_hasShrinkwrap":false},"0.15.0-alpha.132e20bd":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.132e20bd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.132e20bd","dist":{"shasum":"f174287b4a27ffe1b0e293aba123e290c999d02f","integrity":"sha512-1xy1SvG2MIJ7xzqjMJjWF+PmHp89x4ParvkIsTIDCWIdEDHZGGSLOddaBGG8oa/Le3k6ffpnVrVmfSGF14uGsw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.132e20bd.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+ez6CRA9TVsSAnZWagAAUX0QAIB4ReGIz/0Z7nvq6QUD\n3x57wr3E/ofdwnSaOEP+MZiVuIasqCLi8o0LhYmER9BoLIOOzeu/YzlzPo7u\nJqGRR4KECh5COCcKypSFOpoyvZ7xAo+FqOF0ZxTqHg7TY6ka1zS+BBhT/xsJ\n5FgliNdlQPTie3bU9sANBOpKEEN6gkYQSYbFRmy+o7lBdJynepDrO1g6kAex\n3om6tlBMs3/kRDYWAjabck6e8N0NngkztHJHhc4C4yrL05Ujf+xCFNAKOua4\n/RZ9sdk3khpkKCcmfhAINqQ5wvy9iib71di5r/Mjo17TwhRr/V+qOfPKJzrp\n4DENMTn7MBCOBMcL07suR0trwh6rZGWDZSz9D6GiqbL3DS+8fgxidkMLfUk9\nP6RN8zo6UUToIhW6IZD0y0SCf81yonjaR7AezW5BRr9msqKCx0EYQXXvPhBs\n6+TOYufwZwl6SleBfgFB4sINYdz5iribY75rZISjzyy2yTAdkI4wrC6iiKe8\nibBXnfsMDaO8PO9BVN3u5sgzZUa5C9lPXKs2RkNlQZAezBsu/EfSxdWOAvwM\nrHjXsKEE5PUsXjYiiy8MCQLwr6XP/zANfU3LnPvjCtwh4/6P17PYxfRpKnZc\ninXWOWFjKvWbiTlHPtPnw8vPOx5lugBgXm/e2IJIzrXDqKkFt07stwW3O+IH\njRgK\r\n=4Fud\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCad3Y7bYJaHeCtHYcccUL68VvhO5dgooWzuECzLtt2IAIgRzq4Kz3vNuQw42BmXNkp0L2c6Ef5pv8mwqEP8HawWN8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.132e20bd_1543105785563_0.23507323421592652"},"_hasShrinkwrap":false},"0.15.0-alpha.2b8d2644":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.2b8d2644","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.2b8d2644","dist":{"shasum":"5cc44b7ee9b95587827f7439797099900b29fa4c","integrity":"sha512-ITQikuCHb9H1U4b19lQxFLf5wtE4m8+46Py6Z+s039h9XkWrDi2aGwlgZwbBZuIojoh7pgK6mneDwQMYJrxWWw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.2b8d2644.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+pz1CRA9TVsSAnZWagAA5MMP/04BZvEKMS3HF7nb8Ga2\nU3GbaYzcmKIWvC6OUK4ecpHTusHqdnKMP7bw/GrXE83UlVp27S5Of8lEKIlL\nKVWksbvhQd5IqBD3BCvJvhw+7bguu+CRWoW6LzsYAUKNcKvglfdwjPjxWQKc\nUul52QVQU3R0RwuF16I3FLF5KLJ8SB2qHZROe8QUcwhLXjIs/3IaSfPoZAeu\nQBwH3o4O2fuLslF+n4R03K+2YsDX3KaOLPFusTzsDftBtEDLc0NL1LUipbgA\n//Oj+JjX2DmVGd44Lnl/EUUiqDHvtKtYyhKRnRob0Jq7NTHAvcwGkAi2J/DS\nvZwsUahwD34CPGB0KZVtWxNDxQJMcJtjx8N8r7mDhCCOZTCIDIAH2zVmL27o\nglf/8xZEBsWBb8OY4R6BnABqf9Hdb8I1DA+4k77Z6GDKTTSIbRfyyrovFaBN\nGpyz1KPRyr4M3raAWKOSzdy+grYq5IOEe7zkF9ajLN+alvSAZp2mrMDC43HH\nGOa26+tklx+DuW1hcGE52vYDtZhFRko/s6ktcDsS8X71oeAfKnVNUWGhc5ix\nAO68saUbYXevKZMWZ2/xKccbTmOaQ4y8HiSLy8tfmp2zjfKS2BVW3m+zBQ+8\nC1PZPR6Kcv/eKuzIlBVLKnfNADlVJ1OruC4NlMxf1+zyuw/zhr49TPKtg/OV\nOHxA\r\n=oYeF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB3Oqh5Cce9OgvNjaNvyosCehFk2tzTmRe6ZVsnuFK10AiEAmIxbA8gUqFuOlDcQYJ2kzaqElIkw5/eC2OUYHbdJRqA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.2b8d2644_1543150836586_0.6109684329639389"},"_hasShrinkwrap":false},"0.15.0-alpha.9d544cd8":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.9d544cd8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.9d544cd8","dist":{"shasum":"7b9ffa4045e6cebc976962d263f69b1d01c69548","integrity":"sha512-2TzaieJ0n9omWmVavIdXwA2kKUzUq2UBrh7w/KWvGpUO81/b9tw5ql7r1q9vQzFb0Gov1Oc+bj68WK70g2Tbhg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.9d544cd8.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+p3uCRA9TVsSAnZWagAAxkEQAJ2FL3ijyaweuwm1UQeO\n4syKvu7DE/dEzCsfGogdoQFeYVBLYNPfUaqw0DkyqModscT8rrpYMSIHVyPp\nyXC/Wa7hKYmKZAqiAfsKeApdCy9JO4AqsNCZ6Brmv290rgduPmaVGxxy3+jj\nBouLdZPb3ONupc3p3MZD9s8dUKcNCVOuy942gg1a5YZm/99URNvDJHfXKqcj\nOBS25/rwK+69N10wyVkeumeb75fV1GqXY94gy+BsEIaIXGPvov7o4tvqvBSq\nkVtRqCDson2BvpK4OmeduXzLHoucCHRc9N71XdWCe2/R/Es4TlQlxqJp135v\nBDTTyJuVjof1wNvpxCEgqPU59h2LtnSkAatnbCCNLfVj92peCSqL1twGidsq\nETod43hdZQsO+x6DyZMzoQNrNX6G+IfU19Tymw74uazjtVOks9q6sTAqKrwV\nPrGRIi2+YX/y5vJp4JIXgOcAi7ljCnfa5Af7APHuaRJ9WB6fvqqWH/IKNpit\nedHpx75A2JCQk5pNf+EuCBHECMOFJc4H4GWDN29ltblAmUqs5Sp79Je/Tfi0\nnHO7ebiu6q9iSNejk1ZMv56vgh1H8/81naqpd08gqnVumy9Sy6nO3EJI8dvg\nRnoBSKDNyCBgkgNjOlYnntyLivKHC6pAP1d7x2n4298s2W4Pvt9OjbMleyZH\n+fz5\r\n=CxsJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDk5M/14vMKTk4Y1YSn2teEe8nwb4LFZO05nnCMKsI0wwIgD031f381XKWFylw11slctH8ZmpK6SgEPB9K0ZUswprs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.9d544cd8_1543151085857_0.690605928406183"},"_hasShrinkwrap":false},"0.15.0-alpha.a7ec32b1":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.a7ec32b1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.a7ec32b1","dist":{"shasum":"d5ed68af6f0fa2110618c1f47ad63d235abc9f5b","integrity":"sha512-9rsAa9/aP5jAZ5hK3X1qqu4UwLbrhc2yFl+a9iSSgStx5o02DDwtlVPK8BARL5SmiAlxxlt88mmT7IebBohUMw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.a7ec32b1.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+p6uCRA9TVsSAnZWagAAxUEP/jLVW9CyInuLocGEvHwr\nf2bXeFg2R7rdQdZnz7ZYybIjjTmSb0nZDMG11qn+YU4OUVnlE4PYeUtah+xO\nkOpI2bunWachoDu03bzDtBeoiaD6jwbt6wkQ68zUQIZi6WZzSWH5/lvNS/2u\nsWRqApv+cS+rlATwzHkjdgtj99Rztj1+zH7xJaJnkSYLW+EqX1v00WbT11j0\nq/MDZSHh9vHSwsOFm9gdax9kx4SNt8OcsADJaG0EUYBGXZDn2FbSvYVNgfRb\nU8nIktDs3WFpvxz7cPqU0T0++e6sFtRouUaEMTQ95WcY93Thy0EnD53nZ88l\n/N+BzkC17CfBRv4kb2WaD6a5FV6tqrcPbCD+thkw+kXQEz2yHmMmrCCy3WwB\n5MyAvYO8gnplG+TrDNMU4kZ6g/HdHiftLEtT+OtlL0dms4Jz1s9g7WLwYGIt\nTzE8QO3mHNJ3fdbW2ga0VZZZez5GPH61aPX711s/+M8dG8kUmIquJZkk0vEr\nwWJ1y4eKjM7zSeSpb4miXqeC10a6A3uWtjdikN9vwIYyAmZSJJ6wSzqmYj66\nanhYHCP6BmdaWVEXjwU9mBuTHadUCVoe/4SLRdjuY+SoH5/QweQzTpl1N9Ee\nNse5sT9JE3fWrzyT6ZCpH+rZItJxABftaSe/BV4950Yaws3nhv1eb3IryYsm\net3G\r\n=TIqF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHFIAzvXV23Y5+RIxDCHjB9y6OZIm1SIpKEC0sdROrbqAiBdr0TWAPZ8O+1WsGzmX17GG7SGJOkaS+5U0VE7Lh3OaQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.a7ec32b1_1543151277292_0.5338828884003715"},"_hasShrinkwrap":false},"0.15.0-alpha.1a4d378a":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.1a4d378a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.1a4d378a","dist":{"shasum":"bba5502df740df162ff6830a0e63bccee9077b8d","integrity":"sha512-8G9F401GxvVY5TYYcimaO4eSoWleuxjKpNL3IzYHGe/ylXhAfd/kby6vDboB/wDrtCZqErO80q48DZWtMGAYDw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.1a4d378a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+wrjCRA9TVsSAnZWagAAETYP/RUT8zQx2NethijpICER\nifGzBVCTT8Vu/jNicDe7VblxRWb5ErMv2FS+uBf1LtjfvtNiQd2sCjcUBnhM\n2PFsl1Erti4VKGX45FuFErdNrIH6vKi5NEqLd5QgY676R0i4Ll7h2ovlcO43\nZlUr6jEpS04uhbSamp0vVItjgLweZL5HM/k5KT2RwezSu+Goxl8JZHQ2+rPH\nE4pyswaKgNK6clwCp82kKfbIVqS7QlZTDT8jSQBfxciOoyOwQpEiJowEh51S\nLWLegOjNJfD6p6aYZDucLT3HWnHaoubj/Usucf+oeIvPu1jM4pPAbFF0xLyE\nCQ62Nq3Veum4GGOWNcFRwvcqOmJ3UMbqlVPIQRjk1Oo5g6lf9vqdXa95dBUg\nagtbzRnB6/Rs7AMiWjY1XYxXusT3eArf6CW3/ejG8+D09To0Z59GzJ5TCprH\ntxM/vwDk0IUyAK4YH1Y6W2si2MnkbpyL386j62AhOxpOh8kag89dKJnToQgn\n/7aQVXuyQ8ZfqRPAYvD2ycdVmSOhpwP3rL+hgwFbkhoD48fL4rD4Hg1m4P5L\nGPAje1DzEhHegTkAOsmIDqhMuAEvDRWQfYldGGoW4DJQWhjyd5hqILE6d4sG\n0K9zNoBti4g8BRfoYF8yQQKv7WnEwpJe8NNLDTY9UII1lM/+F6Z3lLcwIwUg\nb+fH\r\n=NJtO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCs1fm1Bq+MYRWutEO9rvP+1nb0nohBtke9RuS93TMX7gIhAJcAUigURBPg5M7bfAHw0+ECH4656BybXskIl41Q70hA"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.1a4d378a_1543178978926_0.24507833065888218"},"_hasShrinkwrap":false},"0.15.0-alpha.fd91dc6d":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.fd91dc6d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.fd91dc6d","dist":{"shasum":"051c1d16cd442ae6c6efa4931ea354a77b1f01d5","integrity":"sha512-+barap3tw2dTcZgIfP56onfLkjams9Nqg+4FCk7ooU6931YqmgClMi9HWgKoSI8iAZB1L5Z0edkoPCHRqzXSog==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.fd91dc6d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+6bECRA9TVsSAnZWagAACsMP/093tJ+HzD18LE+vGSuk\nU2pxREdRXh/k9TwtB3/5HggftdoMilD2VODHr2EqpKh/BreE8locS7dApce+\nVEPLaE0+pSC8PaRqr8vfRXtwxK0Zdtkr7vddPAlGwPJHY8MGpRpHxieuqVPu\nrzu8m+NlEHnI0Ibss0fzbJIzxev8Arisibw6ai5NzC2qoRPnS6VhXEMqZiF9\n1W7xEAV2qNfZWgVpNnWGp8Kxtz4AC9uyUrvmMjmP+l33PM4ssG1EkKhWpTZX\n2CNqmfJFrKMrHbZQo7sKgkt+TwSRYCZZbIj9bcLrfmLAp060IjBYnHHkI81b\nU0qRuDBbd1Dhk2OcmH+/HAZZgJcM3aRQYPYSOW1FBGe1Nc7/lg8cOT8uZMmi\ngjXQwgTX3CbZU7PXQHj4X8HObu605WbCNsSEVPTN0/aoyFFnEYk9KaNe7iL0\nlOuiYHG7NFCVR0yLmMFsRt6mRFc+R0/GdfwXkQ72boPebW5HILF1aoIA67BT\n/QO5KU8RzRP6e1qaabEhpWfb8RCEntFDsVJWunn3UwjcFNemn5E/+74iymNC\nDB02C5gm3tBEzBpGVFHmcXy2dsTYD0xf2a/TmwPM16NP4gHNf5CgkjJsLQyW\nIgemx4iUoX2LtPH98I7RgAnuotFfi9K4rXvgX/opNS8psEaf5wnmfezC8fzO\ndRPw\r\n=TeUO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBoTqT6qr65y504A3aQ3yBqX06YVagAIQgK2rlsQ10qGAiBw/JTIUH3+x6yKrPJy2zsI5RwIGmovZ5+prL8K5IeYSQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.fd91dc6d_1543218884111_0.20112277813266344"},"_hasShrinkwrap":false},"0.15.0-alpha.67cbcb66":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.67cbcb66","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.67cbcb66","dist":{"shasum":"12c3b479b33ac2b286931ec5b64a62fc5952caf6","integrity":"sha512-6Naz27TcWOurk6Vts6QJus9pQy75r8yqwCn+5q2dX9yRnXjPmodGeGfXaXTBvo35T/7CpoYrsJYfQ86lwkD4iA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.67cbcb66.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+8imCRA9TVsSAnZWagAAbJoP/jY8wnJSk8IysPGJF9Me\nnvqq2Ok7u6or8gt8IRIQa5Osys3E0z3GKUfJh/TwiP43p6JuAdfY9al6DCnc\nyE2cdeOO+PVXq05y6m4cpMBs6vlOU76IkmE0t3RysKop/Cl0qU4JpmcoPK33\nVEIAxQwM6i/Ivl2jTjx88H7PQgUXBZvJdL6oAtEealp2VgnDYvHQEpf02SJ1\nXtRTJBgP+l6wgNcOjJ7LKeUJmbdhSZHjN7675BK1kekgxD6b3s82rhj4QSKW\n4wbhaS+dmAYcrOFiJbXLG7w7y2q9/F1XYISIDYL5u5uPJw2dJXF7+tu3zN1C\nQQVY8tiqzwgqgX95SYYNQmyIHN7fe3Q5BvOQ1Jvfu1GIsUPAKsaVF0tBKqk6\nIAeQPTEDnal2t4ZQRTuxVLgPyw/aIhainA4G6VIkyzrQ4WcLE78clOw3aJOK\nOSjNAOKOEwN+SkFmzLZf2ckJ7ZPHcmhE99600TYMc2KowH65C05a7U6Sswm6\nMBQPFBxCRm4n0IKkiqOmBhymhCFV2y6BpdSuGyBKN1sv75IBu1U//TRtGlom\n+jQzEEQZQsZg234B0Df2oWDS52a995MBtForCWlzENHg/SiYIT/cHaqIHc0M\n24UhGfYli/EouN2oOp5Eqk2em58wXN8wB+iAyQllvoDASp1uHWfG1yhmG9DH\npiSS\r\n=lZa8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGeZOQk2GfgNHe9ukz++3IpZ86+KoQ9p8MdPtqP4OhybAiAJ9HMSt2SjPK7o18n8rlj8KriVL8R7FSzeIwZGC80EzA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.67cbcb66_1543227557643_0.3915479535728945"},"_hasShrinkwrap":false},"0.15.0-alpha.3a3a42b9":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.3a3a42b9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.3a3a42b9","dist":{"shasum":"f11883b2b067f395afc0f8d0aa6b34c11c565602","integrity":"sha512-yO37X+I74eX+iPujWthp5DxU0uQy8mgNdIA6MKAjSutejAB/h4sICRSa9/24xyYj+kjervi+Hf2Ds+jURDmyYg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.3a3a42b9.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+8pACRA9TVsSAnZWagAA4EQP/30MRIMWrFhkQWjj3BRf\ntKDvl50XLj8ZLRZMuw8I8BFmCvd8q73hpbPv+SjNE7v7ijzjYNGu/TQSw2ik\ns9LlmOqczIfnolux0yRI33ppqR0tU+AaiskbhTpjg2Gsy3IEgY9ObIjj0B4P\nXX96ozp7eTwO6QBYUQppsa0QcYKtyxSWF3/Un8mUYNn/S7M/nr1tGmvGAwyd\nJilkB6N2MwATqUhfthmzwAHAAu4s4o8vf/xVPWrWfHktHLFsfijn7x9BtFjt\nqvXqhMTEXeDiGI7vzj/vhjgjoK8kzvh6v0xUWjtW0XJI3A06CIUXpB0/cCMU\nYdt3QRBAfTfRsBwD9KV+Bg4SJJ9/8altLnngzooywuXypZWM2RAOEQ12emIf\nCWE3IKFZJdpFhCLX0iuYJhciNcW6k0TZb5x22SIeFMS8Y4Ri6eteaiZNMyK9\nEa5fLwBHPG8yczaPs066c/scl/ON00Q6tHNXBMGyYJoeKuGbtkNMNKRqMHzT\nLVEZ75pky8oGFk9/6REnhGyZypgod1cnK/4/aDlFq/gMuyRwds+03/ebtK78\n7RWPuX08Ho2z5WqQQf4ZXbGQiB9AaWQGaTrehQ8MTjI135pvPyWotpwAO6Ux\nq3ZTv4T9U89uXkK2j3S/2GmnzZFa/g6OgQd53vW1bqgrh6v+1yDf5IbQOZVd\ntwg3\r\n=FXn5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGZKKoKmVPmDEF7+DeycDztOyL6TYY+q5DgWN+1D0dfpAiBQNifscU/g2ciccFtrtO4CK0N5fT4hUcgKTurMzUxwzw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.3a3a42b9_1543227967219_0.2232902848778302"},"_hasShrinkwrap":false},"0.15.0-alpha.53082053":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.53082053","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.53082053","dist":{"shasum":"ee806a594818e04b3c1129a7828da3b8488b61aa","integrity":"sha512-i3djJCAdLGsoT/u4ztOe6XaeXYPD9YFAytW+RbKkpn4w3ujjTNf1F2bsmzRoOwT4qoYMe4M97DxiKuhG1vl1PA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.53082053.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+8xwCRA9TVsSAnZWagAADQ0P/R/K80SEoWFUTMHwkVpw\nmZlAUJb/gd+TAeirjYCPKCNJ3Qb5z6P/GHFFSQX6uyrJnlc5IiK6U1nmSAdu\nTbnnNvligLulult63mUIffYC10J+FpdFpkV4/2dbP5p6GyXphXFv1KWbkKWp\nR61oPsVUOOfpZtPQnEfvnz2fWT/+gjiFoBcHMicarLE/WHqhgtdSMfISrOu0\nZDi9/NGMxwhBiHPRVkyuekQTiyUR1Rl9urPuC4LM5GtXTTTTN6jWqC8ZKRzQ\n2BrYK2Hez/MoYXiDMPL7GlN12umVvbkZDjM0gjwpthrk39p5pr0zaKRtybQf\nEEkBHyO6isCzO5a8/9AsXiwZ176uBLw6mHE/x4lWZf/NLZ8qWI6+tRwa9c9F\n+5nit8xVLz6GwkHxHaZBkDL9asQ/N+qH8q+UyfX5WgCxDek7u9YgOSKABBfd\nAZObpweO0WHc6TSe9XlMcoih2snL/JBgsHzne4Oi/WaGoUKF5sRkfQSNi3tV\nyhVWbwKXYTHBm4fZsu5SGJCkVXIQZFg0h1h8gnQ9QqwzvEz3uYZm1NDYXsSo\n0+lhjKfFNoLTkx8U6wcEdhvObJ7ivmh2Ex4Csz/g09ZaZKQZ8e+6Fo9XtJ/Q\ngB7QtZD4d2mlvOUPhtEUjyFMv2PQDXj+n4R5oAN2QWBA0kfgY71Oa9hMtoxL\nqFEb\r\n=YUiv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDomfFmfjxTJ69q3jq43myb/n5sf42xLl2VczBel6AmAwIhAIML9NWGWFj+oD31bIeCFvRYcSQaH/J1yp0ToWOnvU/l"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.53082053_1543228527840_0.7971452077118912"},"_hasShrinkwrap":false},"0.15.0-alpha.2dd65362":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.2dd65362","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.2dd65362","dist":{"shasum":"20077b15670a5365716ca1a01b7440da27dc4c7a","integrity":"sha512-LIoeQT2xFu0piwmpAwb0n8gq+hiHfkA1VNnr+LtzwN3oa7Q5H6+UbvC/Trxzbx5E6CoQeuLcVbp9tlgZSCnhRg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.2dd65362.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+803CRA9TVsSAnZWagAAviYP/3KN3zdVtzxX8WyKo1IB\nTvFWlsPnxuAJUx4E0doxF5HMqbeg9mIahA1+2F9OWWsWWqWItToXRqh1egiA\nHnwm1DwWKOQ+kGtIDmBAKfP3dIq3daSWAKV5aK33mCc+1wqTmDVoBMhJUENs\ni02xfzHZtx3CpCCcNGZQiBqo2zRwKxM6EVjVPKFbiRzL3Vq77aT3DfO1mDWW\n1a9FTuSVO+HNkp3gZYmQdu3Vrf4ib0PaTTa0LIj84n18uqcPh9k1HPTlLNMe\nggTPk3vuS4aLGt3AES6/tlpnVw7fy4FAt0UTtzV6ro9WuzbsAyHVM/KRmSdz\nRF55XPCJ4nfXbfO6FSkNMlv/NGYQOutq3ubLQPRvjdVWhuYOF1fr7I+MI9mA\nIaeQgJsibhQO+y5WUus8fNxRXNOJJgCRJb5USoPgGUa/seJAollhzOCy7zB+\n3v1PKZ9Wpft2Jzmjgn/KQ47AHWUU940Rs8mfknOWFj/tuv0mUxdpOPAwbFbF\n/8KgJBJzXpGyeUytY5FyWbfaaU2GECNrrVtlBRWhryBFTIUDnmk8HTIYzVpb\nUW0+k0EtX53OO5FvToJUMb1QfwrvMdxVXr+WA1izuXjD9R2Ud7Jetj7UNQuE\nTWAxLRjmWyH/jdHGZlS8qs6nbc3Gk23vkijO7Pi+M2mZVeHt28uFRhLIJVrF\nnA7q\r\n=9uGg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICcYqK5lEw+RSNpUyLg/C/Pp4c5vbTudGzosKMGh5D2bAiA+Ij4h1Gj+yzX1VhEMAsJexLThuXHOOSqdHu2TtMNxpg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.2dd65362_1543228726495_0.36330173711303426"},"_hasShrinkwrap":false},"0.14.3":{"name":"codegen-templates-scripts","version":"0.14.3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.14.3","dist":{"shasum":"53377c04892b4cf6146e61cc6f96b871f9290ff2","integrity":"sha512-c/l7pvgs/cUhnqGNQx3JJug8srXy3Y3HCb+cUaR6e/uvBuInWqa0KmPEW66HXk4BZmSGzGfYqazi5dALRLUXBw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.3.tgz","fileCount":22,"unpackedSize":16711,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+9ELCRA9TVsSAnZWagAA/T4P/3VWkXXou4F8aKjeorIh\n3cIvRfaGqkjH2aHPM/UDO9gOsfr+ej5SmSQgWEdbccl+Fmy1nUJcdSN1pEEM\n9SUqIOG7AsTrSTNuTPp9rCuBKuRXsDBhObzKLcuaKcoTxDN/9mtJOk3F/TK8\npEzJeJqEkkbey+bJoY7NEzm4256T91eFKBelmAsoOFPAY2pXjQS6jfU/SxPJ\nWVW8FmpSe6tw6yLVTtsf65/TQWhjA+eL+8W6eeWo9IQnIsj/pwGuVNyzWDVl\nZyWUYQvLpzacHr8WiqhKYjTJVpFdgc2CcGrnww5BqTayMPuMwNIrrLnu8XuT\nVx3igUSYdwd33ovXCWil3/lXP0WGGg4ubCHGeXUrhRWVBAoulkCCrEf1LDf2\nH6OBn06E0adUJeiGOGrjPWrI34PVpxM0xJ8HtatwQTyE4Tf9PDrpgmqNVbw0\nfKPhB/VgtrtRcUuae5r2QCIAp1/Knj8tNJ4HamHeOzFUv7BPiUpsLiH17Uxe\njMHHYhZUu2qzfB55MU2o3o4aB/mL+rryv9Uu/Ehr4wXMLnWiWWEoki0dR0fQ\nJ+4GbKCClJ5XWTSmOgF+TyNI2vMT2bUleF06RwZHfbkapt1IZgiHpAbktoLd\n3SDRlmdRXGJixNaMgs40nF04vvl2ZwZMvNXvAkCQSKhFTGPd/hfU6n7p97U6\nuOjX\r\n=OJN4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE8RWGUTEx/8cwIQzggM4btOAox4hEtzfptstPnI9enaAiEAifJTEvF7vQ07d4eE1xu1u2dYjROci44lD7e/7TAP45M="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"kamilkisiela","email":"kamil.kisiela@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.3_1543229707281_0.5703711225621204"},"_hasShrinkwrap":false},"0.15.0-alpha.ffa95f83":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.ffa95f83","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.ffa95f83","dist":{"shasum":"6d7efc70e30082fed934b06dc73c1bf40a9ba517","integrity":"sha512-2gW2uTHzGQW/8hKqziXGc2ytalTnnurrB7JFe2f7cEEFe3MMGTsiN9oRZN0yZ6I7kZKcRQVDLYuNESYnXj4cdw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.ffa95f83.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+9bYCRA9TVsSAnZWagAAODcP/32Jh08qJUYzvjc/k7e6\nYShvlApJH00n3Qrxw1Sz16Am5N4dF97ssbjDPvbm8X+0i36u9QOm+/twNpaC\n2miBjUGg3T5N7TGQcR7aTImVq8Alh/93URSR4qN1TL4bTpVyX3FH5LV1Hhfc\nBqoQdWpQ8i+PSQHT790Ua6mbjp59xeAHJGOFIpXvwhhBgs4lcjCXKH2iGS/Z\njJY6YHXZyAB/P+QtaYDNMx4EmJya63LDSblIPyLbsYk25uf6UUmGlCQ/GW4N\nad7FUTBD07dzEcLcwJN9yO3JVuMUFjO108t13yusqKinAeOSl6In68dbl+2D\nWN/By6k+lIDA+8PmtiqwFjGrWVylD/s3Wqn0ezdTGcK1MZiDetth5riqRVLy\n/VlbbvxKwbZTtmY5KJzsNl/F0k5RL7MKWNmnrJfiEVAPuJLTEvf3EMkKLYs2\n0veqdkqfXPh3fN6OhGzROxDRJ2rPzWD8MLdG2x9vWL+L9K25Vwxa6njByXNd\nppjlBV9+zpuHf1hpujo+CDpNDa60yWhsPHYYxg5naq//2DfHFOqhPvjIT1qx\nMOcVUYmSBG1DzzZdS9NKcXRcQCgQxAjrtdlYQCaUjyFalpyf5H1gvee4ZBg0\nLnSoyGb90ydbuuYl4vZadUVYE9ZhfprLIVl6B/V9PSGApgAMK2qlyGERiJgr\nsUnE\r\n=7cJs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDFSXUbIkW6LIAfII4o6XL5sFVMr6S+mECD/hUPkUelbAiBONFub7VVfP4V28R0OAO0nizqjoom8hIGaDQjKJyXUXw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.ffa95f83_1543231192188_0.9946812804510334"},"_hasShrinkwrap":false},"0.15.0-alpha.38024d43":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.38024d43","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.38024d43","dist":{"shasum":"d2df10351c7b7ee06d7bb4058ca6064e6fad74ff","integrity":"sha512-0DlQXEYDZPifMolK8T8NWdFiLegu78VmRZYl2oVtXD/mGZSu6CBkiZeXcF5ioE1CQayFRA7Q9uvjcqcbAEtq+Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.38024d43.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/BYcCRA9TVsSAnZWagAAUvsQAJPRwHiNUq2D1S3MpgaB\nUsmdj9GviCLfVfwOpECb/oENNkoZAe+NG2h17yy6IsoukgP/sjHCxMVkznnS\ntlD38HZWZexv33AdiqLjApQS0yXpHNLPW84YJejUJD6BCNCKdUNn7AGpGpxy\nnWZs1YdkNKVO08clhvwwI9jpKrmtzw4zbDBwiMrlGjy55jLWw1CsHDcrpqLL\n6XnmqaX4+MIUd+QBkOsWYjlPj598M4NsTDr8BpBPoowIez9pEKlkpkAENVUc\nVndqa22w77LIJRn4f7DVRJWmVXsiVsmp9ESrIcfxatLJe8Iz0UAgZiCNy1Vb\nUJSmIf8gd5LUq/tWxTe9NoQmXjFnIfQ9Y3t8sFohyfBNayzll/Il1D3arpgM\nGv7OT9d5mXhM+FuvI5LYiSC3U54mt9p4lVnf5RscutsPHr0IVk7w0yuEH+Nf\nzANONVXCKXqewO2zceA+dJEA+EL8Q6zl0BUR9wpNs6FkCbJdqb4VcgQ/dKij\n/REyGXVuRFrZi8RoayQK5Wzenwhpfj5dzVwdsqyj/l3ZkFh6r/76vtwFI1NC\n8McmML5yRAPeYv0tPFas1AAT3yF/TpAsY2ObW8D+OhO0kbiPaqm9K/VrTpIH\ncHJNw13AUtXJ8nZ1yrcpQTsX9rOHFiK09ztNO21kgKwn/7SfWTcaw+rVy/rH\ngY3Z\r\n=THdZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrvwSokcSLMavQipTmEvI7k5BbNYzdOfZlghzMTEfuJQIhAP2cmLvIA387HYT/CRnwCFi9z2R0zDWxEUkSkUpTixPB"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.38024d43_1543247388150_0.8352372999993203"},"_hasShrinkwrap":false},"0.15.0-alpha.7df98bdf":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.7df98bdf","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.7df98bdf","dist":{"shasum":"3d8f199f569f9626d7c454d3573cb19b3aa1ccd8","integrity":"sha512-3m/Lk4Z1QYN3Vh1K0MKSiRIhj1u2jHSv6gH5ZVnUg0X1nLueuURXmmaOFbEQoYOZN3CZ7PSa9ta+BGjqTJW2OQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.7df98bdf.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/BepCRA9TVsSAnZWagAAG+AP/1dToMtGsEP6n7LTZkiW\nn0xcDfpN9n1sPHncQbSR1vzBhuuQba+Wfo5ni+312EvODC6W/XwEeGz9wfAj\n+gXWfTwC4rHyWj1hRNsXKWAOY8O3ftIFJsWVjxwnb0+Uk/+VI4V9EiWkCdMi\nXpAJ3MzDu1jq8zWf5poYKMBZQbNFokVrntVHsT0ghDaWNugFhi9RyrrvYgNJ\nQ1/hrVgoN5yrKDcn+/IM6UMa8p9ZECMyhLftMrCOUjIFo84H7xpJCGkZEBbp\npKvic+YRAcQN6cbg1yaSsSkl/9xOm0ZeyrQ9NXmwBJjY2s/yrMgX7wAotZdC\n2RehaTWChpVKXEbd1buL5NLOkWFSd/zQ94QnOSFA8XX1XvM22i3uDwL67P6k\nhcDgGDXBttEdNnGWzQl3/5m/qE4Mzwwaad5tDeH/tS55j+RByTHsfdprIljW\nnsFex3XfLaAbzLj90oA3qe/kG29vcv1srFLo0uxEgDEPjcIuWKenUT77PPQx\nilEk+sUGIEIkuAJZB6nVe/PlpR9Lj6eqq075ip0wckEjVPrYQD9D6bCl1Kvu\nXiq7SVUVDoMAszGKiqyFV1KvIQUzkBLLp+UHrLzLjWnbsrBtfQohMhiF/Lq/\nigi2NnBKKsOnsCGCUh7NF0HykZVt8rguIW9aPHrwtKSw/Um3scUPTYh6zGIj\n9btY\r\n=Nps1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHw6cqKo26Qn1cNvL9ZMxytn1ryjed2Oj9Lh7RSrP/VyAiEA3S3hNfQ4aL6W435e0Ntt3LoDlRUihNF+15P67d2BeEM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.7df98bdf_1543247784927_0.07635927095026496"},"_hasShrinkwrap":false},"0.15.0-alpha.f8615088":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.f8615088","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.f8615088","dist":{"shasum":"849600e8f0a5e6c28d3db50e53c53c2014f3bac6","integrity":"sha512-FUv91a/ygCz/re81uUoG7IvQq4ZDdeiTAXgPbKWiPoqQZlMLUbe6Nnlz/EX1ImTVsiK4sLZ2gjuiY19CqsEghQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.f8615088.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/CKNCRA9TVsSAnZWagAAi6MQAJtMjuA2CLgdNiwhLByS\n31eYMfqCDlqA/eZfYVhZD4OAOVfyCulYQMG3QIeANQ+R81ywkkGM8BGTEXhM\naLDdaEGCr5ezPo/4EH2jHaahq5ciY8sKfn71AvemjV/9n144JayL3KHPWdVA\nrWAUeYJ1we2C2MSrz4LsYl5H6StEad7cXW3qlhrtjnk/UhEid/OPk7X8xrhZ\niIALzDihrdJZyx6E/5HQtD7hphI1MVw0yNaBg/fH5aBn+LiejC9uwr73W6bW\nSIhVrEV4nq/eK+ZwM3A7YbRPeN3Y4omg6bYGwJACuZ1F0Niq0l/Ess7iKM0Q\n1EQUMXgtt29xroPcAYwDTbQScLXSWn2vjRHxidJLklOUmmtVyU1+Xm09wji4\nozwOg38OE1mW4D8/72dvssz6piTVwhxMsuU4U5zTd0k6BnZtu0Ys0/IC+iq7\n+A0PmtqvXAyOJqaxw+7AE1NItB+X3qIvdUTy1LMoX085dVRXC9jDDbT09nPv\noIbZ+fljAoOAOIwIDdl1djMlbwIGTTagP5SdkCvtx6WypKizS6o4wd/bo9ny\nmD40FB/HyuSVC8UfAoehhuPajoTPRdoqbyGI3AW7YFfJ7friBOQbJuCCHO65\nkXrxslzIJltjbX8vIqxpNSDc3ahi7Qf4Bb9LOFtLkQL6a+to/gqEem9UDxVF\nwbG+\r\n=9ko8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDif/UXll0H4YFTaYHZAqWg7KqoF6p4eVWxTyehzFMuIAiEA0e1iByoRklO1e8si75+06pGTNoQjB1enxmlH40sLzpM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.f8615088_1543250572766_0.9247828061565948"},"_hasShrinkwrap":false},"0.15.0-alpha.c07f6dcf":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.c07f6dcf","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.c07f6dcf","dist":{"shasum":"60b0ba16addb36f578d81f2c5358563f6be319ea","integrity":"sha512-F5MlpX6mRIFnA9fpc52FVv8mUIDoPeB38Fls8SK1suQpIhdaZCDz1g9nSwTEhZYDqXWlO/fKp8tM1ZnSXu23vA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.c07f6dcf.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/E8RCRA9TVsSAnZWagAA338P/0F0gP5LMy69yBDooF95\nKe9YDAzIcwdGKzbVq3syJrwTyKEE4xXkKcgY7g4GVrU/l8AoxXEW+2wgF8dj\nePDkReDpJ41k7txTIaiPMGRm/oQ/rhkPzWkXy8wF5Dhqe08mf5i3vwZ0Cds0\nClgK5jxrfZ17t5Fb2B0qhdt9DACesfQjHUEKee+gVPTtojK0aQdZ31XnZ7Qq\na8eBSxYJV7YTN9km3PO1+Q9td1ileWlHuWhjJFUT+ivQbTrPJW+Eo0mbXGYb\n9AMPpheDzoVI1P8Ce3x6lgx0FwxLwqA5cl44E42ghcA+x7DqteA6QfKRGDCC\nCGeB/RIFCs8s4X3mJiAvzDr/2KRObXlLniM3QAoCvXkOHBe/qW2aGWUYuGHo\niqgbH/s3LuWX3U2PKA2tNfDovoUGzPMqDf6P/ocV8v3pwDHuntwwD8HIdzPk\nP2lXfjoZ7v5Ic5GR7qbCt1NDKrTEu3hpt6R56sCRSBOna0Yo0nM6O7MmyE5g\nu8vW1Cb0uXFOln93htwINEOTKh64nz7KmhwaDBJy2puLkLJxbZuCPUJkwonp\nAIawdUwWbVLVCUuyiRuEJJBmVR4AOuZGmHqLD2p9NnWPgBEKJJ6Tgm8jMj6V\nlMhraRFsh6NkviWuXaNwWlhPweRBSCBeDUSrfo2sOjvtzPnMoUbNubOSJfAO\nAdRF\r\n=+JhG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAT6cEFHaJVW2Olp5PXITTimHX3odOzPw8ABmS9ovHqlAiEAxdTgtpYUyzKICxDQgdXU3v6zzrayBxW4VHlc4CM2rbU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.c07f6dcf_1543261969037_0.29435079653139895"},"_hasShrinkwrap":false},"0.15.0-alpha.cee9bb62":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.cee9bb62","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.cee9bb62","dist":{"shasum":"69f0b6ded5f85fbcc7d974ebb8b02e93e7055e29","integrity":"sha512-BvQknVfVagWsohnbjkQl7bh0fafzMa60JK+P/cKDBnr33e+njiaVXGPK4sIhdw1HbOUmNBZp4zEmmS0idDx46Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.cee9bb62.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/HmZCRA9TVsSAnZWagAAYvcP/3JJ5yWDrozncqqo2BBH\nSPEXpStPjrtfEirHFY54I30107cDslXi8Uvq/tYUBzFcgyanpx2VWLrC10xw\njN2Lrlp5efoLMZZ83KKkrtG4Hd465qQEpwJLGshfUvMnZeItSzP6FWHR+vU9\nlM0AUSAPSYf6tdGdxoBEVGHuZtY4wra1JVTFvAj5E4nXThtZQzclTfw1/XVp\nqsFSmUdEyXFD0J5YW1Yrq6DpSVkaqRf50sC1u43MBWikhlJCr8cAP4HWVfdS\nTTnPpCL7ibeT0NvQNtdPLjz3ZhuknVzJsbZkTD3/9nikx0wENVJ6IfyrWnrG\nRdznHJoxGpfDQcxD504hbyZ/EFNJN1xDLzYqv1KJ5zC6tuYACC2zPeFHsugI\nei/qUfeDkzzeDDtRpcBCzfgKiMBUvlgkCTudsjzyXy0HbUbgzH0/OaAdc6er\nB1sEnEgY9o8NpjKtZcoTxUbPJFyu+eWqEialjJJsCHhUcVr6jPuZDkokBZKW\nuQhegzUtrAiOg/ZTyqMtbE1ffT3dSdGYVBeIT7mw8QElpeIisq0dTZX0PRO/\n85YlDx6Kp29i5P7NpvOzPGDOuWwTElZ+JsUL/6XIgPnbFNvPBlr5LUltlEi3\nY7mum3orV7EfMlZdB7lE2iVbEZoYvzx/fbnv6xtQ+OthbRzP3ozIstE27Q2Z\nufFt\r\n=Dn8U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBnhdBz+23OO02pDiDYc/eqCLbKoxmjKTNhrZ2k77HBgAiAXAHSXAQuSprsOf7nS4reogUR/dl884UJB1rUXsBy4/w=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.cee9bb62_1543272856442_0.15820555582473084"},"_hasShrinkwrap":false},"0.15.0-alpha.f9babcec":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.f9babcec","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.f9babcec","dist":{"shasum":"0c3519f3ddbdc952a815ef6abeed1914c31599da","integrity":"sha512-PhcOqzz2y1XuqqWIN0iBHQbfXxRpQudCk3zmVZ/BlZZN6ZWVciUMJTA1ujXVM/f7pXP8lbqT4N3fQW5Ng7a4Xw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.f9babcec.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/H9nCRA9TVsSAnZWagAAWFIQAIdofTO+F8k68TrQVmPc\na19z1OIZLH6fRXkrnS8CDEsizgqO0pGv0sBGwRIr73zO1GnhuqmYd6Ra9SAo\n90sv0MP0cAh2V4wb6VJ1cB5Hf5++VKPOKaQ6AAQzhJbbnQ1xIGCcHLGS+Wiy\no8BMhtWZFwXDlcDWxIDZl823wW/eJZwXMySEI2mCvZ6ny9MJWutragcwe4tP\nK8Lk4vtcU4eki/kZa2BpnYn53zfvaYfi+++sC0SjLXWNVZFkfoAovDyAeBf3\n/HNARRu/SQ1N8xi28m0Hmud2NLjL2X8xEtmpEl60EuQWqgpSz9Liv4n3O5a8\nVgO8OYT12tzDR9vmxphBMjZbiiH18OLjiPdlRPbCSyzQL0sLYgBHWyOHUdBP\n9yuFmq0ttw1byWehQ6JkRPrctd3SgXY57KIXIbIOae1nhR8zhMakZGV3VHCx\nOuWtdEt/tBbaOh+ATw3iGRdcyXu6RrgQf+r5V5nJSweW8tKb/iRsjrQ6WvEg\nNRk1/VthtmNb/8W8wk59Ee8B9mBJJgOVa6mgNishqFz5OgXRktVZuboGjQfi\nlk+qyUTnD82/6CS65q2obF6LEebD67Qw7tpETm34ZscVd6ULEgYuMuhZiS64\nayAxlt4uxbKqDDkX7NiowmrNTqs1N5naXZU2HNvqqiLFHsvnntXC5S7oqx8s\nz9Vb\r\n=a7Ry\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnOnoFC+m256wgG+8fTDM9OkinavJoDdQW4ov72HWBhwIgcZAn4kWrTDwLRwGd5Kbh1G5H90PYAtfSgL1u6Yw0NSg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.f9babcec_1543274342622_0.3869925932798688"},"_hasShrinkwrap":false},"0.15.0-alpha.5953154b":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.5953154b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.5953154b","dist":{"shasum":"93c4fafb0fe9a9ef327087af463fa2c13265f036","integrity":"sha512-7oWqH41gRdsVuRnNqXyvdOSW1rv6iiLTXBtuY2kpHEUhM2OxtWSDUSFWNui3mhWH/tNSQq5LmOemoBUi6ron0Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.5953154b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/IApCRA9TVsSAnZWagAAQkMP/jGm17RzfREo9jECovmT\nAwaJfGbCspP0rCkEt6N5Bt2JMy5sY+WhFFsX4kS08h14QmaVLourlbgV+Vsd\ndc8IBqtsxtM9qG5uutdWqAiQ5INCsaAVsWWCFa1ErSZjWS9JfmxugtnZ2LWr\nMZBwFjtjNdYbF+Zi3ShXwvc6qzOgjpOaS11HzPDWZ79uBdWHlqPBeY2dC48Z\no1FRVYqPli7ku1KDiu6JmyvA4nS51JVDPl/1MDo8uy1D+Eib0gf4Pf00f93s\nr89xgDdkkaFHT/N0OgAFCeJWBl0f6KW9Hoqh78904IDO5hUubN1FBj9/UG/d\nbhv1ZK/InPerlxGnHaVBc2bifvSPaBooorL43/JVU+GiyNbrdwH9Au5XoKPy\nlIflhBFqkuMD0v+GxpA9dRNJGYODf2Qw/3uHcUZU212b5CnJTHQTbREFSXlT\nrG31AFEeGAOVGV4RL05RaN0KfoAf2IFl71OSpAKt36UNPbhUfIy6M2Deg0Rz\nOR9/wjys5TPLO98rhPJB0Rmyp2bmWGnOj5zIH2Hy12wLO3PIdLoMHMqRhKDL\nGKyDmkCk2Tl/Lbp7jbKDl5RIqCB2C5bpm0LtYx2fRJXz1/wTRXakjpB69wqJ\n8nzYrfZgZljpNwccbozslfAV0Vs4mFBQ/g27b7DIEumB+seMvDRHQgpbqHI3\n9pWB\r\n=vfLe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBU06ZbP+0q6IlKXZqQOzeRdtE+yWSRL30i7jTAjZfD6AiEAh8YB4ahIp/5ThnRPg8gyQYUAkH4suey4N76kr2l4uk0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.5953154b_1543274536608_0.026518047684603863"},"_hasShrinkwrap":false},"0.15.0-alpha.e7195e3b":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.e7195e3b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.e7195e3b","dist":{"shasum":"9bba5484b7ef3560832eb380524d5bd08696e7b4","integrity":"sha512-fvrwzCtFpd78RwPujkBLtaBcFBzq9iKFa4zCLl65XB8b7uCoSq6La+KC0lfHg1ga42FCRE2nGZuZEBE1hpjXCQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.e7195e3b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/RdICRA9TVsSAnZWagAAKs0P+wbRfATd7e6Scks7fFdq\nSAsDr9FaEL15p/dV7ilF45fUmAx9sCZJYx8OEjBHeRuOnnUZe12GOYjRreE6\n/UNOvYojFHDYGr6Pl8wG8Uq0GczPjiA0V2gkTaOGe5SZMg/dirbGewVGg2t2\nnV/vGYBK68NTPSyTMzJ9SMC3e8BvBweTtBCKYlBK9+q2h4uc5GcN0En8xvOU\nfWCTSZkq1cOVIjuvkXR+ngBvqPkq86lHazpo7b515f3FKQJ/gjWjaMGQLQkZ\n7LOU3WyPd/5CePmHn5JOFBAZVsw3cP4T52upnuX0QGi2a18FP9s470Hg3z+f\niGIuyZ0SvR3byVIlr5iZMSEHYfWx1IfzVeVfRDG5Xptuv2/I5zqsX+Wsq3Be\n96zDLM5GeEep7UMsZI20iuoWQiXj4N+QOQtGGLwWpDmwqjMXcHbDf9aJzkJ9\n210Ba0WL6czIpJ9jI+jlaJ7Cfpp3wct+7aGiWGiyxQPruxgmwN/7gsUcxUnU\nCu7fkL2U+4AJYBDyjQ+fAtjbHq2OXBRQLew1hKefJ1XAiN8LeL5lQ9nqOg4z\nh4+/HU6ge2143GKitIzHdOLptow+BzR7ThseLSirb6z4xirabhA/uJQEPU2G\n5Bp57IrauZKwezShO1I4Blu/M4jzrmVqvT4+VKwwCJGUBZHfSrRZ6pMe2/5N\n46r5\r\n=DGIC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCH2wctlMupqm+16Ygeet1LW8pCW26Nsc6JlrdJ0ac/iQIgGhT+cHAGDxgC2ebR2pYniA6SfJsro1xm92a4bTtHEJ0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.e7195e3b_1543313223607_0.862097527184666"},"_hasShrinkwrap":false},"0.15.0-alpha.b3cf5d7f":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.b3cf5d7f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.b3cf5d7f","dist":{"shasum":"b952887f3322469f8baf8c0954eef3363ccab01e","integrity":"sha512-54sxrPClug/8WxMxGvTMhs173GMKLj3z+6pVoCtvgYbUnQgS9r1fm941wtanm4vg+kJe/RH8d1igWOr9OZ9uxw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.b3cf5d7f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/Rg3CRA9TVsSAnZWagAAMboP/17HnYM2/WxoIaKTEqCD\n+ore4aD7K0+AVnE2WJ+NZbqe79EE5pOF9OSlUzjFxl5JLv7zE6wKE9Dc4y1I\nIW/Flbe/ELjpn99M+Ldi8B102AXuUEL15LHUTLm8djT/oPxTLRunqLvBUYjX\nAJBiK4NnVE9LCGK6Be/vcVwkEdZ7RPo5rMsfD0vMHiigBQrGbpO2B7RMxMBl\nAVyb4crd+xOeFDvQGkI/tYVypNc0Yag6bvKCtNKiLmDP8LLCaY/qm/jklZW7\nC5YMI2vxAB0mE2UIWWeWly5FkN5ES0ufzpxHnuNdOAfgilLukzZV7nrauiLB\njFj0GjzpGzwrtp+L7RfbLEM1huoyvloQlj33RNSVVbipgQsBC9P84yDDr41n\nrN4GirV60C0silFrFtcXidu3ct8i/BaM92fQSM1N6C9Npv+qAcLLqGXgozez\nflMVGekVZW25eyoCSF/vtBYyC025jzBfLFcAa6ScrHUAA0WPnajYKJowcMPg\nfZrQkcDB3mvpKuONibh1Bu9dOHMlKVzdd0H36bxPzIOs9Am4ZPjzS2E2CfAy\nwi5OGDKOro8al3bWTg2fH0Gx23qFEbm/blvSfUpNkuIe9IXSZyjThq5VR1bC\n/XxPcRe+OzcB2wR8Jaj3RlZKFA5NYXD2bk1tj0kc0blLUsfU91SVmXGCON09\nvreO\r\n=I4iV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDH98OcSIzqUtAh5+UzRfF3z1Sl7A6D4FTto8mPmej5OAiAkUOqbQOX0cCc7IaIjyrkdX9xxQIyCcCfhTGYyYjUQQQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.b3cf5d7f_1543313463188_0.3955989185629052"},"_hasShrinkwrap":false},"0.15.0-alpha.1a9a3e30":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.1a9a3e30","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.1a9a3e30","dist":{"shasum":"e01c04dbf2fe49457f837b3ec5d21f7b8e3b30bd","integrity":"sha512-ovNsIabd/2YAEUvRH5T9S7K8FRiIv9QLWrwIy1oaskT4u8P3qtAcaoXUV7EaeaOOTpeIQ1BxhTeGgTnkYyL5RA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.1a9a3e30.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/RhaCRA9TVsSAnZWagAAn7cP/AkStpPzmQ8VEiX0wcAi\n2mpWF4qyGE7HkYXe/Jj1fvDeGNpU78hdVpuaHVgKwxifq8X0ZvDxnPz7mBiU\n+nBbEAc7Q5f/RN1HocJ7e/EOCoo/MheG1EKOmfJCdGU9+O4FKCdCRZkc6VnP\noB1H+ESeUDNmqnasDd1K4rG94rJKFI4IjO2bI0UW7H5uOLggvln8zuQ0xrix\n2Hi0ks3OfFbQJ2CMCNM/p/U1w7WNWZQAdq87yI2BVv9a0PvE5jaxwkCeHI3F\nvGzXKUJZYiYMWMk8SGU4/1YIVr61RADxJNXW+q+wKAcSTfn3GPZeXJJbgpb+\n7vLJOloEdRvv6QM3RKcelzmVYliN6pDciuWzAR8NmbAHIoL5MByN1pitP/kJ\nec6r9UsCTl+vOr3jBzs9FLnAWU11g/XA5POYWDRFLfxuIT8Vdb8MIxywnD+D\n76IPLyI9B0HAL/vz1TBoIaMhrQVXcpnAOgtWI9RV/VsDFxIVq4M1xbfyf0w7\n5n2MBwqCBSFFfsqOL2WkuhKKqrKQ76wX6EbPrHCcCCkRhQMvhA3g6gqmqQOt\n2E6kzb3FeWyHd0zP25ejATwS86Xk9OnOFeNC5SP/0vJoTHKVukWEk4ekz28E\nzIQctEaHM8yNUbfTAZTDqQh6qbDk9ciD41hRJniA0ha1Crr4dxYvYhkxUaD+\n5oLT\r\n=vlWg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICi4qP0RxwMcQEOtRsgdoZhRdqnd6wjQhWioWudA9lzUAiEAjLYGGMPXgqf6Bp6Dtf0fbWgYotpIu+Z3WEBknp849rs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.1a9a3e30_1543313497390_0.000850262857017503"},"_hasShrinkwrap":false},"0.15.0-alpha.a1d3b95d":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.a1d3b95d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.a1d3b95d","dist":{"shasum":"2448171f4e6fd11f0e7c7f41190e8565dbf7f3af","integrity":"sha512-NYsEzW2suN7ShPPt67EH8BtmB7DJcC+aVA0ZppxjPIH5ZW8daP2fhyloOwL08k1BucVdzXwPZRhd1dyJW2v4IA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.a1d3b95d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/RkCCRA9TVsSAnZWagAAfw8QAI2kGELFjY/tOdOjDX/X\n1jjHEK5S+WXAM+F746k7JBq8otvfyZjH9XCZ1eZFP2CZOjAu2yw6gD5hRvxP\nn2mqjM1d871vgJPVzWiqnQWpoN5a8HugJ58qRyso0vOEZW7IXkqfyaPEkSbJ\nIpJZemFPoAZ31k9b/JjwjmgjRbmTkX+pp0gSBzeI+WZqFZL2WU9Uc95QEoLH\nwxpjon8uSVsoIj7Z1joes8dlQEoC62kxZTN5PVSQ2+C9AzDdWPHevj20SLGI\ntrZelRGb01GCYxwOeTCaXPfmCYgAAi6E1ipmiqysLVB6YEmJoQzcnhw17rVU\nQ7lK1vRDrhs9hwHjY50HwOysCODdPdEE0pJtEtsbYOZlPUPAt4FCoPbZEXHT\nLEeOtqwoy4Ls/0GfC0RN48WYLQsu6954v0a9bEtaz9yUU3zNoYC398E+u7IG\nqIo8CXLhed5vOsZK79nthpAjDYM3ZAPUQThVxFYNTCzrfBHKTfpDZbhRuRl5\nGi41I7MDshub3DefjEva6wvtNxZscjfBNiUEEQRVPL1ggg1gSdqMKgNbW2Mj\nLFIUPV7H3UwP9QkpmVM8dRjWDW/CZ+Zi6LBSJV02hZVXYE8993mgAWuYd5e3\n7NgOumc8If88UDM76UK39wvtTCTiwlVZhWoDhtxDmbO5boR5vo/oFlQgU94O\n7V+4\r\n=+6HT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB7OqNU80wOvgRkg0jk4lI8kOoYFa8W/pJsdUFm0YD7JAiAaVmeEAVCoFth+JYcigQPu1CSH9ApT9CiJn8uokTfZjA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.a1d3b95d_1543313666303_0.7552838736792356"},"_hasShrinkwrap":false},"0.15.0-alpha.33421742":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.33421742","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.33421742","dist":{"shasum":"cda6d5dd805b9e2e2c6c65e243f7aa1ad135b45e","integrity":"sha512-sF0kS00l2oJ0IocNMiJcL0Fl35ZRD9o9P6Jd/n0iZv8RJWf+YsKSWzlhbevSPyEQar8h1PLAp2A/W06Wv1Q1Dg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.33421742.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/R0MCRA9TVsSAnZWagAA2EEP/0Sf9XVHmN9F5RH2rdW+\nix86MIg/2PbDBpGHFGBdID+XPOh55Ymh7uuB0wF9NW04Ezf6fRCz2wssd9tH\nFeo6RjxDMp6wTRYr2IwyeQsxDR+FeOI3M5Cxwr0+wt40xDXbeylfH1eYb0oV\nnifGFACm+FSXIV2mcakP8O89sWv2hGjfAHyEPmtwirxA/59lWkwyioRLM+Qf\nnjZ+dDs1NAs2SZZHFXDj1GDaPMpG6tVYt7boliRMZPekH7vVaHTm2z8Ttkou\nXtQL90reL8EMmezYv1bWSQw+euN+rrS89Eqy1/gKK2gnp49G+I+6i6MUP5b5\nxd8DgeFYb5Pv5AYs1EUorKPmullF93GRneequ/XuVOgxehyDov3tiW+u28eB\nmWZJrY+akJWFVme6gMC5zg954GwnxLIHOIr1NCeDnVwAPNe9G+Cnv0fl/5c5\n1QdP4kuoTPzmQ60HpLFwlc7hw/KrVqzErmtBxUaQQ0qMygzEAz5xcwJE1FyP\n2VrE6qB68qmP/Q8i9S9XqCe9f4gjK2niOa/80PiFNhDGDO1SRkI5Pwt8mriZ\nteVFeKBXW8Lr246/ITkMOivHNAkDiKZBXD5wyMyzV+yILv1tuXicdyb08+cE\nFYGaVV2o5tmnwSaUUBy2bQtH03ckJPdChqayMLdLxqv77l4uYS+3opQNU3bS\n6iTT\r\n=FbdD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEm1p/cw3+NCvRHTmpbAnkqjzGqSYxa72rcLgpDYIydyAiBJuh8sgO8Z1gVN+fmmK7AcPUqbe2WGW7gNZNnJqG7wvw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.33421742_1543314699446_0.8057858832230975"},"_hasShrinkwrap":false},"0.15.0-alpha.4f707721":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.4f707721","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.4f707721","dist":{"shasum":"0080d24d34acec719a45cb20196523880735295b","integrity":"sha512-TZlb78NPYpFmu9dHqy+DSYoVvCRo63O/Pw1tbpgI15AbetRQT4kN3lA4BA3IJ7ATFDNGeA7EdmpdMpUDiM498w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.4f707721.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/SpeCRA9TVsSAnZWagAA1MwP/0dkYyuOYwi90lEqmTje\n/H9lD126R38qNqKG4KRoaUCV28LYBHU7Tug91x8udbX8NYCDAgtog9muNwcw\nOulBTqiY9ne9HHFT1EHnbfhAEQ3tZahkiByawMhK0l/18crMl7jg0bIZ+xhY\nUksVmmp+yzbhkT7wQsdhvL/XOc0nwRc9z1a19D1LeqPd3dJZ3Zxo/agRQgmK\nst6B8KxWarfnN7loLE3mPx4IVxMn/sw2ND9RjrIfS6O7MFwiaCtZskDy+HRh\nDpogXdht8VBaJsEe9J7YkSm8tQ7bHv33o3OC65aHbp117xoZupPbJgZqjI/p\nLFOYVZHJKN767Guz8DbiFRdEbUDB3suxkoEH2huKtPEBi76hGYrSItyGLJxq\nuvbkGCibZ3F/NAzawqb1zyQiudBfbLhkupv7YoL2Lijsu2wcHPKWbEBhVkjp\nDqxuuER1QzVq76xxNJa/6lyg3HcTLkQNQf+3K4LqRwxCGgwjihqbU39R6rhb\n3wXMRCOaNe7eGCog/qoQIPsKq700ncTajm8rB8V7AoPR7fP4pPbrMnsKqqQF\nY8J1i0asE6rfS01IVgywFKBGP2FyYo6JIppbK2GC3iDBBdmL99thVr6QYnre\nCDHQPnz3616BblPesR9WEI9tqj43hGTn/E2xkz4GbFs1AoM4+InbpFo27Wec\nxNg9\r\n=ogVH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCma7U+6ZiW++/ge/CMZoSsZZHRT1gBLeAqnIrqaWLI5QIgZtown/XKunyusJ6S+eA5u1GfMhgcgBpRvD6godR//m0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.4f707721_1543318110210_0.20582849895153665"},"_hasShrinkwrap":false},"0.15.0-alpha.d5f28c26":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.d5f28c26","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.d5f28c26","dist":{"shasum":"6a9a3734eb0ba2e99dd5d4b765ea2afd9fa81903","integrity":"sha512-KbdYzmbH+10owdtNz+fawn0tH5Zv/Gcvux6TgMsVJApoBRznr34TLUwgEPlRGA7qPNpiuHlcmX4YTqgk1JKi2g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.d5f28c26.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/TD7CRA9TVsSAnZWagAAjHgP/2fdFaySeL2Qccriwrai\ngpvHMc/4uLI7fbBM7gjMK1wLvyT4tJ/Lumhcu2l9aKi71+pwmgklnjmBV/d8\nO3DZ9Yewz3bgsETjYeqgm4WIjFsXPQwG3wDqVE62VePqZlTx2GL+wQ4ZJsEF\no+tEh86yWvX0zHb1DMTJEsJDJkZYMagG0kqEBvs/Fff5YYFD1M6pyE+e30V6\n+a34P2EdM/FMiJ6+ILSRjGRJO6RrZOQ3ZDW5AJvwXeBuzpLVGS9+MfCu2xXD\n1VDLYIo80nrT9rfHCoOW0X0LGJpWzyCiDyS6RE8IQ/jX6qWa90pHyw8IKPZQ\nM2D9kG7dUd5P5wthMhFtk5rz6XgUn3jSQeeEHv2FsWVFtHOOpgDugACnPR4/\nRfILHsVDvrt+n1Yn3fWDqtA972Em1m3JaUoODJGXpX31XgnHmaOJLAN9sY3K\nZhTZLDnFL/WWoPAJjDEmgkq4dqrXQ/IKC9AZRuqPXqYgeTr5fKDdq87mu7k/\nObWymlISVI2k8gblXxO95PEGsD4vpFL/So+EY/orRQ4aK2w8yulfj/YSlZTc\nVexo+0jI0qRsfd2ZAJpG6POid82WwkmdbmDQzOXi8bMDYh1YN3tX+EhTNONe\nUTY0lsSCtYmx9Do2DUUW7/ZYd6isXDr8OvoAL51JTTRnJ13eujHKiFxfcC3k\nEuKa\r\n=lzjs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD533wNxelvxvVUplJ1feHW0nIRcKfnTHokjrMVBo4tSQIhAL2DJE6LRnVZOjAUE/ur1rmXzDXIEj/ee3Q/fBzLCQbx"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.d5f28c26_1543319802744_0.1271510512528462"},"_hasShrinkwrap":false},"0.15.0-alpha.6e1a59b4":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.6e1a59b4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.6e1a59b4","dist":{"shasum":"0cff669354e6f9e09719dfe5bef41bb8cfee9630","integrity":"sha512-8cO3rz7Ujwfw+AuLb0j2KN1zBvq5aeH9K2wItmGw3MKnslHc6eE9P5xXVSdFeExCk1ZF/J9LzagiQ4EErzjDNQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.6e1a59b4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/aC0CRA9TVsSAnZWagAASOUQAKEqc//QOod8lQkmeR6M\n7B3cyxO8mVpVcYQgb2WO2kdWQQbh4QvfYwua4bmMI40k/6BumRSpkPlCSlKF\nHq34s6EH5tNoXr54VjoXbP5+WuSFMvKBcvZr0r4YTG2HdLmjSFUOlwyOSJOu\nCWUN/ZYptf5hErpmrRel6O8kGnhVNYA+3UaoiymkADxz2ECqbakSqO0TnCMa\nPL/DmynjW3FiAINkx+SOt1wmtz3hCHU7Co2v8/eJQPTEFylJLQmlKR9e2hW2\ndhbQo0uzrdTk3yL4lduQSWAz/ezZ7AUKatxJs914+0OZ5xxGnDm0+nxjzPHb\n30D7a6IHpLDyZFjSUGxbfYfGygVyvyOtHTWNkJ/NwF2w9g6HbW3QAwFPXn1E\n3mwcCYSuVTmDx4GD2CblLys7ZweGlCPcJIQBWA5h7/mh8aqUn3emfEdXYo7u\nj7MoNZ2y1lhxh3zq+D6dk39Q8Xs9dcYvnZI3l5F/WKkFoVwQBGtmH5Rw+hPL\nScg1fDsTBQZiVtvXRj7XIVNhciBvvhIDfdYm6yGSDe39VEyFErOk03Vi5iam\nI5iAR5pWxrS3AsIH54wVZxQxRbC++kbSNj4e2ZwhyYlOTEy3GNx41SYi/4bA\nCCaVi9CaQjWOEgrx3t0di+FEa1vsFgYAt+rHIMirToty9uCQSV6sJkSxyBgW\nd9Ol\r\n=nKoU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDi9NIfCXHi29TUdUboI9c6gM0vy9cr+1mKlEYO4shwZQIgWK/TwHuND5UChjl4P/tFUHUHZwZ2jImKJfaMM/hjGPY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.6e1a59b4_1543348403752_0.12434869568793916"},"_hasShrinkwrap":false},"0.15.0-alpha.db4be5fd":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.db4be5fd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.db4be5fd","dist":{"shasum":"8d3174d08d625154c6ad8a44d87775a9a294dd61","integrity":"sha512-AZbqZNgC3DOp+iYoxJoQswIywMvxx/UI/izn3/SZtqwvvhYpW/Aga1glqLiEObX4bYgcVc505OORYWiGIAOudg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.db4be5fd.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/c1iCRA9TVsSAnZWagAAcy0P/2wYIdmIFiFX2pYY8k5E\nBqST1flRTDlksnvysc/kXKVp4l1znzcZyy+VP2shmwbYepIYEEbZggots5ZX\nUS2joBLX5+MXKMZW4OUTkJkLrRyOtfsDE5OXlC/i+/ze2cER+0m9m8GwDrwC\nMwLT/HUeVFkPeQFBScCY0WK1o+2BiqaHVtK5nqRsUfTvSsKnfY/u3JlAul8/\no97vL2m/qJCEiQQxOPiFAVSnAGTuYC+sGSLwunq8GiVylMmKLfvdYwghwwGK\notQB/oCIgwd7Ev7K5iRfFMOksm1wb1X7XeuEKYtGmQIuhgtsZ4SZOl47dqqA\nxf2aU0MCZu+s+Ws8G2jk8c2xef6H1CiuyXuiVadxTWTtBvYKOwf8HIZt7UjI\nPzcWvNLRETcC5Asue74+a/QlEtKVzYx6GNGpjwU0Klh4zupQeuNk7t7FoGd6\nx1MiDe/eeBg+PbDoAKaeh92PpqtooiyNxxiBgEY2DJkvmncQp/qhQs1nmeL5\nQLuBPWHfox1QwrCXxDpeaRTh54xc+sURP/odp6sOGK/0dgQOduT6Hc5VjKxp\nrXPIAAR5KBvdxoy/xOrhkIiPvNAZ16s+wcg1D9BPVItCOtFdemRTUmVf3o2k\n6xdrInOjr06Mn8Lqb+SPs75ZAhfRpjuNPvZN0I4SMBvvuqOckb5Ah7t+KPgO\nvyl9\r\n=/Lrv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6jfLlNeIi5I74XPdoamXvWz3wLwF7HJ+11qw40gkUbgIgLx9VCjlZihoAPQ93sFdj6um0mcdU4fiBhJhtwbsuYME="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.db4be5fd_1543359842125_0.7357324635553417"},"_hasShrinkwrap":false},"0.15.0-alpha.258fb11e":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.258fb11e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.258fb11e","dist":{"shasum":"cc895e13ca58c1388f92a7c9f545ba40a4369244","integrity":"sha512-tLs15+mVz4xbUtviqyJmvS/PO1ca+rdS/y4+y9ruUoAEsVnn24SHTKUFVBltoHmKmr5e0jsPNND9+1/E5J9BaQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.258fb11e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/jgICRA9TVsSAnZWagAAaV0P/ialQtPsvvDVob6Bt4IU\nBEEA1xCrKh+KBjYr2nGFkrCcVR/aXCJ2OIv2OV9loaIuTAS2OGxBkTqmfIzz\nsflXTvwwOEOUe9OZk3RLRtXDvUH9A5bAKdMaMW3/Q958TmEQto8AKhSUSEoB\nTCwWkNXCkOOhJeC5KE+Ll59TD20HAXEJGrMfuY+KlfTd75VAEvUCEBpM/B8o\nz4WGrupyGIThL67tn6vhIpVj4XLiLAhKTAC4GSZ7QwZDQSuMP72r4EvcfDn8\n0H0jv8DQBtPIWkOT1qhjGGFPm38bNqTit8wC4bCJ/oIZMNXjMewxEWrkn0hz\n+sDRLkvj7vpviex/fh5NR5nyR0gaZj6LGFadUmlIymT+vJNbVwq8g9RQsrf5\ndwGVT7rZcznnpQJVevklsa7EnuidEIUnS5/jHNs7FNMRjQFRvHSAIZoi1g6E\n+H8K9Y3P8IHJS8fOBSGfjfCDyTMWNwC66R/yPsAZ/eI3bxL+nxXF1aqiCsfJ\nQ+YfCxP4Ow7r6Kla3T0UW//0ghEmi+SGULdNH5dkXk+El/6CRXt5xfURWJbq\nBFpCg8c2ztrlKwDSfgbflxywIzGFSOrIvf8u31gCt0qi3lE89Co2cHZZ9YDO\nrFoqdJ5jS6K2KhPNB1vC4G+Ng2f2WAKiR4mduhD0hl3NmKnwLZ0PfLvwC76n\niMdG\r\n=PHcY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhwqppbk0x8gz4rFniQXSiStQMSrVTPPWrW4jZ7GSXwwIgOd6HQBAr8NjEfwEBmSQjJNGVL/+ONPH76iWZmGAl4Hs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.258fb11e_1543387143837_0.6528425325009128"},"_hasShrinkwrap":false},"0.15.0-alpha.fe653a0b":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.fe653a0b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.fe653a0b","dist":{"shasum":"dc4e1e23c0a3445bfba7617af3780eeae4e1cb40","integrity":"sha512-e0cSbMC9QXjV1J1mcluuma8B1ywIh/brlqWQlMrA9RtE/Iuo+Id9Fx2dyr+83T+i+JQQ7oGB0pewLSWcC3qGrA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.fe653a0b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/jqECRA9TVsSAnZWagAAlP8P/jsPvuI2C7b1hsgD9eJD\nbaFqtivxFsxtRjS3V3sHhMPvyeOGDT+5myYzmlo/oXonIpN22luuGWBNAuea\nsRRGRhqvBPHxBN7h5M+nr0nSV9h81GmwOaOA5THmkcTHitZNwF/M9WTIl4CC\n3QS+/u8h5HVfh6qUxxdEfBkvLAY6X+8KHZP/waUL9nIDQMy6cbxXU4TLP7v7\n3/W/LUNAPGAEFNfhLBhisBp+nXX38ZQp6IxpTbObLCL0o+EomK6hXTew5y3B\nsw8oVNa4S8m6vFqnG+ce8E2RQuOQMiVyleiiNoPafbJUwh3qVd/kD9ofvyCE\nA+HBUKmoJmmWf2rgXjFP/9wrT24Pd/NkZuIJL+++91g1QqHyTwn+Rv2V0rfP\nk7i6mYhVBaXaopkNDxUOV55T9CBAPovSisRqo7h1jh0mEYKrvtAb+YFJIAtc\nW3eSBlg08HnbAD+Se2pfhiybIzbI91gX3I/NIqO8TOwuZeSnNptkf2C6pQ1O\neeq07qA9PXCLX/fIfAsdcaVmDJmaId6XTbZG/V/+TqWC2qc9ExqU2dBOtbaV\nCE5hpkM1SD2evx6qsoNMif0Sq8fDQD5AY5Sbb83jIut3J1+txy6KQ8eOE6xm\nuU8uRwxoyPfuHhKKPCe3ZG6uqGNGio9Hw2Q09EO8IoOG79uob3zHEjvVaKMC\nD3I0\r\n=aTBx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7S58k3Usta4tXmcA/NGyKgIc4GmK9RJ+MOMS1k6HLawIhAOU4Fz8QhecCigFBHyWb62QkLzrU8tuP+gH+nyuAUWa0"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.fe653a0b_1543387779925_0.16328144719846427"},"_hasShrinkwrap":false},"0.15.0-alpha.28598e85":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.28598e85","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.28598e85","dist":{"shasum":"28a589b88deb9eac49b2863fd29e2777ca34aecf","integrity":"sha512-N0D+71B/WN9hSQ7S6JpGq675mcbbY1jjq7YXKlOx0zGnDpRQuNIfJmh1gQRzN5s+B4Aw2mFyYtRtS4yjck35rw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.28598e85.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/kXbCRA9TVsSAnZWagAAP+wP/12XseYo/kM8X6PEJxHF\nir7c9PolNl+YChhQedxoN3ducnimoIgWY1IWYB/3p3rQ9qdsqumbY5xnVLj3\n9emMWBPdzKtAx6aD7hrfWkBcM+YjR9aHrJc+3rS0pEbzhnr+a5SH/qnKwc0E\nE3CBssRkbhEUdU6huzIIiDIxu0qur+65HlhSED1SMD8jLBY+gndvWXr+hMS0\nIJa1xvmG79amwnVYkynCoMT0e/Vdbwnl9eRxJQZ/PdgKJP/FyY9/5tBR92hv\nNZUF51k/BsBIwsC+zZbVHOncgL1EqfdZwE4px8shhu8NL+MHMAWJqnnAPVfn\nvRY1eO1Lo7HbzNN+xCMocCX09KpPPfF4tE/favusuOpOmMVDx+jB4ZtQReyv\npMAwtL5gub3QL8CachNHv1ZYzDOzNoeFi8mEyP5yqYrgSy+Qvg8QJhu6xztR\ngpn1TG39lOSB9QPC+1iewNU0w9EB4Ratzi4FG9RSznXMlRra40wxk2sncS75\nbCCh2QLxDwzjrDJXrBDUyg2Hq5UP3w9xeG8oiPy+PinWryQPG5tnrGBVCAs0\nVygbqUMf1uxt7UxfsM4IHcpoovv7j95doThe0Q7akBOm8xhrhE1c/XUTO76X\nILF7sEKkGveDrh5qkO0InoxaqHLqTE8AbpOOIw7ktVmidh4FQ+Jr7Dg0QS3C\nALZZ\r\n=cBLh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDLyfmooJOPRJPfXwfbadtWtkDcY8ljwy/BzrQZnOvmAIgWODZ1RXgdPAX9atuzuhMdjtnsig0N53T1PNUNuYHIq8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.28598e85_1543390682599_0.25154464499983376"},"_hasShrinkwrap":false},"0.15.0-alpha.659ab7f7":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.659ab7f7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.659ab7f7","dist":{"shasum":"175fdae3d08862e2ec71f255833e959f78e8553d","integrity":"sha512-Wzf6ZeQCrQaHmNhQdqBLglWZWnNxh2ABvcBRh2S6rkDiBqxJx3Qdf3QEJCDwf2BNJt4uvvlhrBzvG86Jfjsujg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.659ab7f7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/kexCRA9TVsSAnZWagAATFQP/iTwDPhTKUJJOTEw+kFN\ncjj9bIrNXuc3lME1Y2I4lfZImD7Z5Ers1Ata55ts1weCSwk5dW0ftu4GsypA\nmvbtTV5zQC7mMyrmoz/tPotxj2QewN6k6RAQltK/J0nnqFFlLtc1bIeGndLt\noh5bmDlb5C8nJ6j3PO/sqlldk+Jmkr3121gBeWQc3Y/pddcI98uVk3bvpeCK\nm/ph91i/8dCRdzELNT7JoO1zMjgKG9clP9STRw6SOsDHkpY8V3l/MULxOYRF\nxYSFwnYjRPTuXPXWAE40mOBsxNzYVv0tTcP+4Jn5z9AVS3FH2igyF4m7tiMz\nLCOLNIVFkL8llYjy/BA7L4UYGNYbdExNxKszcQVpEFcgRi7ZvBsUXK5v1RPh\nT5as0VwHv9gSte9YlEWxx9ckRRvu4RMnTh131MnwikQMajsURSkyAeKRXgX5\neQa23WSTFFuyFrpv1OaK1WXODsFfBNKVgZJd9cHOaDh1Ngwo2d+OJ0t38JFE\nzYi4RKBKKiL7xt0ManaXIZKPyj07d+EyoazA3uaDI1NIABhM/MZ7pBeykLkw\n8/1M7nkN7Lg8ByIzOvWiZvsVPLUyULin1/54qFt6+soqxLy/pD+GwMB+ys5W\n0Juhofk2neTHbg3anFzdIGMTIgbN70CAljJrG7xtMk2OBCfmnEC+q3oKV843\nomZZ\r\n=4qtl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQColPzkAmxyEvm9qyQKylz9/oh/4ry9DlmMUEvJbLOsgQIhAIuFFeTYSYlIST/wuxwOPk6j14Ub5cwLX2rts4reoRHZ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.659ab7f7_1543391152976_0.7358526566961234"},"_hasShrinkwrap":false},"0.15.0-alpha.8fdd8fd5":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.8fdd8fd5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.8fdd8fd5","dist":{"shasum":"c3a97867a2000c143a4a042f8f951454790b5b31","integrity":"sha512-0mx+OkaO8LP2yDbqi5f7Cy0h/omW49ARGH0i7mClrQXHNJpoKeVWRVK5woRxXKbRojrj7J4rfGNadyEmPWA9zA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.8fdd8fd5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/kgFCRA9TVsSAnZWagAAUNkP/3SjF65hVru2dwCM2lVc\nd9NOuuIHg7UjCChHwEfnV9y+RW/2MuC93q7NlC9HdBd06a6ORJoXcII5OKsp\nhAqjSFE22TdZRGdL0CCbr9Kq1FEujWfCOjeb2EPm8+xWrOTpTwgM4rJ8ALDk\nySzS4mSp29qVdZN3PAZre2uIOldv02l0O5GkJwmi2z/2oedu4bgQLUyhguAf\normJS0MwT/9Ays6rCz19+KFTeNn5+JcPEWNEfoaJ3OjEDGlwrfukv04Wyv14\nkfd2ZYkSw7GwhpqrpHehJLxJD0WKltUs+7VIZaDncj99oI+t7YljU8maWWJo\naCvuKZfDS243WHVFRCPydSw4E8WzvFu0QiglT1eeU6JaghHuYnAtZ68Dys2V\ni43T09RJhud5tq+t0mdqMUerVTrl8rwyTpkYIxWAWdP9GPAcCgjF/sq0hw4r\njun0/x6ER3+fneKhqXPPJnP/Fc5d0iLnAukfL2RBbUtsR0pQGc9sx7h9HJUw\nb8D+M4clyvvQOg/gOSYErAeotP9VicOOI18CqeNIRtQWcvG9COd+YILMD6mH\nXp9JGcxyOdtRvJuGTaq2DpJPZpKFLgkUjk/qebiKcCv2yfCbf0KSwlwDYqwi\neZ2yaWUd0oB7JLUsAIjfp4EoGzSzeUR6b/aZ+BR1kvb/9S4w9vDbieeZM5Co\n7Eex\r\n=yJVW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEXybaQnnzYsN5vqn6ptZoqjoSYYxGew8Ka4PwkTSEsOAiBO8GA1DYct7ZXU2ICFBhjeWXHyPC2tUc+m0cQeuYGcRA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.8fdd8fd5_1543391236661_0.8339089533306732"},"_hasShrinkwrap":false},"0.15.0-alpha.55ea76ad":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.55ea76ad","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.55ea76ad","dist":{"shasum":"78c13f9d513ef1dbaf526bb48636ab76e89c79c5","integrity":"sha512-8mncXykCzuuI8nYQQPqo8X2JdqyOFBj+efYTVOpOe/HPWgwnYsq7N/mVu71JSJcP4JbQcZ1kHDzCVRw+cSYShg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.55ea76ad.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/koSCRA9TVsSAnZWagAAkVgQAKTJkewB3Fu3OrR42tWt\na8rSOcSdJjhC4IlG+2scjpk69aMEBYzfU6uPF3zjnJqyaMqwm0biGDfHxkn9\nCqe6s08xUMWNgZci/rQQ1BeGsbtjqMa3nl+pigBFvgDoXWChcoTNxcf56s+u\n2an/ubX50ZbRIvhhtntbBlbOOKQQOyix9oDVuTLch66VkGI0zBPcap2Ca5hh\nEKaMEiw8pJEBjOjnvmmL2KAhcrAD0OPoFL9pAJLJYhrEd4+MxwV71tFEvBTz\njopNvYEuU8QzjrZoALpfa48IbYjPEsgOykHHvC7Z7zEPw/SWgy7lD3kXQ+Yq\nn9WaZWGakMg8UJpeL15iioT1QEVkO6hazGojEKdGRlpaAXL9EGHQBoVK30Ck\neeNjRFBC7cXVCehbx3qBWDxZDLW9XAHmCeBC5cdwzLots34dCfSFNQb23ohk\nVdWMrZK0VznAPUM0vD0yGVvOMGyLk2iQtC7qk08gQP/+Y8ZSxI4QMqVmSvH+\nnIMaiuWILASOteo/t4NsOdTf8Zj7+q3jBScqYCHUiR5jGUHkH7MlbGOQF5Ae\n/bDeIXEJU/hrjU/tWT/+JSrb2wuBhuobVKEZTOs8faYaI3cnMYiLjHO+S0Fd\nsAlyvlldAYZ62/KDWUo0XrASQIKFO3nJofnv/bhLANlAE0EuvQNwkFjCmVLD\nZtnj\r\n=o1Xx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIELZLSupsR8wWtT1Lp0Ha53qhqKX2AsGHI4V5MeS1C2PAiEAzlFOhn7OuxPZiG/TG92LSyj+2GbrJ/pjsTV40DXUQzY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.55ea76ad_1543391761945_0.7961293912584548"},"_hasShrinkwrap":false},"0.15.0-alpha.a048a245":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.a048a245","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.a048a245","dist":{"shasum":"520284045857c794433404a9c6fb92520cdaa9cd","integrity":"sha512-fF9XESORGyUr7dyRTZtFdxmD/47APOFQIevfISwdbBjMxnldxLHdFlf66xijFQmpqa90l67nm/+T+86k6qdCHw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.a048a245.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/krXCRA9TVsSAnZWagAAn5AP/1pjiryiYIyj71NKZEuH\nt/GU0+dKcMHLnTT5/sMPryTFGBSXaU1mbviLMRMMh0gY3PSUqJ5QRlWwkasL\nHAuYQL/PwN6u5cEIyVQ0bz8+chG7U5ujD8Boa3IdGiun2H3L3SPUMfFi+kHA\n7kMIvLxCMCvixEO3Y+DrEOHjqaiumAOs32yhgNWhytcptkEAgQwBUSJKVlxg\nze81GYDgVl7QNYfCpD0RKXO8GL/cnqsvr3KihUJ3D6pK/mylKht/fc8b7YNz\nKNFpvM+WNN35heddyzXPz40co86IFyl46GWCaqiD6X+PlAmsoyxFHzA8Av5J\n13V0GcPtjJ33GExMLRUCVop0cL+SU8GHpf6KhUpCt5K4bnH30AtOY2BUy4rm\n3SUQie7Ew7gJTi7PBPtrOJqgYIqBRsXu/Ab+jCnLcYchq2Fqsx1R0Vq3TTS+\nuqR4Zo2rPU3LcOEovi2dTe18ijedktJ65RcBmoVK6FSmL2drKc907hXk8lOf\nUYA2yRwaTcY9p1L4a03WcSdBomPenxDFLvKVmEuDPnoo7KzSZrIKK9JjH5ec\nqXJVF3EwqGL/33pYmrSw27R8r6ocPr30as1ZBtoCZs+tPoBPvfjZHDuEHqSY\nmoy3Wn/nN1qz7Ncz2I680nvMdaZHB2JqcvanFRHmt9IHv3gnAlzejbkb0HLr\nYpSe\r\n=ZjXf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHJwDNSvMKpghmn+05atcxRNq5bs2EtEZelJnZlSXUjMAiAKUUbz97aXK+ZKjDe9qKDzjLBMnR6KU16BulVuLWzllQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.a048a245_1543391959141_0.8403627953349142"},"_hasShrinkwrap":false},"0.15.0-alpha.c36b07d2":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.c36b07d2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.c36b07d2","dist":{"shasum":"bc9e941111d727a042aecc9a41998766883c6db9","integrity":"sha512-cmmB5uDR8PdN6yV5A5o9QfT9bX6AELEuhlQGNb8cu2PRFdujW3E45Qk4UcFgGNhRUGZDKNmyZrJplkAq3WvyLQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.c36b07d2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/ksdCRA9TVsSAnZWagAApe0QAIpeDD28UA0B2S/w1RjM\nNdC1DJwg/V0cp0ddK1Yvi5Be+bFQQCymR4PAzgFB6bRdHrVtyoDFQU9l1KF3\n0HRznnFMaUPmjgYKxtnLLxwldvjmJzzKyZTYg+WVZosBqKQRadCBZcEnr0fE\naZA2BaVDfX/7UwnnXLN3gqPagRcHfM3oVZ/+8Kbze/9iOrup2KPEGE/oWKoF\nhltXtU7JsExp4Kd9Ux4iJzSJ+tKklvWgH82lO684Ll81xBC4gGU53mENRZmL\nKn4nZHBw47P20IjE574h2tb7LZej6GIWx5b8sKjIWI9v0AAEpbBMa+SYKhSp\n9odxbzoTLM9O5hUV3xvrkl6tx5fK3vxWRp9Ua2hrCRHC5pMe+Iad9y/eCpvv\nJAHzHmauxqbCPiA3c/9E4tY/JPL1Ky/6z73NQnzik4D9zA6aQoAOJ7NBfV2a\n5YnfVAlsSuErskRrLddbHI9mNQmqfL5CqG/KBKTwOppDzaeVOusUbATpDd+E\nLs5X34IXDUWItToxvPmLUKm0wUREn1IAHhd/XGE/CB1Z1L6RbY0GiPJWUSmS\nJOvmBW+3xtW/CLqS6bUzxx+5GxAlomXPosTgTqU2NHBwKkIoLGAEN7GFvLhw\nzGI88W7bD6J/7WhN9BgE3dE6dpC1m9VNMJx3bIyi0IhJNEAc5dwnZ3gGpsgX\nxpxa\r\n=dBqR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHl9IJyVLkwbns4sO4k1hIX+XS8/lVRojP4Nr8N/w8AEAiEA2OerVrre4U9xwd0HVqo4tHp0zmRunJvI/mXlDxTsJp4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.c36b07d2_1543392029282_0.8418738461623541"},"_hasShrinkwrap":false},"0.15.0-alpha.7d892e9b":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.7d892e9b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.7d892e9b","dist":{"shasum":"288bc2ed8de4d0f6cafea7db476f3f172be69c85","integrity":"sha512-tXS2lYjnyCcnjYWGUEoW0G19zuJ7ebqGx4/AbN/psOoHXRfHMrFi3dg/W5pLt0RVJs4ZuwRex0jHa0EaK6DPXw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.7d892e9b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/kweCRA9TVsSAnZWagAASp4P/jj4n5mw23m2Q1AZo9LS\nRzsFFhSqQz7CW+8G9YQYWeqwpVoT5IJA8eTIb8yjzZNuhzdJWeO+omiXUclG\ndOgw4Q36WKBf8o/S47YMYNic2w1S1OhRU7+2vALy9XlVu2wNudZ5KRv8WD5d\nBBiBJ+pFusE2egsJFFzZIIy61hILkwNJsEYSj/Fi45gA5r1973TjCFcfv3m2\nnLAW47weo6ZqTO0jYupSFGcpVEiB7WwYP6atiUlfFq3VUWvxP+BoUJ8dnDwW\nYbhvhBojU8uj96cfZZLxj/CXOhYXAwA6fItmYLfqU1dmHwnEe/w+bIJrvn50\n9ivcRbQq0sZMhxTGzENfyDfm1ht1O2N08ej6KCJf0JqSJmsL+kpUGTGfpWzG\neP24iBXSr5dFBg3vUpT3NiDTi7ZkGi4EQVkgc22BwFpr/2GWOtO7+1w3Ul3S\nppaNH/sgw9XE2CHRQWSLfW0cY8U+lBL7o3Q8pLJE5orUWBaibCw/h65/wUY/\nQQ/8bwl8lhrXbEcPZWPow7CIfMNCI2uKrKhiK4a0zLCLbGpdpiJUDTr3qdC4\nhJy3ROv0RsJrm0O4lR0Rjrjdu70tr8rr/ffHJGxRHw2TdnsU2Ylr2Szq/fRW\nEhCdKsyKCBjFVZyxcSk1WRYw1bSKrmqEU2f/TAVCFbLue2enlT8K0Rtl59LF\ngVgm\r\n=JvC3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGoEaUgrDKSujO9PTbhBVwCVeHAxvyGX2XGG892B0evkAiEAgieJG3BBaHFFORMlrdr9jqH2IC3liI2ji7VyexY+DAA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.7d892e9b_1543392285362_0.3957103661049475"},"_hasShrinkwrap":false},"0.15.0-alpha.afd23551":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.afd23551","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.afd23551","dist":{"shasum":"524f08ca1ce8df13885318b151abde5b1977a0c4","integrity":"sha512-KGO9NlFRoiLm5GnDer9Pff4rSJ9ri4Y0mjivURj3wBEi6h9+Ev8vw9jsCj4GwfwdnV1jvbiYDGtx+KnR+tjXqg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.afd23551.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/l6fCRA9TVsSAnZWagAAKY8QAIUNGrCJCBvXaM4sEnKw\nnosCYxxj7GCTOwbomqsbpEwclYomYabjRPiYxK+8/2LkZr83TjTDGw1UDT+e\nMT/ngWtiZsLuCAvgBlmyjALKMyiZ3m9CAVstiXV/ZQlD0NlhA0tSx+ukYKaA\nbcqYoJiacSnr0vjg6ZnEnTqgoLNSiMT+Gjzpnw0Vi0cWaIHHc2VBIYe+Xhrq\n9OShRHUvw5N4LicLc8K1xvNzcg8nB0o68Hav5g5Wfb9PniTn80whaOWtIjCN\nRplO6TrmkFRzeA0HAfOGYSeuawrDNEyZldxw+PPwBQbbFtAHpxKyFlYeHOyp\nWwTUxyRPfS79aqvwItMtobsaZjbRidPbio+W747+3DQqcsS6MxOnaJ9JES6q\nEGOR02xnCaTwhzX5MEFEdyG1mKplW86Jvjfz8/gUzuF+PvZ4UO7racjn/i0k\nZKvcfTWJWsS2iNko2pB1oM1h7dQJgCesi1fQFG7udvfmYHwFYS7oIpXiXKLJ\n/D5QtrkwrZQrUw88zJffrM0hx1uXmvVVvXGTaacaVq3yvKMUgj0cGvtuQFyV\naSWKZwWMD4wGchoaeWb53RW4fg7NRbXtziFHS7fTnek1/gNfGH+Ce1YzEUla\nQZu+wobN8m5ENvM3dG4aRbtXzSe1jgOA+xdI3RKsBce7W2+3YZ/xdtmSIRf2\nmbUo\r\n=bChz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA2PXUQ25X2US4gqd1kmJmuZWyaXWW+WPZtWbB1CDep9AiEAy0BoGzHGw6nKGVwR3QD9hcuE1XqVXDQSi9Yxmz/QrKg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.afd23551_1543397022708_0.2906924756521625"},"_hasShrinkwrap":false},"0.15.0-alpha.2e9c1d26":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.2e9c1d26","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.2e9c1d26","dist":{"shasum":"bc813dfe3c601dc834623ee7eb6b97d7ef3d71b1","integrity":"sha512-fja8kjE0LdGqI3PzKjck/OoZrq8xCtgZoUUneY4cYk70OpqaRgJLdUKgFcSLJ6xwzaiOGuZunVPZHssB10k+/A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.2e9c1d26.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/mRcCRA9TVsSAnZWagAADLcP/j3ZRF4LMZhhhot4y17U\ncNX2zzNg3/H+46Bst10elmV/I052CETxXCxn2U1yLQKSmoM+GfpL5RuSgIkg\nmW5zhZDkdXFZFVlhCCXxupsyN5OnNZbJEX3GIG3e4BAxoP6duKeGXFD1Lpd/\naekBH+a/1v/DbsnjCMrCMLiYDBsAo76y/pSBUC/AkbKhQpJrjuHNNOe3bw0J\npyOzS2b5mW1oIBAy4gaUzjXZD+uWDHQtEQazWrmbvUohoH6j+SmC+JrUYkUZ\nxsYiFrNUFB5DXX/5NPK9n9ZRpeu8xy3yBDPuAMb7ijEKONmR/bAilj/5hezw\neP3QUGmTkPA7eV6bSBq8YV7+jAz7gca2oeaIzy61+WO7aL6zKZwq6SC65TXO\nIdHWhzRRjwWyk4meAt5+vmcYeCkip/LGwEN8DRsdLW/QPDr31FUw9ZAObqZJ\nuQuzpeB/9+lZnsm4K4IGYqeYJJgcQZPshIoAT/iOSze4n8hwYe/KhO+iY1EP\nPF0Upgj4vCab6MxJWsU2KowdQImX50i4UOWU6eow0hZKSrtFFp81hOAEOEtp\n70UGSBt8zvu1fVNvOPkC5Hed5D9zs7WBmObiiOotVPmDM7TjrwVJHrKmfhUU\nc0KEzoVVyE9YcPDxSNnM/utFbzjx2akpEBFaa5wmN+sf1YwVwLTfW0l54QAn\nwwNe\r\n=5oqy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCH5KGsD0KO1a8kQoiOmox8LI1GSAljPXOvUmJrKeWF+QIhAM0Xv5wAjYwYgO5yjmu5epzP6jMbjDznf7TnNE4UUtuc"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.2e9c1d26_1543398492214_0.9082956161631577"},"_hasShrinkwrap":false},"0.14.4":{"name":"codegen-templates-scripts","version":"0.14.4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","bugs":{"url":"https://github.com/dotansimha/graphql-code-generator/issues"},"homepage":"https://github.com/dotansimha/graphql-code-generator#readme","_id":"codegen-templates-scripts@0.14.4","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"dist":{"integrity":"sha512-ke0C31HPCTYX8JnsjFOCFrDVuqFElTiPlfvyoFafkSPr5JPP48ud6OycGvOXxT/vAvdCNgR8ZmH6GSEHzti2Pw==","shasum":"b7c875469d96b4178d2775182b0478c0c7b7c64f","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.4.tgz","fileCount":11,"unpackedSize":15138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/mbnCRA9TVsSAnZWagAAutUP/1EYp+P+1qxuZm72rVnd\nMD4JzF7WsOLal/W20dgAlzfaup8ArfJ/0X1uyuOXh+hB1BBg82JFl/hmg8HR\nHZ6ynAoPMGMSh9xY/Q/R9M6nKTLGharfgvxNwwGQMIqbeLSbtBdnMJvp9Nei\nVkLf0K0CjIVIxa/VSGy1tlnj56Or4w1ET64jf2FbaVBuZLiDlsAAoacLOLPO\n3p5fsVJi+es5lqeFcm/rswCBQ1pLgUNO9UP11C/VHmdUVdSrheE32kIiqv/H\neBV28kE/LXupUZ1aLsJ5/I/tG2muyFcQHgrl3l0MYIaCiKWIb9YLZ2XYgyrz\nkkkeJ9kjyRHVbWzRkjPTvcKAPtE+yKXdDbC64EESXIhEzf9KleNsf4sXPnKM\nPzfVLg9WHRoJTpq1e9rGHyCF7DPn+B1tUS1kLxOd1c7wPPSSqFPrjXI8OO34\noQ360Gpc1b/RtxGWakZaREivobBn5/GluKECsYqKZy3u8wFHF6k5NZclM+H9\neXGFOohOtpkzkZoTs6UTSawEEk5aqp3c+yKcaJdRZUF12Vqb5+G+Y02Vfzsu\n27Dox9t4mgldYXpxpboADeJudE7a6qS+01SbCVDYK56hplBvxx6IJA2AT+fn\nFukTs3sNl3mw+YTyJmK3PkHKOpk0LXlpEb61x0pvutgqZkqzdpNxf1APA/JY\nGCYV\r\n=9f+2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMAA9oSvFzyNabtRLAl7HUNrc2+CND8RMc4rsdPMabIQIgR6RohajOXfz8UMug3JKXBe+eJSSKiZzH7JPC/JmaLU0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.4_1543399141951_0.2379631959599855"},"_hasShrinkwrap":false},"0.15.0-alpha.1ee5b961":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.1ee5b961","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.1ee5b961","dist":{"shasum":"d912afd5d4f0059dc41caf30d6cddf130e7c9116","integrity":"sha512-TeuUEQDB7uP8VcUHtT/TwHbIcXwXIMYM8a1xsc7yfWDZHf/RKgcw0zciitvl61Vj3sISmIPLu4/3XYfM9ib6hQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.1ee5b961.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/mizCRA9TVsSAnZWagAADoIP/0/jofZhjf8edxYLJTwz\nW39PWCeMU1YonUFU/hZm2dGRfzWEYmn4xAWhgnLbbquvRCcPjuntNy4fStps\nZZCiuAZUDGoizx1swINjspjuAvn8/7MqdHwrVnIJrAqMFj7yfNkY+7zhoCu/\n5+SOvdPOhuHc+MjnUKyKD+TnlELOO3SXyPzYHYLLTScriw7x6OV4jp3P4AF6\nUhlDxhxlx/Wv88CrqyU76yI9KpjYJLpS96STRIg9+9/1ir6gbRQcih2TAA4i\nIKKfS0WAjNbfiut8pdNDh4arvTWUmj5Ik2E24JuedfshlyQ4uS3dWihFwAcj\nUw03NKzROc78l6P4By/zsn5hYQs9loOZRe1ophFuao0OuOUPygHSUeCNoqzl\nDKKR5G+TRgNaeuegsl+kdTLl7NprgHkrA9E0D6zXYm4ubjjJ6LvQnt4S+4u7\n8G7H0ehuDvOARCGdaWl/qP63Vdo+Hm/Bnr8a5LgqUdjs6hG/kW3gEeopPqSf\n5/kp4SY1SN2qAKptHSHj1v1++/pUbt7YoPFMsYWg4zWUEiVFO4J/wi2P/fBJ\nSmuZduv7vSP7F2Z/lMHK8sN4HLj/ku19QRXSSfdvQc4kJl5cynreRmCXHcxx\n6VV7A3O0oMpyAFcoTplD2sa7cIggRmsa8FT8ICcqDivLUeRT1tDTq2baXcdj\nM/Or\r\n=OlU8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEa5+I8V3HWA53gciAKiaN0+7YgDjp90HqAsgvmTOeJ0AiEA5/CsJ4B22/rzMwdlqxcjVBS17nnWAMVc/mJQRXdd0gM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.1ee5b961_1543399602828_0.4438758725160419"},"_hasShrinkwrap":false},"0.15.0-alpha.23873b80":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.23873b80","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.23873b80","dist":{"shasum":"4113ceba181e6c41ff8fe7b3f4f9b18835bfd09f","integrity":"sha512-ChHi0TQbxvXg6+Uj/MevTlM/Z8g3uAldUeiEKaKHDSkUF0pamDM+BJuv/8Aa5kvSACt/nIpjorSfUa5K88pl9Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.23873b80.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/s/ICRA9TVsSAnZWagAASEAP/iCVe4uQg3NZ5nh22eCh\nieBc9bdhdGtvuKeCsbpipyaIj5w17J5F3ZbmGJC+iCpSQCR4patZNNBNRMHL\nrorRHIwGODd81afmcZYjC5GZ94dwZKxxEtTflI3AeyZP7W42FLTgNtQ5zNYn\ne6++ODPiwnlL0ToqFKIpZFHxDiDOjWOQocDZKnQ/j8sHByJffkdNh3yocLfL\nRZowqz7wQ9vDRT9kmaEM4fBOdLxcB86e7EqVoGnmXoDQpyMGarKASRzxn2jB\nugrI48kukv+LiXmuTtr+/VkWSOB9+5p9OwLM/2HVzZWAei+P4S+DQlzgLrv5\n0Mbyz8Zg3/sonA+/EiV3Q6YrjOJ+V2JiNivYgDXYUK9T2iZ1+LKzGk66FmFJ\nsLCIq/uaxW5wQGr97V12A+EE0fjRmhe1kYXLM7v3pSKNFULvf0uMa9D+SX19\n7oUGZoR4dXwCKP+6PFOQOEVHHttxdcAJq5xHYTSwmvEaQDjU5hPlYOyo9Jw0\ngoBJVrEKGK0pF85WYxMDtN8iZ9S10HSvxtS03rbZTcPJ59ZympgswbkGqDIZ\nwFfeXPXTLH3PoOLxSlRSHQA/HrzsbGQZpSU8PaRc6wJKTJO2xD2ORazmezQa\nmDdo7T/hGSSAtFNoAZTR+CBowbdxHOgL+IaBwyPUUokiro8aAWG+3LH7clQV\nZbsz\r\n=Q3OQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAnOrlltHnhnTRbTKuGz4oSx6WNd05fUFLmXWzwg8gweAiEAhysJ0OuCI2SJJb+yfRo5xN2RAHNkgAaUYYAySpi9PbQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.23873b80_1543425991928_0.3869753913959646"},"_hasShrinkwrap":false},"0.15.0-alpha.0d3a052a":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.0d3a052a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.0d3a052a","dist":{"shasum":"4420d6892eea49ffeb6cf2ae2b4982f0326d4985","integrity":"sha512-IFJFW+1l3O1qKTjfLh4LmVIsP4CC1vrJC7WqSvljJQWOqeBwWDliSwlhzMOVjD4EO+IRZKGbQLViLL1krqTIMg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.0d3a052a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/t7VCRA9TVsSAnZWagAAhCAP/R4nWkVUlp2tZkAlTDJ5\ng2vTMkfjCVQmBbjMKbg0e85M/Ba2noCUttCDPGfyepmeXFV5OjqEN59VGCU4\n7aeVvUNA0gdn2WYnNACrvAPgY00kHVytK8E3k6Y0iT9zmbWOu3LktyGxQAQR\nJC31EXXb0bBY91rhhuFuNI8X252lD+oFWH7KKscrPpq56nHJOtEePmTKWSKQ\n7MOi0t8ONNaCx/e4xnwdSLyYF9VHNOARp1INAgBd+Qdt5Ahbqd58CH4K7A4t\n4+OHVJv67De5+cZ30W1YHW70eJr9UbhuyDPnqJu3OqXBAm19gDBoU7HQf2zj\npFDRphxX59gYkul+4zp2bxvCJkhn9voGzoIK/OR4eXQZ8LHDaf7/8jG6GUdt\nQvsJA+qLc6h0vS0kK1TXexHLzcg+JlSfd3osHfRiGzfCl+Uf1Q/KkpH3+WQ6\nMMTPc81l2co38tUyGyIbBdcUaT7Fwq0h6kV7JRj16qWmpvNelyQpFKEjcD2z\njyS/sdOYWZ2n6tJsCtJnbXzoaMloSJ9epHbOP8dhavyMNlFN6ukS7Q4ySR4J\n3HIpV7mB4FlvtaGsRwW1ajCxPmsbpNM03nKXfhfYCjzyUaNv5GdfMSTcEeoQ\nJeuMt/1rONEOBvm+3e5hlHsXojuEdspmz/bgrjr5htoVCND4JTt/5MT9cI9q\nTUnu\r\n=qi6S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDghb5aBHNrp7c9LbFulz771tzQ4VBMQE+PRkf+TTARggIhAIlBuHHOrG1thdz8z2Bk4v6kWgkIM8+5+pLB2igKUQmo"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.0d3a052a_1543429844798_0.6462885675100323"},"_hasShrinkwrap":false},"0.15.0-alpha.e6da3ea4":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.e6da3ea4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.e6da3ea4","dist":{"shasum":"4ba2e6f1667c33b578bcfa7d7aa749408fc72505","integrity":"sha512-oWY+owDcSSlbRMsRKmof699GNVmhPK4rhmWGKFg5gYkfZEffqLpf7lhykXxAI+Y1KE3ie4uzLycHQ/NmgpirvA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.e6da3ea4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/wqOCRA9TVsSAnZWagAAhaQP/1yVr1FaTMjuXXEn5Iha\n7+09CrORvPax18ebP8OLtxNsmBCj1crYhRzyFVE9PS1tf5dBwziFLgMfXbVp\nsxvWBHQ7o9jofN1i7WeAP9ec08OUBMqUbws7SylnfSALTXPVnpcZBKeOIC1g\nW9zKOewcuInB3eZ4kwpwCeVwSHVK333RmwchXGqSAgu5KMuUffLxzZG7pTpE\nl5EX79WCrzXM+C1gRcIphlawDTs5RlYBR62M1cumSo/nIlaN1bqfbYOafAx2\nAWSybr/1X1F0ysOPFhjRy96uC4l1woeeSgE/xCPx2dDsk4MorvS3n8rudyb0\nsrgizlJvAthrfrrDrWfspnrQnuD4h2c0R6z18GG0WQz4HnHGXCn8wuXkWa4M\nElThSqMERPolU6XunUHRZQMwO5CPOU0JukOVQCKZzEydiaU7EFW/WBF+eEFM\n5VULmm5hz8PBjxTaWYnCVqzqo5DRVJ1ar3TLVu7pj6h+IJGYjgKH8uOQEMQw\nEPEAy0ettU65cNFNtjGgKxvbaMlLhX0KjUPRsmFOt9USvQElEltrUfxLYxsm\nJgx02L3nxJHym0d2Kjj3yN5IXcxG9XpNKqK4Nngq+FxtiSZqAsFMV2hhQ+gp\npleteO0RbGvsYC9Uxgk8WyJlONU4rM4Hywi90vDiGmvdlZC54Tz1X39DdhJp\ngn5/\r\n=3kOu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNzZZTW+5wEanikyNDt0UprF+9kJlMcPOYDR+t4iZDOQIhAOZYDVTaWERbNMoO3QCpXXn96Che2RuG64ZGnG2ZXTHt"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.e6da3ea4_1543441037463_0.5492023813873341"},"_hasShrinkwrap":false},"0.15.0-alpha.0838fc34":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.0838fc34","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.0838fc34","dist":{"shasum":"f04d942da2c5d0cd65c5cae418ac58f0fd6b1323","integrity":"sha512-mgAiT3qidup4lbYetrj8suoFEAX2ay8EF7QooV2e42SaS7VT4G7rfkDcAMM9PuK5xyIOmvzzl6qfk0DTPaBMoQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.0838fc34.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/x9YCRA9TVsSAnZWagAA53cP/RrQfWw3LB0FkVpU7ZOP\nrqWvbPPr1cI9oUvK1vcjAAPqVuSO8Z/x4vjf9bEmXIxTjT6eJd/SuCrSewCo\nHeiUSGexR3ibSdK7EHGzNX+H39i+1xiL8/rnQw/6pjfrjnNeKWkqFLmAkHOx\nkwg7nHaAWGHWX5DyWLJU2pYSXtrxYBLBQB2FK6IkryAp2gI6cFFfGlDsLpjB\nqwpYalWyR8ZtaDY8Rlzrn43bQk9xe1D2cJNgbZffkn2F9kLV+KiLO/TWL/lw\nDkGjHS4r2xGFateWBtARnsw9MQGh1J5tSIyvlX5qiy+hJYfs18hb3emNvXn/\n2W2PKjftQ6KVNEjiT/KLlfA81NV+OF58QgA06KaKkJmKbxyDPlzkB9YBrYc8\nbXa+/isZg0hEY4b36KRt+2q/PSBqP+2FlBZOGZVBeeYplOUtxonvUf5vo3sM\ng7IeDYfr4yVpK5ICZqyc9tmcONjbCs4+DvEMAuXrHucHCM5aWEiQpMpOdqx/\ntPL9PMrW+CD+HcQHkLF/85ROP6wmz0JTlp7JVsr6Z5DHFu5bJJ/tYGKUQlT2\nPdCLw9mF3KrUc0QkcphGleVaRBQIlPkxk0CRoAUDSptXCOJgOqYLSbgtwfFF\nz5zwVzHLYXrSNLv2Vnv1h/RYrg7VhqQC9y/RxYJE+Ej0VjdU7YNZB26HZH2b\nJAhb\r\n=qKeb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA29JOjhAjB63XUCGcAcDKQiqg6jwUaBzeHv8vY0kvoTAiEAu7ZPXOMar62T0jIS1P75Om4C1TiTcZ7dUod2hlv9+cs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.0838fc34_1543446359656_0.26386539349345495"},"_hasShrinkwrap":false},"0.15.0-alpha.8ecaa8b9":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.8ecaa8b9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.8ecaa8b9","dist":{"shasum":"069689e97035ea7f72981de2d8403949cc42633d","integrity":"sha512-NL+NfP6lSktj+TAHQb1WqvRK5BJI4cLJ9EPY3NDsKHR8o8fZri6WFzuuKgyIkCrGp9GZqTBtjukdY5Fq4QBBHw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.8ecaa8b9.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/4H5CRA9TVsSAnZWagAAeJ4P/Rak6qM+IioLIs3z35sQ\nB67l/U+nAIkf9bHy08QpXasHSviVuPLeHqp++4BRO8Xjj/SuW+aERVepv7Yi\nRaki2XALE4EP0s1NBpfLgRUob2Izj6vBz0j6TrKimfKNqr3SGnEughpRFxqE\n4lJZLliPGzPQPfiKB50S5AnmrvOvCBoLFRNf6y1ZEdETmckPucAnUisUR/6U\nvWXEJpkJto9O3dqpZ0M09v4ue63UviauE6hHA6/QFdfpMlWJ7vANMP7dEK7a\n22GXtRhGuX6IwWu9kk4BG9yRjXhvmmcLpH/FHttIElFEVwmxSM5SIIrDJud7\n8Z6m24KQ4GZHWILf+WJ47D3j0rwF8B8eM8CMhEPU+qHIiU79XP6H95Z6XBbp\nJebj/YhVNvX7ycGQ9Wib1t3Q39RZIAjyxL8qCls6zxnJFATcU683AIQxYEOa\nXUk7cb2eNKwSeL3Ep/gt2a+1HeQIEyTwAc8q3Evzxio1YZHf7VGjE59da8X8\nfixdaXp2IRjR8TgbAbubkER5sJce31mZd4/s9XLPqDBgmBGu4nT44nTAe2lH\nN9lPHpU48KyMBKxdYufq28aOm/HtTr/cbCHh8cLetfpmnt2CifF5+kIBcpdJ\nOhSZMyQKoMq2YQqVYCBoblaXVF8i/4CxtqYpA6xJFS2KF8YVsn7XEo9x93s+\nwCwj\r\n=KQN0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG46N1R3cBGm24UYd6sqwnSO23+V75IXuCEMcMb0fYlzAiAgEDe5kt0aosIkli4FlXsI2OJib4rw0n5d7171XgyYxw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.8ecaa8b9_1543471608522_0.24372882077486846"},"_hasShrinkwrap":false},"0.15.0-alpha.ee76c57c":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.ee76c57c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.ee76c57c","dist":{"shasum":"9d75038e261c3eb9df73f444af916232c5348e28","integrity":"sha512-uT1v5jC6Czk62tX7HKikvTjWzz82nNkFSpXCx7i9zm1FctZFZ1Y/W7jLlZ4PU/LealL1obozIov5oxsuQb4J6w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.ee76c57c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/7LbCRA9TVsSAnZWagAA7ywP/ApU75VQi54Ob1KNjGAc\nfS55ODuogtrMIXiPp5duNs8tVRXUIDH84wTr0m2R1DsDoxH+n+Q2cdirRBsZ\n2dMN7ARCXFMydICfz1/NG/23yxbXCGXqJ1EdCFsqXmFPhRtXq8mqptZ9FcPw\nB5AbH+yp13w1O4l0CXrqtuXLB97QukpFV8zOvTu6R4KCLv64y08DGs4Lfvpg\ntxo7Lqs9w/Ugv5wt1HrJmrY1A3qmjRJaLvWN069sz8DfsBuTtlvgVoTcv4km\nfWA3HQ302SBYOkS4WDTSY/NKe9wFvr1EXvfZ/P0+OUMh7uUMU6EUQpyhxO36\ngJqIt+Qoo7aJ0yjvWzR9U+C35bwawsFyW5VkCHq4Cv2yZML4xfSUTYC0WyzQ\nlhYdy8YdzbnmnLCUKKB3CVL7/2V1LzLWn7ydE113CGhCjXBMm0BWqdjpAmtq\nEwyhnV4TXagYwO4fyVjwitQ2vSB46cJ2XmoagYp8qHyUgkXX0DgKJXhNPURT\np2Ld5gXZ5KRUiVGFgVcMShQIoNuyIxzZJI3AalfH8HwtGPXudZ6qJwJMF6NV\nbHSuYH6vKdnuGvJKYZRZEPPH+xa+eFoiYF3Z/IhPKt/Tk5KshlTv96yyfRxt\nweBbZX1xkWXDszYeQuTWf24igakLtUOX3aBGrJsGH3ATe/gtYIUez3gITUmA\nGmBk\r\n=SU7R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH0YcZZznJcqD5NALpytzhRFNnhCC47CXZKqIc4y+tIzAiEAyctpgthqefTZrUb/HQCAIfVObVpztbq8fN+/ot+Csdk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.ee76c57c_1543484123146_0.9259410814818216"},"_hasShrinkwrap":false},"0.15.0-alpha.816f2e97":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.816f2e97","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.816f2e97","dist":{"shasum":"2af961d5618573608c9e6b83ab3886804139b813","integrity":"sha512-4Qdv542M5IC9DCbuwn+Ct1a6Ah0Q0TJl8UGsaZ3cDHm3oiFZwMRIHeIVpR6aGtcGrJ/ftod9TN0tIvGk79iBbQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.816f2e97.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/7NDCRA9TVsSAnZWagAAWmgP/A+PoV7q3QiVxvSP9DVt\nseSsV5FgVbYQq/HRAq4/6aaEze2+cLwURDRLbmiuHMxSA4mZ3WylXHlMlx0H\nTsLx1HXQLfE9iXWekKTlllhG9/AXTxIY2O9JnX2o+8ZwbczQdlxmhYGk2Cf2\n8b4RKs2AnLiiA+rmUS/Ef3C320l8dqatYZDwG6/X6E/qt7S4h5HRtk2t/IdU\nMnT5JNKsnQYwe24DKAWvxkXqBK7+31578w+js9crPMv5fK5qg179KHp5rjpv\nbYFSq9pcXj29WPczBNMpFHq8l+UnrRTRrfCDaOvJKK76T5XF1m1whNxv3wRZ\n8wHB+B034qAG9FvQ93xI14yuvEtUfAeP51GCqBbDDIgSnutKTXLSXNaCPrjx\nho9BqDcp/EnoEJfSKHQPJXutz181rI6PPt2BNqYX0JYyE/YW1e/m5CCpqAH9\nGHUthGJy54vsgbTSacHXr0ltiKqTb4Aeh4BQaRpM4dWByLJjxsmmCx4bttYJ\nbL/OvUioIm/Bv9hldbmP3an/3gF2HYS6WOA2hkJMRSB9SqU2Wx9rONBShTG2\nebMKVkoSRgWsspejnjauZC9Jj225s7Y37eoVJNxwJKcNkEVefE2uonKgPn44\nCyyrDm6ZepD6IyxCDBQ03f76LYiZQy6iNbvPDseJsfY3DL4N9m59oF7TUFva\nGKf5\r\n=Tglj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5dNq3UKAi7nabuw+oXZrmr3V8f00+093ca/M3MslrDgIgG9iAVVK09yQYbX7gu49AaafHkuavGn+fCb+7O6ZHeOE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.816f2e97_1543484226298_0.5234280735503074"},"_hasShrinkwrap":false},"0.15.0-alpha.11532abb":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.11532abb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.11532abb","dist":{"shasum":"f9337d8eb0a75b134b5b8b5e456686a22c338259","integrity":"sha512-oRS/2w3Xs0YODHyhsZTGV81cj1RFpvOY4KswcZy2/3jpvMV7+AwD2EyPsckoLJ8aqL90KokhRPnr7DyhUHrr0g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.11532abb.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/7NWCRA9TVsSAnZWagAA4n8P/3B0Qt1hVNLI5UeV/xkd\nW2Tduv86nfuRNkZud3D5DZ59Auzd+qQRnallXT5SQl1vmhsbj/aG5xYKUJst\nB1keSxbt8IeIxOPvLGD4bcta96eDzEVdWiW4jcjB8wJUYcDNhvWszL5BUSao\n4KfVpPEWr/bw2+26QPz19u3bnzL2Rotf/zWEyViyZSuCZz6w+mbFbI3/UhF5\n6izYCs8gWUoQn0pIhWCKF2QXU2JYwicnwznZ1GVi+dmQ5uWb7sQdnKElsBgv\n4uDPQJdGL3x2CzvgTe/YihiJLutfmKHQKOoqAiUdXk00IAJgqLKGgv4gcWq+\ngNub4WSYmjf1ZSDqDPNWyJ4XeOOtWUaoL2dEHsOhoB5KYXxKQAPUTXh9u2OU\nTIOyH79ldoNWloWllWLYoCzMYPXAI/PCAttH0pNYg/JqjVl8TdxQajOLSTa8\nckHEUnRriPHekw+AdHI20qdWp2c5F9ssRu+tUOognzrbMFWvw26qcROw+Q8G\nN9H82ynr/AoTfVUyLZ62+F8N5EEOMF/BiHWy5AN8mlBtUhlgjbuIrqRj0HvJ\nXWq2kWTjQQ5NH+LI8lmk+9LZCAFh4YWU1Jv6JIcK/EMG+zqvRTyRtYFgw34Q\nhBL3MCY+hFTDoa/odb5YyVLvdEqjQO+5F3ejAollMzZi3nMf+LpPvnXouBDz\ndPw6\r\n=lQbK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHc/PQinjlPKQemygtG2iHLELKOLJtlR8mt6nKmwDIt8AiEA8zYPDMCo7o5zcNP9+ZWhWs0HM8Rx49XrzkoyHX5AuSM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.11532abb_1543484246314_0.9056960796468247"},"_hasShrinkwrap":false},"0.15.0-alpha.5e8222d6":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.5e8222d6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.5e8222d6","dist":{"shasum":"78e5a650edfea9893ba622e7261447bcff26565a","integrity":"sha512-SdCA9Zg/BxXCPrqNtrJMmKkmEw790FC8VV7f+qG9RII2itQ+ZBMeYes9wWQYymfc/LfvpjPbYRZTakvdMVqsmQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.5e8222d6.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/7NrCRA9TVsSAnZWagAAxqYQAJ/Bwj01H6LYHImRvlz9\nHtvg4Vs6RNnyR1G7nJ6nJiOeW0oXMVCI6ag1q0QehE8Tqsarnx+uMhD3O9oE\nrQIsSZeXfjZPlOG9cdwU27JNCcNP+1MzJ59+fOAHKlfgfsyRrfNKRa/+/sLk\nDX6EBVhjaQADzSvE6tzGsHtVwFsE8YNEtkuEJ7ETOtHpw/x6sxZDz1j9dCw0\nCYmz8/QUx+4FtjAPg2FeVB4Fo0NYNbAA7oAC8NhAWD/mbZnV+Xt9rLzUodyW\nbNIuUzRxaogsf+qNouQVso5LAAjGP0NsanLcc6W3QD6zabbihuOlAS2BPvMd\noxMD0fbHOUkgNcahB3S/2ov3rtTMiPAnspW3vUQcwD+9BAF6lO3LUh0ALm7S\nx5CQKgvxMfY9PlRcP4KWNg1YmUhY9KdM4u3qYFkcUSXp1xq8OAvaQ3xjSFqS\nBwo8cW6Ym/0nxAGtFWpA+S+5e29LCmmMkHSIlzz+p2d5a7OwVrkK/QK/jlck\ngQ7gU4fEtvJXt8getmINx7TPFI7L2cp27CUJVde7YDv0jQrj7pJngNY+FohC\ndwyeAKfn830kJbvIVrqEh1U6OwWLGFCdC6w/f/0Z5MBBJx/tF+j2xbRVIeC5\nTNY1V+5LCYHEKzRiP3Bxyl8cSVPcGBMNoGjduCh9f+mG4fzaIq9LUuvSXTF/\nVgkl\r\n=hLgq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9UoFZYcIgN5hlDpoNARc+PfIfLJ0OaVfs14oRIslC7QIgEbkBohpNQ/1fZME567429rsZkMfgSNqnEd2BSS0c7X4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.5e8222d6_1543484266358_0.080141497494151"},"_hasShrinkwrap":false},"0.15.0-alpha.e3a34faa":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.e3a34faa","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.e3a34faa","dist":{"shasum":"32cffb567ddeca1eeaa51997c2bc2083dd84e5b2","integrity":"sha512-SEme6OAZ0wssiHkaDYq/NZ02Qjva98MfGWRkUZWAmYptaE3TM2bUVLgRbqdDUJUlTDpP+uUhWA8dcS0DpFyRXA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.e3a34faa.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/7OyCRA9TVsSAnZWagAAzu8P/181ZPJ4mDyjqVBBls/G\nYn4TfTDLqJaDB8ovmADocotKnFHjGa/utvPNs9HvIGxaNib+hSWHhB6SBocM\nnFx9tJzLUB/nB9YeR8sD9OjIqq5HdbqupjYVFXSG7y+4DGs4SVzyswbX/hXB\nlXeTq00IVihXAtgt+FSEk1RM0ItaRVwFuAaNofidxG1efIDocamPzucVtRyG\nWkZ/u/GgwfWqcqzgZcaV6k9XCbSGTXePkJHLdrV0/+HAwvDUEJghMu3bWvyF\nlkWTC4ceLztNNGIQWVdlngwWYNQk4E7CfgbR41GTnFXgXGSL/80LNd9UDEFB\nPzwfPTM+zevyVgQw/zUxiCLrAHiQaKrbMKffo2PPmI9rGPM51+k5T5EJGAjp\nuNPfuSAh9JTZSG9AjVC68BXaaNph962+mf2YMHstAtS5kGEQ/DAeUWEDeMR+\noENCs4H/XIvlWz5eBw6b0yDu6ulIWVrVgaz0nxNNsS/zmwkOgbTKr0J14J/9\niurfBELuL1VsERJjFRt037ymw1W/RVMuo5p8QfER5lUmvjKMkricjVOGxapy\ngZtMxVyrk7zc2/Xtb8BsqyWcwBMv6LSUSGIRbhSVWNE6OAJur+crJNQAUNL5\nN3Q80PDAzzRZUXStcU3sgZAynjGzaSjT2lHXG5urpn7sgOY0dZzrUJ59qGKb\nFnPl\r\n=vWhW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEF96Bc9eeW4KjOQitKAS/MGjvQ20xnK/g4/247VQyCPAiAWspOZadMY78dhbKobCragR2tvEAuRlGVw5kBGtquMWg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.e3a34faa_1543484337497_0.5326779362510727"},"_hasShrinkwrap":false},"0.15.0-alpha.4fe51f41":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.4fe51f41","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.4fe51f41","dist":{"shasum":"05c12c6ea7c07ce5aa6e6217dc7164a30bd3d60f","integrity":"sha512-+1c7RV92jIUffgzuKK+sHvELLLoQTGd+owgoeeP+T+IXXjD6QbeUlV1vP8VWhqQmpxi9jmjxk0Q5sTr3kgaHXA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.4fe51f41.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/7+xCRA9TVsSAnZWagAAELMP/3x60JkRsc2O+OA7suAJ\nB3cpLwpYH6qLJFKUctqb+XjeQQ/MbnKLlsTTuffAjG72KEN8Gb2Xd5ljYtjn\nMTJlRAaLPMpUISzxtSA2sWH8AANRw+OIMD1TaD14B2qrsFnuwiUahCiUZxjH\naVs6AT00khlsCoWjSmImizyNJ1xkTIZ4OhdryNSwZw71mUwiHGpgSuRlRXF7\ndADCa9oVBLq9SxpUX2H88FgDZnbWMUMZrV1e8VvHjEIPjwUBuSG0fBB3fSJQ\nysWeONeB80+uqPkyQIdw5CFQ/pePGqD3Hwb7qnY7Qs7Z/RcMzAxT8iOn/8oj\nf8RFSHokUDUCLXHEmbySNabFPhwGPTY0iZe2sf74NOLf5Ps3oeU43JKYDxGH\ngI7CfkZ1+cPFvsBVDpmOKewHR4ZD3Kfs1khCQmihhjpfrZPaRRA+vGxM/TPJ\nknkmmR8cBEBZ5ASu4HGOCf/hnwSEln8RjhyEfXA7N2lkrAtiE7sGIkInKQFv\nM5CgA4VtG7+iXk03Aq0uGVbVKu/BbcqJ5pecTae0k9c/NrbMNclfybrJ+wB8\nlZTbEkLyt+yQfQ+cFS1AOZVfW9U1fmaSCi54lmMnodskfup8NZ5oJt3BJvp3\nuMEPpOIxza9b4sPOS/T36hqIF0yRA/DQbdwtSManwKYRY42pWJ0B2PPbptYH\nWVKA\r\n=XMwe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCY8VtooOwWWLln1CPIjvu7X8zrDAInmSX+wlF13dBy8QIgNZRJLJRLOpd9JMDCY6NvsVHjQn6z7TpKtNfcFs2g5Ao="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.4fe51f41_1543487408586_0.19395757083416054"},"_hasShrinkwrap":false},"0.15.0-alpha.a5594a51":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.a5594a51","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.a5594a51","dist":{"shasum":"a73bb1bbb0756d3386870cfc2fd32205281207c0","integrity":"sha512-4Q2IaKbnXO9gBD1bxVbP77sdtWcJ4DIQnOkV3ju/AnHfGZ56Tp7fdpBeSZGtz3OcCjxd4X05BBFlVC7BzKMrbQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.a5594a51.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/8A3CRA9TVsSAnZWagAAqGcP/2KZnwhHR0Z+EbGqI8Dn\n5jcC44SKqDQoPARKmkvi6XnutvHDqBNm95qEOZGjlCvzwkAAqGH7CBLJsUiq\n+RmfxLGsBL7Lg8h/cpNMCGx9vgu2m1I7LIX/Qnf5oO9fguWqBSUoikOyufuV\nPNE6UpbdyPA3TY1ERbenIYAOX0N9kfZMG008s3esRTTMxXzBi7zs4uU4wgx0\nOWWW9x7jA5cVzDtiO6RBqbTO5DkZpbgNDmEPuw2CIKyuzloGiGtlouytqDyD\n8Q5qfkr8ldA6jq2Ooi33IkzRM9VDoLzQ2hEBIgsKZRq2IorbdQziJjeKjtpS\nvOOuoe/5H+Kb1uEtRIUUm+0ZBuWmZLmzpEblK2USoP8aekWStOj7cy4IRX6f\nq5TY0M/mfiJj84pqqb/8Xse30W7daOo8eGR85DEXQlU2QJMk76MmwmqWN3mt\n3+aMAGS0+4zadIAXqXms7++6qhSAs0HVoyq8A4q9Vv3kP+URQbi4v/jaLlMD\nKwWG9qTv2+aOyYKTreUaUXXzjfn21FfNXMOG5U2ArPuTDKJsJDFCaS1aV8Lm\nFBg8kQrFnf1tth5fcnbBoSh9rljHkvx07hfj3p5deztkyRKhRSJ8e4a+O1lF\neqgDv9xOytTHzdrr3p2WCgWVEAJB35g+WFQAZXxA6Ue3fXTo1CC68DqRzpr2\ny1Gg\r\n=5//Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCANd+9YtRaxm9ql1K8T9VlPkqyHHkWCmIxk0QM8XhgDAIhAI/scEVpgnEEV8m6lkHgApy4//cxtRZIOjIHlq+XvSDN"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.a5594a51_1543487542670_0.2567865436789618"},"_hasShrinkwrap":false},"0.14.5":{"name":"codegen-templates-scripts","version":"0.14.5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","bugs":{"url":"https://github.com/dotansimha/graphql-code-generator/issues"},"homepage":"https://github.com/dotansimha/graphql-code-generator#readme","_id":"codegen-templates-scripts@0.14.5","_npmVersion":"6.4.1","_nodeVersion":"10.14.0","_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"dist":{"integrity":"sha512-VVmWgDBQb/xkegJOgBP5bV59J0HFsNrNiSKZj/UOF0bD6J0L39P0HQ/nAZUaJCHvH8jF1BXOkuWHdqfue4NPeg==","shasum":"a96a337ae89c2582c0ad3119283aee410e6398bf","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.14.5.tgz","fileCount":11,"unpackedSize":15138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/8CMCRA9TVsSAnZWagAA7EMQAIUMWQ5u+hWcx+Tu6wEs\n3YYyxzaxj8LBSxZzj6FKmFMVOfWISVhQ5mYP6nreWy7H/HBlJu3u/ZFRwBL1\nozXnbgMdml5cYTugDQVMYnaNKhxidTW32Iq/JPicgG7tJDouryP2BJj2ZLGP\n5FD1DTAH+iXILEamtUPZ1wzEtbURUvkswpZrjdiZahZMPrGkkKa3p9Z9nVul\nCmz2NJdlBVpaC7TkHGw1znf4SxCTJIQc0Ulzo6k12KxMn8aa6edtAYGOOw/V\nqNoxqKa8KD50oEZybLCHvjsIvfl1KVyRR6kTTnkgX3EEeqCWK4hrcVuqDmQL\nFhAWgRDlmBagwnmQoM0LxupNlUvsy53FFtvzYlG4uvAziT91BGrw+d/6eTRD\naL8HFoVqyR1N42jvgM/L1GFvXBiJXSoGYaSSVjD82dF9UZlJl7lpNyxJ4fJQ\nlt35JFEKmQ3FPfcE8qd7ckk1QQg3H5TUfCWfPyDObDInwSvxXT1QPgByIBfl\nJfHUnfbzNBpYeZIZ06gGq7vombwCF45FtEGouFTkGm//yOp5xJNTqP7r+AJw\ndOngYXKDNmEA1uiVw6NB+FkmOZ98mccplsUo4ss/9OsXH0CtOhr5NBJ+1Upl\nSRf2MrhlIOq2FCaywyCRNjr/WEksBbw1nu8omG7Mdvvne8u2JMnMohIyDrQW\n4MH/\r\n=lcqV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFMM12mKCTadBS5wd366/bEgbXj83Sp26ptVQNG5rZVKAiAX4pjfY+BL533zN8IMTNJCaeUbwqTbVmjp1mDnbbwsPA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.14.5_1543487627575_0.1761348027307803"},"_hasShrinkwrap":false},"0.15.0-alpha.6b394570":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.6b394570","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.6b394570","dist":{"shasum":"ea6ab020724aeed65407223d434cf5c7c2f8ab15","integrity":"sha512-8msf3ogDx28MlvMeBb3QG+TLWFeKBWL5i843GXk/YVxmmgOn/6x2q2DKutc6YyR7U5VIZYXX+hZ1sySeZPXQUA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.6b394570.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb//rqCRA9TVsSAnZWagAAqcMP/0m9tEjJicbSDt8+by+F\nDyXGi890CxREYtXzJeeXzr4DjhtVGNssM5rU8FaWuoWNGWNv22wKDGaXiis2\nmrvZKfoVxQa37sj80XCBwecW/2ebe0NrAvF27hCjshCQu2wItpLJp74uSJzs\nmN/YRtjWMN1Zk4nM0Pu9kLKqNsJgwO6odUUIFAB/KjkCV0Z6fRAAke2LgLcy\n0Oeh5BGrn+MNdwwGTSSSA6eh8iGgQ1ntH6fq5qVcoveEHtSD8kT2PNCxjXsf\n2hQeaFgix3rU44q2QvNYgsfiqIX+u09NuJWKKIFq4YOjc5hwsbF3WbiJarOY\nR9aNCTsOsaMjYqNR2hXWjEAy+beDc5BOAxPD7ARmY/TnNpTauYMq0mKcFphZ\n4CEGQyUYeHag4EqD3x+aSYUoddHh8yciW1dNckMoLtuGQ+stAplXL8Hg5FxH\npYnTsH8qSjSNj4AiodBfeZUeFaWCr4n85TGNP1SfzLgS/La5BOrKZ98fzXRf\nFEsA4q1CxL/Pb4WNBukbufB9lrRslHBe7K14Y62j9/9alxmxTYM8sAAPLu4o\niqWavCotN/3gTK+0jFp1wcvwiK9KRMdx7g6+9Sorn9dJklxCx44HDYL8i8qI\nLSqKUvKJ8BNJvWYai0J6BDuDPEv44pM0cWO5S+DEjra6UVQTCvPNjSPiMZPN\n1HHQ\r\n=v4bI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDf1X90KYFVSlPO3Tdg13equwjbjB++WYYPmMqXDvdsWAIhAL71pmW68F3IbMCQUxQ2Mo+RN5XpGzTJYaqpPykjhKQu"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.6b394570_1543502570137_0.34406937414438543"},"_hasShrinkwrap":false},"0.15.0-alpha.c0baef7f":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.c0baef7f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.c0baef7f","dist":{"shasum":"823e6610381d8c1e4ce51c759696303f940cf12d","integrity":"sha512-gTOm8GZW4S59pDA0GVAAb57Ep3bZijAQjgJHoQqfXgkLBz69zYfpqKeSrlnOhDpdbJux7bsGVIo6SA0H5gTdaQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.c0baef7f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcAD4zCRA9TVsSAnZWagAAJx8P/0Ge7V1Ey9984qmy313l\nQ19dHVafceMjE/bDPiZqd6gIYE0pKImgRFhE6L99zyrUi3BQlnWc2aeIMHJ0\nzvlLvqNVtQGu6b4buyV5VW0ha1bZ6ILpymxO9CeJfaII2dI5sXrMVsVFjpMx\nGcaEddUfVDOtYUJM97vUDWbWyk4zTSlxGhzlBD3I6/OP+WSo9MhDyRTo0ypa\nkb6y/Q9XOKLJiB/pS5coiv7qFpVosVGmxEJAcXqF6Pftgt83HqR/4gckIlEe\n+kWOMSb5CbHpB8EcwnJKavAMECRYUcrT9+rNDvSilTSifEjIOjdtvvGCWUwD\nB3lkKo64ditlVu4GxK9QC8vop6vAF9tFc19Ijd437D8Wf1q9HtdkNGGAG/MP\n+/6ud1oKbHlPviZ2wqKRLg+Iuxo7qJWimcVvfJN3J48rAAEV1loPqLXmjBPm\nZcmCUTZH/DPPkXk3Q5BcBCTmNELduPtaIEJmj8YQv+BevXm3CQmOxp+CNQw8\n9rjVzE52S9zZNsRF/jS+GQNDv1zM9Ilr7akk22O1UC8utdTXLFBz8NL0kJNa\nufAmmWLklcOmVhtjj49ETG1DDXbEqcHf5RQKyYUTxscv8IDxPvJ2nlkRfWFc\nmBlYucAoa/niUDclD4A0MO7cgRBLK2zHE8nWKe1O7GwvT/UQRzTAzWbst5hG\ncXbR\r\n=KU+b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDkW2WHj2UTwr0TFZNo8iHpJvi68U7osyUIRppCQ/prYQIhAL6FX6MoRdssNiSXGi/JFzF09514dqgwCsMDwODraV5x"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.c0baef7f_1543519794430_0.8118221981487546"},"_hasShrinkwrap":false},"0.15.0-alpha.f4e8dc64":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.f4e8dc64","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.f4e8dc64","dist":{"shasum":"e988966330fe94bc5d0c41278b6bae5b33a5ef88","integrity":"sha512-KkrI6h34wsf+djltOvuUXTTk192gJ0h+QAbCts5SoZTitzfaYUr+9HBudFUU5XfM0euRbN3QQLV1FvP0YtG3Kg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.f4e8dc64.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcAH/WCRA9TVsSAnZWagAAeyIQAKJIBbjNia8UbffWzgSj\ntAuuCogDP15T3XyJschbjrHAKMqoudQ8GBZ4N1mFxqM7ROfu/3EhOSJbcI65\nSYq0l/sqAleCcDm7iuJWcBKW8sF3UdC2jYM9V23Bsw3mTE0aFq9+ABJDIFmT\n7M9o9XOFzBqwOZ/fwLr5X0/yyDfUnvHG4FdoGQnFtMJDEBXkEdb8UUDhPTF8\n/ROvD9N2WD81TgHTldx9QJF7ggvD+6C+eubx23usOxscWfzZ4ZCSvnFTxN3L\nXK+Hb+DMacJsLm5+1fipcraGryFob2g83w0xhcVRSlxdYkVVwZOmF1Kw6B3I\nAMKU/sVvBJJ418q1tJG0uwfdGvkJeXBlYPo+L1oJ3xnxFLpoeFrqFccV1l3/\n3qQ3SMJ4DgAmSUwQ5lKdmFRAwVOARDE2TsXAbLc5uZwqsI9X+MEBdYrrCRHT\n/OWEzVUTI3vWv0dDmI1VCM/KhY5N4tKNS9NYc0lPTYPnCNAtK4zpRSyCPisk\nroY2L0bFigtch/khbfeKiJRiqmjuVm5H76pUcsUToW6Imj3++4r0VRMeQmP6\nahXKR48T0DCDXcVkPxZuLeQXC2iN5PeLfasUSZSe/6OukBb89XPO39M2lnOG\njzdMUJX27cg097yeqw3eKU1W0OcHwMSFkjPzNMM0tNSGWisySKDKt/PqzTsF\n8Bv0\r\n=gYZP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGotXhiJIwAFasBYqfEWHepNSbdUTfsuL775py14vgLgAiAFCG4XcfaO4PR/l3G2jvVF154cRylmQWHa47isPvTgSA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.f4e8dc64_1543536597226_0.9971395559201957"},"_hasShrinkwrap":false},"0.15.0-alpha.36fc202b":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.36fc202b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.36fc202b","dist":{"shasum":"d8b2debd8bc16cb1440b9fc708cf3503a6ec54ee","integrity":"sha512-xasofLjAwYJBZpGUjMrIbruWjVCdqUMKBRGGWWNMJAOjC8V7kOR7C4BNJc9LtytNdI3/Xj+nd+4mE1SBJLe9Uw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.36fc202b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcAKRfCRA9TVsSAnZWagAAC6EP/2/sSN7mO3xyan3dupaG\nXKRnzn3w3EDKYg1wnq8fi1jtai+ckdJW3Twpb7/a9jReI64QOjhDT6FJgwbH\nkr5hX7Jxb1iWL+BPfvYvI39CPn1mKKU55Tr35xyv0du3yhlMBEIHagmPDSjW\nlN/uFu5AN6P89BWeJTnMWjilcpCEIlVYWgCH8hUw1m6a/U78JIuLMOkO9YLh\nsmOsAkUy2BgIAifEp6oDy2kzqFTGeMTlnCHgpWKe0eXzehSnf97xcex96HY7\nfR2JADm8sKFEjOvdJr2S1L5Ouc5JrlPVZSwxHueZ6S24SOuTPfKNWFELaJaA\nKBQXoxNsgABIJgD1A9Juw2L6OQqXEMIydJrvLdZiApRFa0Q59Ra6BiTpHEo/\nv76w+StQbw1Mq8bz6WFAWB9VxOLtzS50j0g4UjcL6hbUkC0WMIICdj2BCEA4\nXric8BkidWLBIo+yOntImSEeLYw9+la8ttpAv+nHEjfO7QlQC+kyfhDNVK7p\n8laJ1MaVjnxLTsNqgR67R86J0NFEFRRxGMJlECiOycbpfPnSDth4WwEo8Vz4\nwN3gd+pmqOCtYeGLTT1TlblpM0f53ssvU75HMaw+e9oShveIs5XmiDgbdXMH\nfNzKSpHo0fuqXL7Ne1JCVAaUAMqGVAFYslgwcFovlmUf/ymyn1bHTwoYOePy\nX96Q\r\n=OWDh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFOLAUj7dmhmjVTRgCNOcgxYl7VVfAM693eETGwo/rJ1AiEA417T0GmJI4NNKQl2CU/gZYp4lvtgGjWkBjOggqQtqkU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.36fc202b_1543545950921_0.4484344154065869"},"_hasShrinkwrap":false},"0.15.0-alpha.fcc857d2":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.fcc857d2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.fcc857d2","dist":{"shasum":"864a486e527d4129be2dc7fccad4f48f0ff54b56","integrity":"sha512-4tJD+UcpIw36igA4EKWEHnJ4ETpaHpPyWN/jkNVgh8jCCNfKctuIj9IDlQ1csI9KSjhm3eCqAb+sr2ITcy5O+g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.fcc857d2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcAW4hCRA9TVsSAnZWagAAi8EP/3X4o5f4eMhJJ6cTOeOL\nxyS4RqAz5Nrahw5qDmXF7bbUyL6yl2oQxQBjnh9q8RPIf3y5MOXB0uWH0gna\nOKbv1x6rQlZe4AwTmX6mGL92MoMcdYkIDSgsgSmWy0mI+tgZ9STBwNm7MIIm\nUfRkbKFWnC4T/tgkQBhlMraUA7HKenW+hs5Tg8CZ+elJ86Z31ouWFIf7hnTA\nO8Hbhl36PSw7TFk+C3fe9OceNHVA44cmueXFoKIyrBjUTDrADwFeLuzuj/4w\nXsoAurkpHr3QparXdZaP8S10WoFRnKj1DiF5nFa4ZLVnooSwdT9PrS9Fsw3G\n6c1U7P1nhAWyVsNzS0sI13qPLgiV2G1xodGIW1EbEb9YQU2u0OSt4+NVQTHA\nJPlTztWcdzzVx8iFgrDYa+4VyO9TLgeRmyfwYhF7EAEGhPfT0+8mvD7qTqdE\niBdlgTs8pJJBpId7uBHGaH2m3FRhZL2WZn+6QJWFKpTpY4AyW3FidCjXYGIb\nGQ4nl67pmTvVQ0tDjXXIqLGf3e5eU0DjTNMtG0dhoVb+eeHC8DsRDb1WS7Zk\nj6S/w/WhHzhgfsRcoVTzepQRhDVKeFFl0x8SSuK/+2c0qGuDrBaiOz7/lTAm\nqtiWks/BnuqV59WhUbbJ/DA+453eRrc+iCi9LMI882EG1W2u2FwZiI9MJWQl\njeQj\r\n=fPOK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTYQVkiTA5YIuR+aU7vWAtGpQ/TON/W9F03BaG7ynFYAIhAL5RxpZEpE0dWtRbAms2iC41LxNYncsUcrGycrtIOXq9"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.fcc857d2_1543597600737_0.1970147281796386"},"_hasShrinkwrap":false},"0.15.0-alpha.23583d0d":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.23583d0d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.23583d0d","dist":{"shasum":"3d925a5f612a9bff324e77366aa000720b9a7461","integrity":"sha512-jq2FIHPFF8G6fyAy0Rtc3v24Bl2Vi+VXB3FyOB3W9Im7DC0eHuy9xCoyEDcz6I6cdeTYab6Z6LN4VkRdk24MkA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.23583d0d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcAmbfCRA9TVsSAnZWagAAJzAP/iSnikDoMfJ2RYw8zGnE\n9r1dmSHZgH4sZZ1S+buxA6jwVGvBPRTV2lQ+xh2XZdIf94+bvgsaypKQh+7G\nn7+b4W7FAO39rHoZQ88qAksnteB4KCv0ptkwmLo8yqAIunRWkCK/j6bV1eR3\n7NkT14WayLLYOBGt8axmWfeUkJEQDdT4yEJU3IGZUZHML5cAi2PGtxvuFuYo\nFQFHDbfpAoytlbfkmNuu6LS1cYBcmsLpP0tuH/joe045LbeKSQmlIyE+gCkA\ng/fEVgZN71xrNThBuLtzLHuNlv8/hr7CCx3lm48Mvl82R9/YzU8oae8G1pps\nwT2CB9iWsB09j1BJjhjx2kBJxQmzpIR8GkLowa+WBv23PUs8D3FoDnDbPVJt\naJysHGBma/51Mp6POBoP1Mmr2PnAD8AcSU6MhB174SljIUHMOS2AFcDb/36S\nJX62vUBSTpElaeJgS2hPr9POq1EK/tPtgNhczM8CIZwoKydcKfzJEDbflBpz\nMzwsZQALtxlRxUbEkdA0tc1WKfJW3jlb0LeQ4VNBCxLXNkYxTMKRLopdq5Eb\ngUeTEH6q67ZMo25XVdlKvR+k7rWZi8NLsntZJjEuEBZE+C3M5nl9tATpG3jJ\n0ANLZbevEPC1IWuMIQytrA5moae0YwiLKBSiN3HYSmTYLTGtVfvKXp4rhzWL\nY8yW\r\n=W8tm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBetq1UKM3Q/3BVUYjPt4B//TKmPjdYbErWsT4A5+KUnAiBXC+CjSg5w/BB/nFk9HzvSy4rmhQ6sYs+DCf49O8HYhA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.23583d0d_1543661278348_0.6774349164674145"},"_hasShrinkwrap":false},"0.15.0-alpha.7184174c":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.7184174c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.7184174c","dist":{"shasum":"175a20120b54fd63f390f1b984b85fefaf7973a6","integrity":"sha512-MVuYOx3ntysYKLS3VVWM6De28MX/vjc2H1U6r9L4P6F7ReoanQwqwg+tu3L1bpC/9pVqt0kaKcavNtlN88CDzQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.7184174c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcA3oRCRA9TVsSAnZWagAA1V4P+QCAuGDGfwmkh2qk82Rp\nUN5xbPSSbcaNkIVdtKHUN+wamGOtkxFWLR69oQMsx4mW/stjkqfUcJTPGtsr\nT7yKgJYfG+nkmN83G/02mQu46Dcr8fhIMTP+VARXwpM5NuzDbi0mVoHzu+Yu\nVpfuEwtjYVfEJ4ohorDn59AaTuEpWKsTZT8aL37Suyrkc5AcP7RucDPFWL3J\n45mqZMJXDRmZn1IQ0QawBANhX+NDBfg1HwJ6/FCtQYhkqxGcvwMzhiPcn39H\ni2KgWfxQ0uWaVaqnukOS/11URFLcO23WFcrkHwr7AkrHGv4JWPZfHC0iVQVE\n8mXC6GOqcaM0ca8XN7dcNlo0aptDrdU8nz3mADJfhUl+vF0lt9TZuj6lIuor\nP47p8+dRHiwLNmvxTTVnII+eGmkJ8QX60UVDNGCNJX6HcxFh7MO6khOJ3hRz\nVNCfyU0TtTylo+gv+K2QB9udVnAuAvE8tTHZBdvOT70PqtLzzrLDBNrDpA1w\noFQbHmd2rMwSRGs+PsgwSQGvImPUARCWg35AxgRG/AA6Wms8VP3k8JIf+Jg1\n/fRtmze+Pu+k+cqxwLy8hNta8VEqSVPrtl22G6uIn6YIN4YzBiboe/Q0iFul\ncrwH0oU+6W5DKXUckWmdbPmGAvr2LbtMweUxU8Q9MtLhHbL4Bi9xU20B/i4U\niSyT\r\n=zdCn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAKEAgHNkX6gA0QvMJ/Iwlx4aLwy7HdHjCL3QIBiyl70AiEA5hn9WRE8vrxh1SCgVg8n4AQfYfB9SdL8meWsU4qkxbg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.7184174c_1543731728550_0.34038221872907926"},"_hasShrinkwrap":false},"0.15.0-alpha.11d53f49":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.11d53f49","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.11d53f49","dist":{"shasum":"a55e4b50437141adf0c34497cd0303e9117497da","integrity":"sha512-2Ujk6fTdb03YoZ2Tduz8Q7SiNkB5NuBfnP/9IbPrl75gfkmp/6LX1gXyUda7VcU/24FACSPaIrb8PRUmoWLgIw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.11d53f49.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBHGeCRA9TVsSAnZWagAAx/0QAKBXPNIevnRBpUPVMIFv\nliAVkMtMdKBQ6OIMZHac59vNmK4eNh4clLdNwaZS3vtFETLfua/BrxHCyvXH\nPxvY3Stu6P2wkJCSuDv3tCcrlAS4ESnPVyLCxEDlsRicrEozOVFExtP/uYGe\n+kXUuTSbUzHEhvC793kdOSKKcm5Es12NlloVluKbY03zKBCzVMc/gx7gUBka\ndpAgrhB+DiwwGDR/19niBZB0VftY3uYx3soeJjjfCYyur2+/T/p/hUTsjIMz\nXuIiXOyhHBAKPsre0KKLVn6Pti0EdiGcXblFLY6GIv/7LqMaa9PGiAwACGOw\nl1WWcHbmhlON5zaWjC44MWSRpJNZxeLSCuHI3MIhUd0Es9gDppYkNNxutnfS\nZqpaDmb9yGhn5aVIW7ITkmPFsaDVd4DOm7VRhC8kTPzr7yLL/TQjNC85F+Hg\ngjb0cVUW+GND93X1iidOCcmo7taHk86jrb5GwGexRGeNFKIQTqe+9zrdWA8S\nm0M6+H4+szFfrl9VlHTN+sUtpGIXVgbex7FcwixNdtFNcdKvQA8FybRQ2Jny\nOUMRE2NgrCzvOYqXOipv5WLyW8colYNTZyKUlDsI7YTu+0jZK4556zMfF/++\nFXrEFJF0gtsfJ35jsQenQOKmIWt2PxCwKA5j8DP9IhFwz7T/yD9pei22/uKs\nTJ4p\r\n=woIP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDCb/Iqexz6uq/EKuUiKkG9/hRQ2Y0lYk3cXUwReKw3WAiEAm15fyXswZo6i6Im6e0Ki98X1lCIRsDKlRcZAj69s/FA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.11d53f49_1543795101896_0.3562825489716832"},"_hasShrinkwrap":false},"0.15.0-alpha.96a10d49":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.96a10d49","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.96a10d49","dist":{"shasum":"3c2dcca1b874b003c8a1fd79d104c43b1096157b","integrity":"sha512-vkcuyniGhG8SfOPNm4tHUcSAwcurZCyx/mE8erkOhDmQWaApMFvzyCAU7IuX8lVguTE/XSp2tEZkIe//EBBwhA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.96a10d49.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBQLLCRA9TVsSAnZWagAAu0cP/iw3j/oq1Dke1Hj7YAWh\ndpWPMSbzZvWc0+RFYl/oem1h8n5WJWLgbWlsU6Hid8aqvT2usOiKCE3pS+a8\niCDWUN8zUmP+Jv01f4P+OKrVdttQYfMSJ5vv5tE9jDvhNtnTEheX0VpfA2fN\nqE5hD+gZqIWh/TI0KkzePpYLSEk65YBv80eJ5jiCB+54s3F2ljcQUiz+jV2X\n/xWXTJYrHzalmjtIrEhwbmuQzzf7+eYkIHYgNm75bzRr+aJNqVQeIArDjNYK\nCOUY9zLrU9iPc1j9CSLSrs1BrZhNL/ElqxNgan3RIcU9Tu4XORZuBx8VoBtP\n2k43mT4LQZGos7W8ZULWjEMtzMdOiXQVEZtw5xfKfWC5NhJQPPX3YFz9bMz7\nZ2TYRID+ICcG5WQ7b6NkoQxn2nS9uv8PvNHIfj478OLcmAdtW7mJg5B+AOgH\n+HrjkfXaGwQ34EmOAUK4MqgNhAPrGAvweFtNug7Ejm8EQbHesRG5rcgT4/By\nDaJYM7K4S8aITBNkZEuaXy9ZDH0Kb0vg5eGVzvaN5+yFxL8CVBD68vHi9oVS\nlF28d9zM/3gM8NuHPSABgBSbqmFiZNQiFkn2804Y8DzUlpdVgck6d+Cvh9Yk\ngtRAOslohTqnx1fX+cl8OiZqzTJU530OUBAOgW9s3AAEqVmK8OLmeZYubCzK\nkhuU\r\n=QSYq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKIyNBDwPZIe8J5Q09eTpdW3STL2cMuV1NMc6dA1+zqQIgAY53996vZBF795MPYe2w4gxpQdbpG8GjZds3tThHqnI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.96a10d49_1543832266250_0.12557271301689776"},"_hasShrinkwrap":false},"0.15.0-alpha.cca061d1":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.cca061d1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.cca061d1","dist":{"shasum":"29915ef14b8eac1df5aad76dd4fea92b4a147950","integrity":"sha512-nlc6KCfTLD06GpjsDqfKsYhkQ5uUSVKXuqgKqNZ4JPWbLIOLkiwqyFDyb2lmArX60qpoihBR3+wjheOlYFykDw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.cca061d1.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBTfVCRA9TVsSAnZWagAAb5EP/jl+NeOou88E4T41SQdv\n1RY3E7LFbYkKXbymqPvwAiPjIpGjcQI8PhZRnnmNk6ToTw/nIqg2YDJrJzH2\nOL+lhpOJLrY3FWvlnnjis+3C0qgztX92BqR2n8Y2b2BJP6W1ulLGXaTfLwsC\nPCr+Ucr969JY3nLkUh39K72YopdTCSD/W+LQfHiksKO7MpwlHKncPN+15xJI\nCo/tFJbbgmuzqr/1olIh8qP4Z4SS49VU2cqDMHqlkEuLeGod1ZDTFn3wVguP\nXPKRyREQyP0eU/LboFmPZPK/VuimbHcwhrEed7DDkQidTW1Fj2VSKHxFRJJF\nxVgOb/5GziOh9uX/FdCiP797HMcdEUODQ4MQYyHq86ZJ31kIUNkGxF98RZWj\nhhKtMHCoCJr6raoujKqsRN/R5CC50EjRuZxF18wBbRW3ZYXjKZ4k5dME8wg+\nQjvXynGF/6no/hmVnyblK6vmRJ6SXMaLX88SiRmv1X4hU75iVNpbYQd54sYp\nqK6oG//HfyYnbV5HbMrgMMmk7L1c74INTz9EiYFWxNIo0pZPnShTtt3tLj45\nPwoYLIGxpdtZPL3bnjTpLO0BSNxJZHwmBpHUEreTr3b3w3EIbg2OyM8dv0xR\n/nMEHjfJuMwcRYrZTc6e/mukj5zyN1TgE1FkcturEAy4YihRUfe8aJ1o8YRH\nHRTO\r\n=iQ4d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEoCOy3FaGZPpN6V+mUwDXUZpOlBnsCI+8zFxAHm7K8XAiEAwoSiBojMg9NvdXElfm54IAWVZ7pVcOsn9Zqan6dBekw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.cca061d1_1543845844251_0.3253307488988657"},"_hasShrinkwrap":false},"0.15.0-alpha.19ccda20":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.19ccda20","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.19ccda20","dist":{"shasum":"859be0212f3a458ec2ca2f4ca76d9f15618978bd","integrity":"sha512-hvryLPYlunmx4coXjxq+Djf4tW0w0qp50Wc0WcgK4YrmojMCZcvgdAyNEIxF5zaUkfPLLrHNxTvxMxAjMpTNrg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.19ccda20.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBTfbCRA9TVsSAnZWagAA74MP/j71F3erLWsEBuwIZP1U\nO0kZadqr22/RZt0spoivEilNxwiMQT7SRPhKo6lkUg0eJxw7tBR8WYkv7v81\nJ9jkHh6MxjSfZ32BlXHU89LZzkXsN+u5W06/Wg6dBRMYdKisQt3wyK9co4G0\ndwCzcTb+tGrTwaT1Q5gaiiSYSxjfxr6GkbY3PzfeDCjGGpAfJSnpe/QTesLu\nmDuTra92bWJC4VICP8NX9J5vZXLgpC5HZvcBxZaabMjZwjE+8rt4NrTZfm5m\n6LCElqwdIc+JyXuy/qi2c/swMGovkNuSJq1RESv5/XLoZs6GEWYd/zLa7mf5\nGenr22gPfek6yLslyj5honHAhGPUXlox4reSYclUOmdUnm8YK+FBrscKpW7G\nxiAWWUy9Es1XlZQVbD1qUOOrPTJwHQeHAw8ExG2EQ8pZibwNJ/XyZc1rHKc1\nYQhUevHqNCm/I0tvratF2haTpOCUyG+9SadJS8lsqsGzTxvIQ01pTqenGaBi\nbK4qwBtbVe1slapjxnf2ULd1j8jXPaFFjX7GmalMT8q0/lV5CY1Zm5HAMqej\nQsy1T54lpQTn3GcRRFO9mN/UaGV2l518bpa4OGU6q88nBZMW2DDknqQmS5wl\nRA6G+Y4tjpIOBk2rceidyl8uT47XXkGMzUR4gJakwB4a0CSD7BGkGMftMzM4\na8lX\r\n=t7iL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFbYZITQdsNVpXPSWfoBfs69MbhLoYUSgJQHjY5uq4O5AiEAhoXRb/6bab1ERKpP0Bx2oLuwd7c2aj1j2vbTQQ+fg3o="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.19ccda20_1543845850805_0.16275164198043224"},"_hasShrinkwrap":false},"0.15.0-alpha.34f9279b":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.34f9279b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.34f9279b","dist":{"shasum":"0181482863e7a198660544aab27da412ab0f5565","integrity":"sha512-QPKTCcyyTXKnRjGZQsqoLkOKPw6gx4l+W09KMe5DnQ21HIXo1itJaTy6Tc9XhmFyknzQcoibG6nombQhYHXWqQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.34f9279b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBUCKCRA9TVsSAnZWagAARBwP+QG/2JOcezA6su2N9bMW\nTRjZlQ5X9h7M3BI6W5oR/6Swo17FW//OEWOyp7VW8/i+MbuVWGHwVrry8F6C\ndyfT7Py1rKFdJrd0HbYq9+94wrbNd6B/xpMbuor7NsdU5heg4oLYQnjNrVIG\n7TeT4reYG41E4J4RB69/bA64LvuGXL45e6xT+Rsrn9MQWzX4Lz61z8yRkVYH\naTXbncxH+ZJqwcQogV5PLuuXFLwhf6UgrgLwwVnKNKT2TIEYK2qKfOu2Czoc\nw/LsQETLF714eLhXVBgTM/vTe34ttk959PoBRkpHZ3Jzamf7wLT+Lom2lgu7\nMUNN7KvUttWAfs13ijlVjFyxy83MwheZkTXIjP6wdhb8+1kmwcjbIjbkQBL7\nv4890b86+Rk22QgmNMO/N3mdZ/+/7Q4kVI78PCwdzHUZEHD0fB0nOcT94ZCG\nqq/bPqmCroGRlS7Eofeg1Co5SdswsVRNR4pvaEZIpmH5tJx+XPISLkteTXnn\nUH94PDZtbQ4d6MUIquACh+iypXN5hiZW/WmefwAWI5T9plz1LU9XKbaTzHwA\nVlj/nK1GiuT0+U7qlmEstriFAk8ydZkJJl8yY9iwnOpU8UhcUjqB6IUHH+Hb\nnQdAvlfj7tzGGI+a65guzXp1TRUx5rtYwP0QR+oPEEW8/Nvf0a+KUD9vjo37\nCIr+\r\n=obvn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdLfvGlIRarrPUqLr3L55XSS8cgvgYZMTr7dVFZgPGzQIgOWHV+U6g8MgB4++l5YxS0h925EjS1eaa7n/FcD5CL3c="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.34f9279b_1543848073742_0.2330872853001429"},"_hasShrinkwrap":false},"0.15.0-alpha.6cef8f3a":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.6cef8f3a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.6cef8f3a","dist":{"shasum":"f27219a3ced5e6941e0ff301c01802a1872b9007","integrity":"sha512-yDDPQ/Gagkx/0FjdgvYqWedi8ReHI0nFr18tC19F6t4fkxwZW/IE6RvgpLOWVqTB2RwcfbhSjMUX1Xht2hEIsg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.6cef8f3a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBWsZCRA9TVsSAnZWagAAB6UP/34oSoPg7HyGG8UpzsgP\nPtvxosLfP7sYGwB5muQqzcsFF62+PwPVwR3G1d5v/KVypLx81cdcuMU8vL+v\nkTLgO4egN971d7pGPbLrHg0wtc5QWcvaQ8Oe8s4T0aAHCgmLzaPzJrZe7owV\nSzPqHTZXUXor9eRbu05OcqsSbaBjHLuOkOkwdKGYWfMVFSAjpoi56rZinrKW\nhwewOBNaxHRqyjmkaXWI9OxnjKnBehrP6Yiyxaee6kYIfA7RQ2uTJADyDGyK\nOrggcFqDL3t7rTZaOihuALDX8YdhbOt2BBn/07NzSuBbS5nkYyKWPt+khs3p\nRn6c0Db4zBWLkfKprCntYM/T3ONFFPpqs0eUg2gqOhRRnNoss8MUoKj2E9UJ\nZhwzrfpU7fxgl7x/KWgP57oEH0Cl/0fSIjDgPFFi7do4kY+OWdHWHiQ7GFni\n562ZSsV/61Vz+WtRft+Zv11k7qbSRDESZBSLHBukdj5l/EBewO+EdHV0gbl4\nrE6OauwLMGLVpkD/RzdbfZJcqpRy/G12FyFFsW7pSElBHjPB9AArseouyGZ5\nfCBQ1jNx0IP9bKWAW9rnoQ4pPhYoxiFudK/EmMd/JTMwSPm+sn/R+Hdq+SA8\nzOq/SACiuUfqOEVDxB5pWwhsCxBAuN+zpdPipHcP20eMs6aQnX9IJS/5MGIk\nTTXc\r\n=nmbj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1lBADMl+p6vppihBilOpjLpw5Wfew3aZbxa0tvgxhpAIgX2OmfoDIQGBIJrDZ9umoXr5dRVsy5BnoNxgsQqvxntw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.6cef8f3a_1543858968483_0.9054708598389472"},"_hasShrinkwrap":false},"0.15.0-alpha.19902434":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.19902434","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.19902434","dist":{"shasum":"f14b85938b49df01cff2f740479a3d3d1a493a2c","integrity":"sha512-Q+cSpOWVNTB5aOYdq/xjOKqasyt8HvnztfKxNW9Ac9iFzT2lKZmeOV0GZUHKrlEBUDeBxRbynw8CsNFqM/iWhw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.19902434.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBXk4CRA9TVsSAnZWagAATT0P/1dnYd2o/R+0LFYlD8x4\nNKmXPEEL+3l4cyPdYIcZgcqZQYg1erbMkgwn35x3sDxOQ6LSYyzMhSOTIi3G\npGWQvyGScuUNb5CmP2TXFrr85xsRSROvjC5AEHy9ZjsfoPw07KKrG1FX7GmD\nIGcvJDXg3kqL3wpEsrE/EY60wO3BZKtyL2F4SZhb7yF36+7LdOn6UX1z2W05\nbmwDmGDKzMjiMTEJH9eKMkn4F477fcaIzVZL9ZE978qwmJr/Kn/sdVk1EI2p\nH+8CNUNbUzK4iOGqqL/0HpXCOGg3vyPbMN0VpbQLmlQl+LBkENyyzEknejsZ\nXuSnQvvghjKaZZ49AeRlehpiNs/Q1R6iifB5kndHYTP4RQmQcyyj+GGKgC9i\ngyRINKuQzI1+J40aVk/1lI0WT00qX8OxgC9fpOkiVbHdijOowZga7l9xCURv\n/342Lsrlz2N3zsxrcFzNfvLN2A/ZkTJ5TsuM9JpabgwMmFCmbVvt0D7W9FXV\neF5L/d5mqvBjoSIiLImGeaGMvkSWb6LjNZaxwZC5dUKag6BdO1472xb2gp/q\nZ38ZyNLXPo+w2bcHMtTrrrcOvtFFJkOG/Bd6tDAeeXK+Agr51vfqQNGtQhjs\nLO7UQ2R122Iso9xgkgV7D7mD0MX3GOw+ckkuDeDRLJ5tDyhl5+xjLVYty+2g\nBqtd\r\n=VsOo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAvsbZ/Mj5oI9+CHZVx/Z+jq6R4PI2Bc6VJ+9D9qsoJtAiBnCZl4e1dOvPnL6SQJaUACaggdEPIad9K79N6aZEB3/Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.19902434_1543862582951_0.10778806256843354"},"_hasShrinkwrap":false},"0.15.0-alpha.28d97edb":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.28d97edb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.28d97edb","dist":{"shasum":"2f66acc595c837909708fba588612a40827b7231","integrity":"sha512-+ixza6NsK8KTP79unEsn40NAtuhj1tznaw7p6y2pDfiSFLI9j1LQYUsfbl7g0f6z4wZrBQNyl0ofQyEmlmjBNA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.28d97edb.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBX6xCRA9TVsSAnZWagAAnfkP+wT9A6FtZHDzq9TVstM4\n6Fz7m+35L9sEmEUxLr/LCVt1XIzZ2WaW/S/qMviOvc+QnlEhfPDl/7Pbu2M/\n2L9Uy1Zuta0rcwz1Fyj/JoHd2aGcHtVvG0kPkLxsjEVkEy0ZqzixVIQV0dFc\nQL+8N8ta2DiYt2k9uPodUTrMv0OoP/H9r8N2Ow9XkQpICZYObTTGzhMd6lid\nGnDvVyM1TWXEqYlyFg05eTRpyxHdRAsb3lpRwFXc0QWFtWb7ydTjtbQDjEzh\n/iz/ZAABnCrOCmAyv2vylCFiJKAaoVPc2YoxVW2c+13inhTbdKYEu0nMQ8TF\nPE3xkXymz4AhJA1VHJ/9VJ2MkW2Ybni47d7gwzMxNvNkVCrIGCFynPknQzFb\ngu4caFnoXuA/u2oGOSIKhosjd1ttzFTXl6AgG80kWUbhlxwwT94eIOKS1i9a\noVCapO/vVW9Zbfq0NwwMT0wWbnLqO9X+dSnRbrR8c/eew/z4YD4QyP/w56Bu\nlc873/Gz2PaVg/cPT5chAZxWCvhemi/Sm8/IGZs8LsO9tAsewtX+l++hrrzq\n0v6WfCc5+lWKn3/4t6p9mA4ndrPwK0DWcZUeIkwM+djMjhxDy3Sc1maqbZhq\nWauIpNN30jbgK22Q+wOHK/ayk58M/5HnQ12O/CqysVWTGSi+H8P+0nyIjlkx\nOCDZ\r\n=i8ql\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqEb8JmrvErCnaLaxOOh7aCOWEh/eB4wwhaOQt1XWzewIhALEP93Ujkf8+fTR3iow+2BpArez45OiyOwOsuSZUfNEE"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.28d97edb_1543863984382_0.48757515343789337"},"_hasShrinkwrap":false},"0.15.0-alpha.b2f1de3f":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.b2f1de3f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.b2f1de3f","dist":{"shasum":"362614b4c21cf969f41d5fa39d7a0a72c4b56848","integrity":"sha512-WEEo9N4+jrMSt1oQLaj0jSRbdhbHFu7AeTJ/AcsSx54UsQOtm8JY6mD2fjVTY83wSzIrqaSX2UZpap6LsFQHwg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.b2f1de3f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBcqgCRA9TVsSAnZWagAA8A4QAJbfafP6P7/G4GxCZ3ck\nC9Db9SgeX3m5qrcdTVog0OfwGEd3B7Ei82YV4X8HIXhOxwboMTTqDJXqLtAx\nyKRcPevk9PC0R12Vy/HnFRDp+wG7yl3SuhCXoFCySwd2lFOcdiEHrGXHKY73\nxvvt0y3O0KUWSZDLHVupsuxmBkW8nKzNQu2/hbVdR/zD0PtKMGT4KXcBosMg\ne0YRh9mH+YAkN2c3eokoRJhFh5STRRs9FYvU0y/z0lR1V+xo8ii8tSvaYLiP\n31Hl9rFqg3noTr2CHDtmk1VsI6MXrA1INn39qYgxtF33rL86Pa396FCeopHJ\nU6AWxCGXyVUwHL+10+k2wAl+sYzWasjKDdN6BBAF7DMeNuhy+7wODYlwdocq\ncyZNGCAHeJAYwQvCs9V2jujxc6L0Jys8cHDzcCdo2p5Sh/SfkLOy2CIcggUC\nUedlVlLjVkhCL4CoJrH87o0Hm5pFwaaI9iJxVJWgPOeodKkJiUHqUQQAyxBz\nJghkhdKWzBxTPf0lTeUegl9Whf+cpqMuth9Rmn2fx6sRnj8hy8w8xugc++DQ\nhARQJ15lgfGH05Q1GUfPSnfr1w+pRi8Ep/+OJct+mTGmYRcL9+huvahAZ8id\n5KSaqn2w/fheOKodpzLYBGMywEe6NMvxL3FFB8dldm953spDwOPJ55Fx+0gg\nee3M\r\n=/IXk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC32WE9unS8yan04FggMaEunZiNi/dP55gf16Tp6X4zNgIhANTOZT01uR2zx3z7fAa6IMSl9GL6bmLPzVuGowj+WuFK"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.b2f1de3f_1543883423851_0.380084820878944"},"_hasShrinkwrap":false},"0.15.0-alpha.3bbd253f":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.3bbd253f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.3bbd253f","dist":{"shasum":"9ff3601c1f220504e4a549234522f816f2a67e13","integrity":"sha512-56M8+9i9CmglY3306H5BWvym3qjTEhf5Ee5cMRiPJGWuwpZhZ+QSe0mo43A35wUs6o1A9+FyI0DVRRL59A8Xkg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.3bbd253f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBcq8CRA9TVsSAnZWagAAS0wP/ib6CipRqg5/dXxyju1q\nr9UJa2xn6zjaGD17dtJZuh6qVaQsm07+KPXPvG1gY7ftgkKXO0m7HLC2zaAR\n+q0hwhQUEp/wzso3cZ7wI4/hRgdLtwETkorauX1SMO3FYraEJChaajZ+7pVv\nmyWCPtnqC2DNyDpbbvyqkqK+hsALRaxe6Z0EAJp23R+mvgKbas/BqvO9qw6u\nbjk8RyZR2XaPoNl1+AgcHlgckE1yUhOX9BazVDfs2UmRBzslAi8osQEe6noC\ntgGQK0RjixaNFGWIuQf/U3OuXUTjY1L3FBCqaI0XjD2q305pUnaoD1z1aOKp\nfQHx+tot1/ckkki+2C16vlGSJ0/9HpJhDk9ycUWkaMoAtZhTFbA/kUpvt8sC\n8WZNldZB5gESPRvSyJeQdbKmK33DBWqe5+7Ob6w3CvlIzGf+YQYW6IUAOj+L\nMza1JtVaOIC9xhoQA6u5oS5BQaFW20TdosYSPFO9PJOZIeDcfSOzzuAggJ3u\nJjpf7CDBlzeSJ7d1med4FWWXbaFtxg+lc586O7ZupnJUzb6WyFfKpi0G4b4D\n4bZkZBaExOeWBVgIlvGmUIxbzRXE8y0T8p7ThpCTZtqqeTu/tqsF+SqaBq8b\nshXj7RM4tT1cFN1DLXGgHhA8F+AgfDbECcW+IdFQxYAu4b22CRylJC+2OtJl\nijr6\r\n=ouPI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFGagf3w955xlf8sUlSC9/AEK+Ln1WuzZLPd5gIR6JghAiBmpgk5VM/LrrUgz81aErpN0zD/cJ0B4q1xDHPGNQUFSA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.3bbd253f_1543883452141_0.8791482141579454"},"_hasShrinkwrap":false},"0.15.0-alpha.e968858b":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.e968858b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.e968858b","dist":{"shasum":"599de3494064aa196adcf87ab15d7a91a8422c31","integrity":"sha512-PcdLtWpjFxwM78sAr+81L90i7ar8uSeoUYFQA1oaLqGeZdb1enYlRCf/Y3stH2AqlanAjhO9YJgvibkoi+mVAA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.e968858b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBcrGCRA9TVsSAnZWagAAQj8P/2y7MGScYs/rkgaChae4\noEw+DxvDIns8Th4FtrBZqksUp38qh8AnGVM2FgitSHVd7ZE2bHcK/E+irJJ6\ni8BGRVCoJxH9sPUej+qizGmpPWf8wefNa7ivLPtP+l01Xfrbj0zCZqID/5H6\nsyMCsY9OFbSUzp/pongeZJYkqNbPER4YPzS+fINXYp//SIEwAgI5s8sSQrT/\nNat4N8vtVfTBTh0WQItON78ys2+ZRVgezTug2ZZXR4ulULnUMN7fw75XbE2S\nOrQTftWNVg07xmWMwq+CnaHBaPB32vEedtd0lxlHY5jVKcGOH98+aVT3LCc2\nPJzV3GXWv/Udq4Mt4EyaeYK10puha69latFsqWYTeEEzWV1gzi4RN3BInvQ5\nKQFI5MRGbneR622I+gxbJTA1/HMFY+1KMhB3h398LNyrA6LjZsw+Pc9DLKS5\nXxEAgNPLHOP/Zk4R+CryZlPBtRsc6HfYb90ujPE9P/lfn/SvFDzgv+RLCsdu\nEo4gM1GMfpnEp4R2ObUhLLJckOlH62MWqyGZWzEgCB/oOM7ZWkREjMc/6xmU\njS/iG7TZO0dFCeFuuN/YG/asgVMLE4f1N97aRSNJiLMT43HG2h9YBxnewcjD\nOf2awRLxcsPex9WS0Tngh+brR0fIGaxCPPnr9jefSxgoIxVolrllyhoLKz3v\nzu9Z\r\n=9F5g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAhQaaBQRIBv8QWqz62SnHE9zJiX/JuFPNuqR3y+zul7AiAxivudHaz4ZXAGj6d66hEjA7jaiHqYaJ7jQzLGEGIaLA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.e968858b_1543883461733_0.8506565289204253"},"_hasShrinkwrap":false},"0.15.0-alpha.ab01fde3":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.ab01fde3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.ab01fde3","dist":{"shasum":"d0bd34172ab3c9d5c1d6e7ab2a197c305bd7a5ed","integrity":"sha512-Ri9shaSzgsRjmxoEyp95uv4uWokLM2gLtfqe2/WfHsaeQHBmnVQukx9JwFvkCGq6x0/zNpdiWo7IHGlipjCWSA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.ab01fde3.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBcrbCRA9TVsSAnZWagAA19wP/30RkxSRrCY9vkAqRpLZ\n5aEVrkshIDWOEXBi1BeUOgbAjeDK8SjI7ZYej7GcZ0KzHKZG2ciQRp0X3n+6\n912xb3Gz399idiF3otLsBDYJrX6CQHZQ+153ndqTQkaYXWIHbD0LcsFpCZw8\nE/MN9w1TLh0q0OwzKkfVwcWNAWwBbqHqLMO2LBdct7KpTAkSNCi8KOFoO0pz\na2T2zD4sfmjGj4hbzHPdaZ9b+pTmoRRLMrweE+iQp0hcO3oJi0fObnhqhshs\nKoGU94PdF4P5RlqeOzTeDhZB6axCEZt1NH8u8ACNCKJUxwni0hK7JCXhWsP4\nbzqMu9BomcnVKZbeEDd9bFaGakHaBxjRLBmtcv97Wu3AGMzTDHGqB2phZwBL\nlAArwAGkt8Dy827CJ6yWSyU/eQ+DA8B9irFN7XqW8sPTmBxVHEwlVonCEjq/\nDH/In75lQlve5ETcey1pXzQ0YvKms0thv+2TMVUL7aFndKuAZVhgoUTToZ8A\ntAeFahSfx2yD3t0oMyxypDkB5dX+fgaK+xdWT4+b1/85MnkFH4A1Erbs2CbC\n95y0T5k+Hd9nQYkVO0msLexiMVL+JoxlbUE+GwUPfSFhdc5NQCJSV4iOB87Y\nAPM8E8RV5zG4Zx49SJT7r6UY5Iwqo0o0cVpc5aKyXR42bixcbzUtRspBaR6d\n7wOi\r\n=qU9Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXbapLsYRfAlp912Ugaoe3Ibjcj7Mr7EvAiAv5SLYI9AIhAKb57iB6+LErG2sA8CRrkxSji1+pYTsk/gpucNGsgco0"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.ab01fde3_1543883482372_0.9813230516823561"},"_hasShrinkwrap":false},"0.15.0-alpha.de969db0":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.de969db0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.1.6","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.de969db0","dist":{"shasum":"55be1174fa572f918ab564caea0228618d2d6ed7","integrity":"sha512-E4XNkCuFji5LcRyA4xSrW4vtv4XoM/ClKRKIkND8Urd1KHmWuhbkwlE3BsrBE6qfHRJZI3/bnXVuIQlOIbytVQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.de969db0.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBct3CRA9TVsSAnZWagAAhsAP/21aQWIp0aZTDESHiVzo\nYHef8jGH71dvJ4eChNQ77J5jJTHwd5rMs6GIjVIbcVFAgQ8Rf5275Vi3/Zf2\n2IDq5n+v8t2goGzR7bREpFCtILuIzRb5qJ8aT1d853x8Upcfbrirqnn79mfF\nGSMN4tBJ0vK/jrA9xgABEnIxjkx3ojWl7r/v/FQGLNhANFXsUe6pkyNnmN49\nqskrhaMoohSLalFUPXK9DEeQ5O6wMSAryMe6l3mo3ZNh0up/+khLq4NcROb6\nXXJUdtY09CEH3G+lDijfLraE041ZMJaxeVDwm0E5lmXlyLgutdO6PWtEbbNp\nRVU37BTHfeq5WHwSJkebAEQz3v84CUQA7zvC5P+4tAVsS7M8x/4Hg3zFGLc5\nu7P8FWaZtwFXPAhsxvGdg9DmMXC0tVfwdQmD9P+MOgDh3rG2EzhI+PuwRsvX\nthv2alsu13TpQ8M8r1TdtK+jnJZvSTMrLBZhnFb1tZomiszbb8HutEwnxYle\nVc2g8U1zYcHEOwPdJQ74CraByQxEOafLdrOPRogpDQEfYE86jclVEmHiY6MK\n2LPzALUQiCQ4Du3Ehyu8/qxDBFfu486UQrUZR8Ln/WPXR/YLgBSFpTijJIut\n3VS8rJOajojDtxVtbxNGCiK8OS5hqTwkk6sqr7ELOZucycMIGH9EcQyNmCAG\n+u9+\r\n=GbLD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDc2tpwlX/BMTwrz4vilToAG5kx+MsCo7xpDddCB0fZrAiEA6G5GMFV8KIog4pMCRpsbRosCr+BuD2BYcLvl3m6qjUk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.de969db0_1543883638303_0.05818507028979547"},"_hasShrinkwrap":false},"0.15.0-alpha.89da92fd":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.89da92fd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.89da92fd","dist":{"shasum":"24e437ad92a5df9c81079efa5c63d3f3992d559d","integrity":"sha512-iDAdpRoQhnd0S9AwhPOWrg5ur6BAxUY9wQHvb3vHSV0s24KDb+7zMUB05yQlqwtYyL5xhroxehZPoaCzd/FU5w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.89da92fd.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBcuSCRA9TVsSAnZWagAA5+gP/0dKy57+JhtQSb/OxczZ\nFeacQ8WJtRx8tv4drdLUuHo+GWtRUyNxk85yWbpVC4c9XUWa1D8+Ius3tTDn\nnPGdBI6/+Ugsqiqm2wnMVYXfuy7QOLr56N5FrBWS/6AXWdpdlsNvfpdSC740\nlVgEkkV+Q2pphhjheGBSEXriBMJW311YPgzqwrtwBH6rS9zHnK05qq0l74YT\nyBp/C5X8OvSvIsm9Ejls4PkLNCIO06/XP8hybHhuF1ZxvcfzODutJwYjM6ru\nscRTXtHPJ95LVaYoaZuKX4I1mtlUtloJ89kj0rtjIi2B60YeTNuSHhyq+i8I\nGFxba6BI0pGy3kjmFxFm1O+ouDiDKss7b9uM0vzPngxMiWnO7EEp6nBQpz/8\nW5EY4mg5pb1/rUKwgE0w6Gczuuc2sOQC9KGe2DpGn1Y7yW+4J46Ie3vQec+A\nJdYU5Xc3HlMeRjpxpeqx4sf95m804ktwX5Ci5JeDD8TVEujgkf88mi1LmpKD\n7Vbi64J5cn7c/LtfXLp/LnAeOKweFPrW3jU4TS2TLXD5R4jp5cpT9L6ti6Bq\n46RO7nEtpi9ksjLD5jl4Wk9yCq49qz71nNHq064ZkeYm/eh7yGKHY3yNzmRg\nWlBGbk+oAZ2vNW0mVYQKKXmU7tqibwjSEEEYol3jdBWCiMblahIoJmqej3ii\n2Fo/\r\n=Jgt5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIENRQfTbGnYmI7SK+etbQJ1Ooikv94fRqrjRwymDpU5aAiBUYYxK/9OzG/gd2wzaarAG5sJIaYYW2cRTIn3OGXQ+Sw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.89da92fd_1543883666401_0.1961673318566679"},"_hasShrinkwrap":false},"0.15.0-alpha.c23562b1":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.c23562b1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.c23562b1","dist":{"shasum":"fa6fb95a51685295adf8ecc3d883964a47bc5c7f","integrity":"sha512-4kPm47c2G6XMEBUfA4N7bBGo6U1MBs2JqxmgFdG7PwfXBFOY3+9WUQ6yfcG+sxvpmdbBjMgX0WfV7qSkOYup6Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.c23562b1.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBcuaCRA9TVsSAnZWagAATvgP/i/R6Xgl6YMgBU0h91Fa\nhkJ2CE9VjXheq1t0Ao3KPo5PABG97ZG8g5HzWOv7zi2D7fJM86rCJFa8BiR1\nZ98vpvNiS9VxPeasXYJQePhYHol129qV6UfMSuhokuDgTS+1e67VU1GUhvkg\nIk7/3OecrDRma6yXJOriYBW+2S5OQf5CAcrs7H06+Pk7gyja+B2Bm4/lUCk6\nRfDP8wwzvnlfVnNsfmag0+CD7XlNmbR1Hs0a4rBwQcC8u7hIvb2akbXFecTV\nF29NIqQVktfdVlv+wULZvTcRKOCLK4UPMXQzZ/G+9q9zpDQ5Kg7x5ond4Xhx\ndjNPYeUMuTC9M6woFccgbrZYY7QLTna23MIusjwy6+GwgTAgbYSBgmbMzJBZ\nCuHqAcywoB3ROtSPe4Ca5Wt5W8+5C0lWTU54K2NkI66rd4GB6axjG3Outs4P\np8mY5Hq6Cz3FMP9w/Nq4hfZAzz95Ean76HNmK+Iats/DPM32YeH3lChc8pf+\nrQJarBx5Lpn7WHIr4zHJPChQbDl4EK2tv16qp2kW2+wKAcMS3jKS8Yq/42WR\n3k2uPb6xne6XbFtkFIH2j1l7dl4hnb/+Jt3MFS+hYq+37LxBgMelxUbrrpSn\nIU4Wpz9qGt7P/TxH7fZ6pJyrcdXqs8mw2rRMqh6UM38i3+V1jLq9JNkm0zcA\nmnT0\r\n=inGS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDH49iwxqI617oPRWLifv6zlHJ18lJqBPNBftzd86Gj9wIgAukJGmtHn5OrJh1Uk9P6206Frh/HgJZnSxww2vQEYtU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.c23562b1_1543883673903_0.6311849216499439"},"_hasShrinkwrap":false},"0.15.0-alpha.3b524afb":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.3b524afb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.3b524afb","dist":{"shasum":"52b422c5ae5d7b53f4cf39a71309374551d99c17","integrity":"sha512-oJZ/r09geWf/IF0nGzi1Y158Enks1kqY1ESz5L68gGJeqeVrdwBcS2eXm5ceog0U+C5ZfUTrkiO1umNaKjDutw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.3b524afb.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBcuyCRA9TVsSAnZWagAArs8P/3MAQKxSYHl7MCIEgiIS\nayAi1Bq6IaHxmKrW9wHjyTsFAxGVESU5VbxVd0TdPCxizK7m89DB3VCow6LG\n6Z31g4989smeQE6XcLNDRTABTYfbAlME0ewW7FZqNC5J3KkGJ6BZBmcvqzvg\nzhMT/+wPKBD8SehJzoGQIDhCpLr0kn55myTkulMjxX+R6L40m77fj7n5ubve\nHew20uoKuWOIAaNQ8UTGvDx5BM8kJtJTLrrfgW2vK6t8o4E84vcGKlqpZ5aV\nkXGhQaOxWrXSCdjIfempKCUZflmkedwRS0u44Hxk4XHssfheD0eguXtMeKVp\nnshPJ0OHT39HYO6jlAmkTxpAy6H95D+QHxV3gBXXq2WZ8SMbNrZPIFRhGQe3\nhUM3TpRMyso9348SZKh3NAWDD4wILYnUc58hHkQKMNp5NUzP56Y6luGWf6r/\njOiqoBXU2xbxrKSWJjk/yUHUgurYZ6WHn7NzPIEd2iUwEAQereJyG1bDn90N\nE886lM0qgaOOlfCBreez0l8RfMV4nfe0fBTni3KJGpJ1xOcbEFn1UAMJkHwT\n+xBCxbxstf4iy0aq3C+195/b9Yq9DAjSMw/OiJf4Iws1cUEf5fpyXabq6Wmz\nP/6OZQoQChUcB/em/wU6epShVEYk7AwZIqLfrQeDjjbkmY0UYlTBerUtCQdW\nxQ81\r\n=2uV6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyObg65O6ky6AT/+Wr8F9nft9FAqXu+ULbvmFARDs1jgIgHOb7FUOwkMW0JdIo0G7mm2HOhA4touA/JZ9yVpn1yyU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.3b524afb_1543883697868_0.09394705273453652"},"_hasShrinkwrap":false},"0.15.0-alpha.7f221d46":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.7f221d46","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.7f221d46","dist":{"shasum":"05cd0bf70876417eca9d25a8775ebfcc682e2cb8","integrity":"sha512-RTfpy6U6zcMAznzmJj8XIpu8/Rs1J8EAvo7BslsPRmiBKI0sEd6uodbXMxWSdMTISDK1tULth5Uxey36xWhTvg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.7f221d46.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBdHCCRA9TVsSAnZWagAA5HAP/18/NPHLi6NhijRVEJN0\n8uR0OwZ9S4nr3DoVDftcJcChACQArgEve3fQKyJd7jru2eedzbjHnxOR/9NS\n+B+N05jOVnY2Vj/nm4n3hTyeeOTNIJfukMBhzBrZc+yTSfn6pTcHzT9zSFs1\nPJH2iKalRWdgmEsKnbDmBvvygRnKse/TxjhEt/fqh8ExYY6vXZ2P1Zn09Uqw\nJEVDnWmLWUsXTaAmoSq6GhcYILocX5K5h+OcD+RR2d2tyZD6z1US98xXNhqF\nbyBcAKpSYxYt6o0ZxksqiggsmdCvP5bk5ipU81o0iGEhArUfF4BPqPq2klV6\nEHwExN9gaY0KzzhaBpr+rn1TFn1jFQnBG82QeEI5+TlhM0827nQqh1eqYnSg\n0o64gwejhoRsPFLN/FGbt/rK896V3o9Yz9SK+gksV15sBBF+MA0kw7/Ac3fF\nMO5FNsyV+0ub34cdaYYEVCYHOza6jpeNrX3YbTiDw+0PHawzeGUJi/Rj5Jre\n/D44WuAlAv0vssdZqiPYLONNF4E37B0tujTcMKyeD71/w3n/l8DNWtGfIxfR\nKmQaF1Nb3GhMieme7xX+vmwo+iIium3CKnCuH7IylZiBcfIX/7sCRONskUkc\nWYJk4TwQtf7RVwUmVfsYPYpM90rNIYuPQ/w3oyrv9ejwR5bLH8LyWonpmTic\nb1ZG\r\n=ZGZn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA/WsnDTVAw9hJQTOZcD0loJ39N8uj+6RDWrJe/pNuB9AiEAuN/RRC5sWwMi4kOnEM6R5xuW3BNkOsST0WHNvmk8Dcg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.7f221d46_1543885250138_0.8994187757906049"},"_hasShrinkwrap":false},"0.15.0-alpha.b4e869f7":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.b4e869f7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.b4e869f7","dist":{"shasum":"1a86c83954aaaef783f34410c312a3031c9d07ee","integrity":"sha512-a/BtKkjBbAnUT60TfL+kYp/fn4Rpr+yCt+JxrmKLPQVfntsgOV50yQVv6+l2UTpjCre1NUQrzL9SA6/wYVa/eg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.b4e869f7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBdHYCRA9TVsSAnZWagAANg8P/0prPS6YMjBVhimoXI3P\nGGs1kA4njLaqp8rYiwOJRWtt09Z1wdmJycacgz7POUKBu6kWHrSgNVNigy9u\nvb8yrY8T1vyWnLEF5GFuXIh1kXO7ej8AysNcYiZunZzn1cKfvIE40PjA35A3\nM1uYNZrnQbZx+u3gIlSOZWzP4jxmchdbSLB49QsF9Dv2xYBUpRDwgpG2wwlG\nBITkeih1Nl/M3TuzSdjrcL4e8FOaNf0OWUELq/rRwwhMtE56FdXlW+IAFGEW\nnlGMf/1C0PEAeDMMs6mvSkv5FImj5Fbw2BBzvEkp9Y7Q0NphWnAHjgN/g/Qc\nH1ZYwk++6lPOPgOGFzGdlQYeeriXr0RUFl6ef3Vrl9BtSHbphmSxmwD85CHz\n8T9bjWQLHYmDNuaMviUUoHPTgm6PaRTwbMCEdl7Z2YksBUZLWMY2SYsJY6dv\nFWutmIIiY9gSX5jAAxP4fv/6B0SnFs2sLOzHuHJQ8ENmU+d0t+ZSlJWSOTpL\n9S+iqZkpq2xukmdqAXwcwRUNmzv8bgVCRP+0DLTg8R5YybGT48ROsO5DfYW5\nyZWaYwdyMJjogGjx4PPgWvWcd29utuwncDQ7eugtzYvAaCgt3AuvTLFYsBe9\nJYpWg0K1sEBZ4Xc/19t2I4AsiLoHOa6joOZpFp3pPG2EHLVXJPmoHQ6knDfB\nY017\r\n=cStY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqJ/aaT9oofgFv2BabaWHx5gPP7gW6XXL2QJMVhuYrVgIhAOpC6eyf3+g9+B1DmYMJTmGHvVE+c6733wpITbc6j04n"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.b4e869f7_1543885271866_0.4784762447872766"},"_hasShrinkwrap":false},"0.15.0-alpha.36c9c109":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.36c9c109","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.36c9c109","dist":{"shasum":"d2ba95aa3c1f8fa31aa4ee37983aacec85b29135","integrity":"sha512-+MbV/7Ey0HrcMkOXTyALoJjoFRQl6jeCwfC/L6j5IagZb+lAXdDQYlSdS1cRkvExuJVjdNjtMvI+daDQEoOG9A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.36c9c109.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBeGPCRA9TVsSAnZWagAA74EP/2lvc+9QVRcqfy5/oGiQ\nsvtF5+r0NbpwIpHZ/cJy0f2mOx7BlIaTmwInc4ed6/NYtlMSdD67vxFdfe/G\nWINn0YUaLv+kgL7hSIsDgRWUzlTEF19YmjfsYR+pNI4WAcc9+ROI3IedLF+b\nVX9NDbGiqtSEyXb5nX2Y40JVUotlCWzHmvz4MBVgHI5AH1E61kldz+pi6dgG\nCuAqUBEQ6rHNnCzi1417RlNl903RIqPr0ILD8JzL585nLKVT7vHf9QV7Vc9F\nadoChZkwz2UvhdWaWfDsC8G01FmoEolCSAerJiXjBiCfHbAzRYYzjyreUloG\nmU601HlpxWCShl1SzbJ/B/mmcPVubRS1tqrPB8jj/DMc+ZZcnQ1WRJ6a+cDL\n/s5xjfYYrHBF3oLgZOv0/5bS2fvlvsk8l7RJff5sgn/XBF3bAnSJyyra+oci\nxhyzxdZDlpNGpSoC2P51mpfK+ZR4HCQKS3bBjdPBa0z6Fdb+uHXNrlNeF7Bc\nrZG7EXpJlSbo1e+yGwpq0E8gFUlwlgvxXNsrb7IkRPWSg3uZel77eTtTwsDN\nfXPB/L4och/KA7I8vt7YgyHEEdnOAlPETT7Pr4yT0hbnPvI7qZgzNY3tYRZ3\nglyBIyi9J0tGeExlnSyaonm6P1OteEFlYIiMaOaMhEBo/77S8VbRaljHMOtg\n3ofU\r\n=35o8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwPsFMkq2/1qTTwJQY4w+3Vw1rPhamXMjJMUxoalFPOgIhAPeBwFSo37nklrbi1IrkerAdkXPebeiNoWhvc7neYN/z"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.36c9c109_1543889294623_0.6738617018491257"},"_hasShrinkwrap":false},"0.15.0-alpha.8f9a0cd2":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.8f9a0cd2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.8f9a0cd2","dist":{"shasum":"a03d3a9b82a4706723e30e9bd8ff1a614f443df6","integrity":"sha512-2EbT4ZG4s6tPTpH3I2wQOdzuOpglLgDt739OOVCpF/PbUnL2FvuNjbPyBRE08XZMV5OMacW2m593IqUbSkplrw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.8f9a0cd2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBeL0CRA9TVsSAnZWagAAoJ4P/3j73YpLttpr7hzS5uq7\ny0Ggf/S75JnLo0oJbP7SPWt15X6bjE0FVvjwJKV3cSBRf76n1Tko9V83E989\nnw5heeD/0T86Xq8UZKslW8rAI2XWAwpuGHRWkkCKyO/EW1m4imXCh36Jk6aL\nnN+YeJUEIUximrA1M2uhMTsKjaNyVrnGhGHTHVEtvxG+NqlTtpNsBf916TEP\n8ZROYHPx/2NpK1bqs/nXLIIuzBVjnuHxwy92SCY7dEvAokdKrWytUBBgPXEr\nLTYUAiTwE6zoKe0an7Aj3aGyhUYzpQAMFTQsvymo9RmMUYOXjt8G90GXDfyQ\nu59m9BagdfcECvpOrxMlzZ/jh1BddShKA8dlnvgrI2YU1Tk+hj75Xwp5sTDJ\n83c9FWfYFrJ/53ycPcaTGbeOCpqm7gJADkcubd57Btjnl9ogqcWH6pj4iHiL\n9Y7+F9208EAotBGxpkMDP03SJKxIOtnCps2MmuI5zDUqe3PwDKjAN3zt3wia\nZzW6R+sroOCQ2o8c5tr/1KQl3AyF+oqIFyWodIynm/MhVltRDzA1ThX9LlYe\nCQJaGZwD2sxuxGlc5oYbhBj8876fYqv0VzLEkXNNjtdiJyiwNwJQdHIXEXKH\nZ8GZetjweqNJ29zZJGyAQzndTTm012oPhjz962O1uD6FkxKwQ0NX4p7/Rg4O\nfzMH\r\n=uLLz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEZZvj1w+XAEXGm6TSqFkwtFwhJi4mwtCw2ediJ5MAINAiA6VARaG4+GHRu4Yw4WgZudMGQE3a2zKlMCA3Q1hVCN6g=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.8f9a0cd2_1543889651893_0.37007114822916387"},"_hasShrinkwrap":false},"0.15.0-alpha.3c84ac73":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.3c84ac73","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.3c84ac73","dist":{"shasum":"82894e4e5cd954559a761ae162fd04843a827311","integrity":"sha512-x0AQPbQSfiAde076b/gokTCF8KpPP7rqBdsbPk5tYIqfvMNMisOiCKppFamgB97DI4h3QDuo3kiHfetLhpkhiA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.3c84ac73.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBeOhCRA9TVsSAnZWagAAFOwP/3Mpgge9oQosFLxkw4qv\nCbJOTSEC5x9QXttUKi1ldFzn1eJW9KpZljHImqHkFjDDh1dNqC++rkVSpp/R\nXbav7rj6makWUYnwnkWJhI15D7WEleQwBRIKXJO8r8vgC1cJYBI9OGc9pF2a\nfUDkyD6FrJkVQ8sq7QiCc2BGGK7dZplAB61vaDi3ENM0LxXESPiaHM4l5M6e\nhyBsWqOWC3n2HAf+hxq/w+4CHsxDevakT8tqwmEGW8DsDg0zX7FHiJXPPeoZ\n4cGMIm1QSSrR3K8C6TKfBB/EIsj3a9dPlTyfl070MrAklGTR+ztp8Q0U8HuS\nVgrKSZyxwndhIl0A9zzNqQsmVyeYyv/WFaHMpasmDBUxL8cy4/YfpODSfruE\nV9mimNTEKm5Xipr/J68nHX6lvnv33p3pkGmgi1t3nttov68GDPmbLHlVg14M\nPLQcd/LHj3cgvvT1ogj7rl4KMYb8vCNJrnOXnTRqST5DNkJRGnfPw4NvDy5z\nVSlFjlPFQK7Heb176wcvZr/cVuNZc/OSnzzGcjctgLB8FaDTcGJ60E+8OZ0p\nNbYUkVEC88YV2GpS/q7ag/gGcQaV7s7IRRl04CtbBzCShVFnnW9d11CnGBsr\n8ovJvUCkFV2E5DZUPrQHOVu25LSPNCeoSoKGqOC2qKczw+j5JwnsNF769+7U\npdZA\r\n=oa3D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFgSu+qQS80n0+l1SzFosL3Q2PFN/QhEwN68OPDKcXvsAiEAwiFZg9wixLuHpqna/NdN3AEyPraG0vRRTZhfOGc8kT4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.3c84ac73_1543889825392_0.599775840902038"},"_hasShrinkwrap":false},"0.15.0-alpha.07908bb3":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.07908bb3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.07908bb3","dist":{"shasum":"d635fed71329e1597cc78e8175388a542a9eafc9","integrity":"sha512-426uRBEJAWCujBrViNYQoxTesyA0Q+H6QSA9Vbe84UiO+KY1ga0t+yozhf151rN1qqEX1LixaTeh+wxen6OU3Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.07908bb3.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBekZCRA9TVsSAnZWagAAaYgP/1WMnYbbjYxG/8ET7rwv\nS7R+2iRnzg4A+4B7oehL7H8IL49x4eSmWOcUgVgFQgiC338/5q3yfSJUxLNL\npVJd7LHCOUAzb2F6P/B5V93liEjQsvMItB7TOwiqHxe18RoMEBXScwCpQ/J/\nT8NvVparAUderzus9sohLmAt3UnnHxUsTk+ALK5pMF8tpCxbX6eEEqi+NWN0\nt13qzI7bf5VAndFvQ8VoLcwo0lu50vYs/nuOO5wcSWWKby3bpcSgYLDyG4xj\nLkSspR5bCXTy19h0X+Njve/jGK0D/UHyW0uHk/rJRd3tv3xRvPiIAPKUFAsZ\nqYopwv5uPq1MQS3HwzyEFP71ev5ouwfjoiwIUblKaSesN4Sh2rXKOySdeqAx\nbhFJmuqGFDXvSCDwoOZU9sD8S+hwM6fFsNzE3+zevP2uupOcWfJj6XlF74Ap\ndHPTXOics/aYrQmfJu1O44ack/1TxTdmvA0/PSISkTYjXFx/uFknpbyOdkzG\nY6mIyaNXv2BQDzrcZAvebgN0NwZ4et81ADWh4yd2ZbmQ1BzTht6EC8IO8upf\no3XuS32Q7uyohnVv2GW7EU2kYPqxFoaSRRNY9myNb8W1nlGMLbTbSnMnwDCc\nDkkiSYYpzC20PbPchsLZgrgVnXVmcTmHAIKUmXcSmI+gG6nZkM9MzG+VE97c\nfG4l\r\n=jwlp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDD3Vxd9fel++MwK/duxMArnddw6XDtWbgfpdFRpjYDEQIhALsG8FltpjNiiCZD3fsKw+4bxUHRRzQofOx6IuVsmHck"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.07908bb3_1543891225139_0.936469933316022"},"_hasShrinkwrap":false},"0.15.0-alpha.fdaf304c":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.fdaf304c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.fdaf304c","dist":{"shasum":"848babc2ac7f7c0a622015a6dae45d110564b670","integrity":"sha512-kWR/C2hEvP/8xAt9EaNxNxo7by/YBTE28EYZfKgC5G1/I2eCzGEloRU23w3cG7etMUHyQAS93AM05gwyTL5cEw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.fdaf304c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBenECRA9TVsSAnZWagAANEcP/iGT6uknWrCxZwOs7CfN\nH064ugQwAQ9/3S0aeUmNgIT4MiLmoJqxJfSUBRrpVrCcQyaA/fo88tzcDN7A\nJWBHEi2E+sCOeHR2mG8bNvftkMoqb+1NX+VdX+FdK4kyRxxwXd6t/VS6ySjb\nLGwOhaDLocEvQ58mWOPG8gRRZRR0hrGe2w+WsjB3iW4DZMC0UQGDLeHPRIGR\nxz9JcSXTO7VxmyPpVDKcPckyWNQFB7ANKtNm4UAakfzataAaNXrmT6JKucpe\n4U8NC11sTvMDjiPyStYTxOGlUDjbsJE4C2TwPpaSUV2ayGfFeQF1a9nOze+i\nPFphQf08mMs5Mu6RMjPieUglA+ihJzyMK+hSI5WocdsLoCSYd1cfjtHULAwa\nvULYExkr7DVl90wHaRgMorCeIIKcXGPqRIvnEOpZ9QWnsi71AuRQ40KfY0tw\n6BMBnPR61iprvko3YHDPg5HLRKQjuyZkIP8sanmTHDh9HE48rT1lvKKTbOEu\nWljdX1PiKjDWtfdeKAlzzWli+HyYAgbNhJ9s6ylFP3pryv8rLgfwoxWSHkyU\n9OajbKbonSFMdHCeJucbw7oa2hwzYhGB2F2Wrsw03ohbCKz8gx4bmX6fXkhs\nvKzz35gRjjBoPA4dnr1vMChfoH2Chx5sVwlfNAJpGuIyEC4vxYmuD3E5xbv8\nXDO2\r\n=VyDN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3Hv8bGjgq+34HGJ9mThidsdWO2F2+kpRxShj5hhQ+5QIgKEOcSnlQ9dpOiDqJyzEj6DOH+6zeByYgHowJPwKOMNk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.fdaf304c_1543891395775_0.1937617324903016"},"_hasShrinkwrap":false},"0.15.0-alpha.68c0cb52":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.68c0cb52","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.68c0cb52","dist":{"shasum":"9259cc6839ea6e10f5bc736656fdc2a2add50d00","integrity":"sha512-Rf2gRggeNX/WMMv9O26rpjYVZGH13zpw3T2e1CVM5t/2TiBDsQnAlRHq4cKH7PTeIhVgyUDdYEaj/1Y9Fv/Esg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.68c0cb52.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBfQnCRA9TVsSAnZWagAAfa4QAJ+GNS1IYES8RtB5+DFG\nwh2w1BHi1Qqus19j7fqHSkk1y4GksfjMSOEm+7OG0PpHMEysgv6j+ibfa3W9\nZTtWlxKJvhOAM+08dqA07utwjTQJt/lOCxcAfUJfHS6tAF6HMZUi9ly8l3j5\nFiW/mQtP+d6EfZHGKbjJtZBYGd6jGLY93JPy0T2vzjQAHgQx88K+IyrH3QEo\nw1QxUnXHIIux8YmqLbmenXfZILdkOtGiOXIA/qITqevBQHni6hSCciBJM3sV\n7bryhL3SeMaZYX0DwphDLWOYKVwLWGugi/H0db8NrPb/8rQDIv0Sqgixycx/\nqtE5/cNB9f8wLkXsxNzUsNHpT/eFjrhA/1blQfi9hZcJgEZoUz65arZrruUp\n7eI+0dhYhMU+Hv0FX+nrlMF8SFgeCUnnnseJwnt+KNwv9JLHnVJzrJfEUzYH\nVDqK5coNc/XtF+QtaPvLVZJESGKicoUhLELbOBx2FEYL8tzDQNZsUgAm2VE1\nMU/opeLkWOSUobYeWJop2h6txsVyAghZGD1JuAnD/Fg2BjnukU5QtSW6xIMN\n89TyhdSXGLZWhVgUIM+3/4wxOUoVNj4SiP0/mMQh8kz0n8XFiQTIO1/iB5Oh\nhL/8nXi1iZ9F0OIjSHNKF19/esT8p93ItyLIDGOHIxcynTuDAxl3OEIDQgSW\nKXaO\r\n=MvnN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFPv/VTtePH3nCUnJgWL2lmvMh+LtlCUGchSBqjW5toOAiEArNI6MtKxSrwpSz1/L6baZW6UA+dQbLdysUtxe8l8SIs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.68c0cb52_1543894055311_0.2561147238937487"},"_hasShrinkwrap":false},"0.15.0-alpha.e1bb71de":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.e1bb71de","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.e1bb71de","dist":{"shasum":"196fbcf838ddbb86ff69c5698f2cd7b06d857c6d","integrity":"sha512-n/MTX7Ovwhr4dFrRIBxxXTMYd95+nCKSy42nUTkRhbfnQX8k0haXFcBSy4KrwXURQPbqUp1GVHTJRZ1D0GiDSg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.e1bb71de.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBfRSCRA9TVsSAnZWagAAdRwP/02KhbPTicR5UpaNR6t+\neAV6pVgwLo2MOW7w/JEt5eMmeGPZ85AB/u3/gXN9UhvZZt4ECo559jahUuxv\nytukr358+NoUeEpGtZ4rKMmzJA5ijpLnikOzI5jhlc3f+keUvEkyQseHmoFP\nb7Uqu/cKSO91MMy4DZe/pOcv2qInU8V5epII8QetL7sx3uy+f5x2QR8wj4vr\nNT/KCY0dOyZqfo5H2g5qY9PnLLta1jBaBMxNyTXoQa5KsENQJ5DpnVXdPnyG\npc0H9XnBpY1jxD5yPOLyr7WiQ0sGhBFlUVNuuuj7YdG9iBbb+DmQAWVbdxHS\nYtAJsXS/dXnnHocRGCcDhu2EsMtih8ySiWhjhmZov3lIyv6tmo7Hu4/ui3Zs\nWYHYLTHvs5al/8KsZnZ1llOZj4ILgESyGLS6hMU8Iswo1TVHRF3Xy5KvuuX7\naiRXGwSM7brr35uYb+adcdgyrvQbUZ2WRobxGGn9AbQR7kVm7fXD6XWnsYY6\n3NUxaAq87frXLI09qQDe+UcsVml6PsQ5Fcxt2TjDgHE9BPG8VsGvaC5ujq4I\nV4DQ1T94snzRdw0iXGGbCuSlOcq3MkqFGcWBLep+w1XmWTq+mnK2BiFFBfCx\nkjEODClv/p6QgGHl6BXCpsvPsGOdAc8HLq9as0g2RDFXuf/kv0+HQo+B44bJ\npfpL\r\n=Hqfq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/fmx+kpNBmVcqgku6CSnvD1HTbUki6OQiGg8ztyxOHwIgWg4cOjyzO/v8ceHVVwnyN43KCJYrzeFl0TdNvdBUHyA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.e1bb71de_1543894098213_0.4884353851383896"},"_hasShrinkwrap":false},"0.15.0-alpha.31bf912c":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.31bf912c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.31bf912c","dist":{"shasum":"28fff099b1140e1d18c0146450532bc056ead440","integrity":"sha512-UA9asaj3jj5ba+es5tgcMMXEiLxGvmK9lwoG+AkZgJsbf1KbNyIC7MayVp/1iz/6NNojz9LSxXhP1p7t5pAd+A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.31bf912c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBfV+CRA9TVsSAnZWagAA5nMQAKErgkyJMDalY983wIdr\nRgSNYWpp6kIvhDNWA68oOyHcTKbqVHujhRiwgM+8RLny41plgXzpv93LWVcy\nmTBwIlw1F5fLGcNK3RPY4ThDzmyqRr2EPO9fP+GGj3tqtelpSiAi0WsKgDbE\n+wmSqhpwZMWD2IzPHbbVZArQ2jSckttdnB2Its8r6JC4smAW37rkHXQPbrR5\nCCc/kILSj7f58OZBEXpQ9CdyxcHTyMt06KDKUjN7J1J54vk5b8vsAkTRf+Zs\nrz6Vg16qJC9wSQ1Mn1KUpINLPJTMi9l4mY95ArWBmeev1fCW5uKs2D9Z5o0J\nR8h+R61jBnPQRpSP4VLIxtglgkk4Jypwl7seUsK8RZpgF2KsrXR0Wd/ylWnn\nra3V/n7fEHsTScSY5xNtQ0LPQYp5XCIyCf3zVmolli4XbL+X/Pr904ALuFS/\nig6hijct3Di0ThL1oEIaXY5ZI5v5wAvAjZnrGShA0riTaQj8/Le3zswSc5oY\nTiIs3ImGBj6badmlU6njyoa9qkY09kA70NBl0lTqoiAKmvBAvgmqqNb+LbB3\nZVdifuGfxFAx2RXV12hKUoOF4ZC7qIreKcp8cZ9z9x5UE7WzOesMNPicR1/l\nI0IHAzW1ROGhdsNIkgp4oAMWfPZbLQNDCk5DcQ6SMleyMoN867RIvZ2tQ5gv\nPrnK\r\n=AqJO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHKPJMavHUFJdToK///dYRaFGb4trEzczwj4GBKLfEdYAiB73QtXW7c44gByEQftPloVagZkwd+DhfTz89SIVDo62Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.31bf912c_1543894398069_0.7892696893000906"},"_hasShrinkwrap":false},"0.15.0-alpha.16be2f28":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.16be2f28","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.16be2f28","dist":{"shasum":"8989ff8325c2725baf35171e24edfabeea264cd7","integrity":"sha512-aWIfukGM4wARHvSjdHirrNbY0PWOsHoyC55Rv09xjVBgvsRV79Wy52X808MMjWsLTBK2VA+X7JIy4rIrXnIvaw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.16be2f28.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBkyJCRA9TVsSAnZWagAAx8IQAJicsh6kCMfaaJbUC9Ra\nspCOcuFAySGuFpH0dx3g5Wgjq2qWaxdoUzTFChCzeM6uwpgcncazZLvrQgGb\nHmI6KUU/pViE+Y0GjLdXD/ETSbxmcB0vu4jHKMnhe0xwCKmYWk/sudjdWi6H\nleQMPBBBmYfNncG1xm6APXtdxBJYpUCxa1+GlL0q1Ae7OMb18Y9L0fsYxYul\nc3pO7i7pKPOGug0ZB5j90t9481TBkg9lUlIFpMkj3vS5jtfqaQlj+1W9h0Vv\nJJag0tB57hfTpjwz1eEgiRAKM1rw4myazBnVi/a/rF9kVywaOo4J0cihzLcT\nUpTLESUtmJtzutlrZ8jQ9ghe1V5I28cU3CZ/RGlieT/ks//6N4G9G7+eAXHL\nCd8MWGfhmC8P06ziMzsTr3EXQ1pl1eC5SkGEXNwUhBg2mtz24eoxXMCEAlGB\nwdqBUcKbZHBMOV4Wxqvp81TxrQACjwzulyU94fWpvIhlQqLfYaZxlPJlwg5f\nb6FuoS3ndo4nozi97oq39Ym5jJB65MpgbBoIAvhghSz1CLODVRd83yv3sJJf\n4SdGhi3JsLgqS25ZcablRO9m5qtAFdn7ZCBX3CmGFF++rWmcKF+AVOMI2K+g\n37jW+3nmIOr3XDj61q9r0dfrOcRvyQpjFvZ+v012QbJMuUckdhEDYkFm7g/z\nY6Ez\r\n=9nQj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIoce4QaPnhrFpulmpsEPNzXsq8KFa38GNWA8EF7eBogIhALi9IwtJ9nyHT+bfLeOZs9bkymfjPJU1qaYYNmDnysCq"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.16be2f28_1543916680310_0.6438788953069556"},"_hasShrinkwrap":false},"0.15.0-alpha.af9e44a1":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.af9e44a1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.af9e44a1","dist":{"shasum":"a3d2a4b0f0bcf2c66cdef12036b5b48be8d359ed","integrity":"sha512-UcwbdPo4thJ8EzpYrW01ZD/EpyR4ZEt2HVCZN+M8lfcB7VWGtUHQE6f+HMDZ9JNLYBqYAVgG4bZI8KtWDXwn2g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.af9e44a1.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBk8wCRA9TVsSAnZWagAAr0wP/iiDron/Y46ZHq4ebdX6\no4nPl4IeS5IfCoJuvZvc6AckGDZCT1+6J8+v29P9ssqpKkyF56v5M+TtqkRK\newcEJzNyiHzBZEagJHcienYw21x4zDo7DFXiyx1Vuuf2ChzsgPvzBJTlsUcb\nkhJU1gpAWjT6qd0zdyeeGUw9IUUGr+K+MYhYPswmdkXkSc3/Nj8NVZGNMFfn\noPXf1Q7FXakexHAFFDU+nZxR8oZKv9Uy1TIAnfYeRFn6sbwGqjAL35dWc0A0\nCJwYnKRuWxc/JxJtdX8jeGpGcv4wz/hP9lnkHu/BiT6oBmpmAruZ51ik5Fo8\nsth4GnNda/qErbsQivSOwCZqdFXsk3NpIATOjGJ8TImYe35a1cMIp13rF22j\nD3FBAJK50TbUFu+U3wy6r+nvvSIUl67J9M1QQwsAp/+2IHKrpeo+bbk/8FCc\n+wYRJOKQaToxSdMk6dcVc7FHgvqRy5rrbzhcnSRdvFzNkBSDWfjQoDGy0bjc\n1NTB4d7I2F8faf8xEICvr9OlyyFiTkcid4Tr3KjtIxvpPjWTDE6aQX10zofM\nG+ltD2drAQ6PBj23Y+JbZiMI8bYY+NNx4wNl6Ki+R5I3Z+hLOwFNeLKXS2l2\n3sdXB5jxB3uUTC5eDd5qfQXwYdauxf1rUJXRiWFmzAARoIbWChl7zgt3jl3/\nEWcN\r\n=hVZi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFEgyvei7MH0O88cnmku4Mwc9wzzP04usOgtw3mpbcfdAiAkmr5FG8e/eGJbgsog6KfHyj0TcH+/gwByJucttbbW5Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.af9e44a1_1543917359613_0.5143527155428689"},"_hasShrinkwrap":false},"0.15.0-alpha.17dc31e2":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.17dc31e2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.17dc31e2","dist":{"shasum":"f6da8693adc010d429e6a8e634da9de616d11453","integrity":"sha512-MGiy+fWEbKHdH3tXFgdVYxzsZ2t/6E2avrLr0VQpVCDLI4W2uXrBIIhadPadOoIIX67y3ZDAErbSCWly0VgknA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.17dc31e2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBk9dCRA9TVsSAnZWagAAPMIP/2aUv7BTpON8GafrC5DZ\nYUdzZsPdKA3P8kutNkMXHutkJuT3SN3ZpWypNT1ni3Rv2+KzIplZVkTY+fzB\nD3qUc9+VZfBhyxthVlXhxJNL7YF3jjynkBmsJSGb0B/pYC9/YYhtmorm6e9e\nc+0mgpwTQ5LmHg7Iff00eeov3ttlWkxugKF/cOqboeShf0PSZhUKKfi7PgSg\nP/CLhvsMndy5u34JIWESli/iT7AKBYo7bdqP6sWHCyTHiO8maeP83x2BH1Jq\n5h4dGXd/jZ1aF8MmnN7RHzhEH6b5xzReAJaWLnWd7qMPxgeOsVMCgtxD6VVU\nNqt1iGGe9dJfkLYs+JQWzgfDkbW8wQsvtFvJoyUgh3mTodtoIyrG2KwNxymm\nkaPrR7oK0iW8k47VWABLqwslhXq26qazWD2gE37Iu0ehvVAbDZztscIPwOpR\niDm/hZMghoWsjwAO0bB1c6DTqXGH4Oj0+FiaoZebHLsQUyUYhNZxgSUUSjYd\nsXtbAoSnAdowIzjEdAlys/PjRuLtuPQmUNIgWMdhFm7KoznjH+IXlfuF5vvo\nF7i2rsIgyL0z2etFTWS6LeUdmpWOOqTUsLcmo/A689ghvcYCDPGgynuIgA2+\ntmdzNDIuRlIfPNS5chdY228nCUD35ZWij1k3FXSQiz61Yrmkn8K1ikH9YdsR\n8Hyd\r\n=qNLC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEMwFGCzM99qiVQIUopCsaGQzA0WJUb7perPWdvMdHJwAiAif7z6aXnFvSh+Xx3M0qLoCNQW8K/iNOrGC+Ui75Y3BA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.17dc31e2_1543917405330_0.4518664086448212"},"_hasShrinkwrap":false},"0.15.0-alpha.d8c2730f":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.d8c2730f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.d8c2730f","dist":{"shasum":"c83455e5ac3a52bb11ef862b81e36f957aee5221","integrity":"sha512-vv4PQwc3rk8DVJaAlFWQH4FI15En0WLiEtAYI/G8BglGKByEgF5Tyjcy5I8T6S+2W+J6LNtsXzMTQBO7iZBcGQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.d8c2730f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBlpvCRA9TVsSAnZWagAA5h0P/1lcnSXwS5OlhAIhQ04/\nTlVlGRrphmehk3UCsYoDMoMGnOhH2gMx3kjrfRjpS2z12X3yoZFW6IQjR0P1\nBYCLZiTFPtE/iGzOSfiS5R+24+vreBhSkGAVn4kjwAJsUJrtQhV1ouCpGM4K\nq1VMrUWh4T9m/IQlUb5a5Y5R6ukFkjWLZgLUtHQidd3rtye/encOifBCKG8+\n/AwC41z8hgx5DeghW9+vj4qLHpYXo/mFIJMUTmaJP1l/yL70iV3jitPlBFrU\nv2yXx5ll805rXo/46S7LE/D0yn9R6+MEqZb7a9fKvbWPT2+0xbA+4mGV+3q5\nnv/Oh7cGJGxCB0AtTuZesbXQfZuNYBQ93FTihPRvv6kLbx71GpWxU7iGLHqO\n+IbesT7U0r0hZKspReFn0ZrTHa9JXdsAbW/XP37j+oZeECPp7OLdpr+WQwwB\ndz5O+Rr/NbhmghZMgI1GtgG7N9mOrBYkMq6CoiofLVfRreN4dDxKCTm7A40R\ngS/IelIYOsJN1+QAO5LcKbzwO81Rpt0Gyli1VHqn7I3DiSvFu0omA4n6A9/8\n6L5wg9DMvKhmUqnbdzNHlvLZuUlkWVAcjtO2c7BIxDAjFRWw9bLTicmV4nvM\nVFCTxL0yX84lFxXlnRoqf8X52X+sL+WsNTfQkQGW1uKxluqQbrhqWQwcuLZs\npVJy\r\n=BqbJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjjpEWkn3TSlvyjI7VLN+02XirLkyAnn18eNMmz5T1HgIgKHiSuvVkz1fI9ZA5jndEQ7EMFqd3fqI1UyzkwyuE6Uo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.d8c2730f_1543920239235_0.7454030125279065"},"_hasShrinkwrap":false},"0.15.0-alpha.d371d9bf":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.d371d9bf","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.d371d9bf","dist":{"shasum":"5b15d11c02b0ede129253f857c6750b818686be7","integrity":"sha512-uMgERRAQiBD2sTZizxyYa7YNsxe5EcBw4MF8pGJbKK52ZLc9myaR/zIN155ARyYCsykDQL8D/kk7sAiKOuQD8Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.d371d9bf.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBmH+CRA9TVsSAnZWagAAaLwP+wZc5yiiYoY25Zab/BsU\nmMpBhGKA+Mge9h6g7vAwFrbts8mIc54Ici5IlGrKH+8jkwGWVMqHQOnaCo3H\n3ECfxJUUOIRmswi5ycLmPRagzPa6u55Xg20frBXZ+ePWFFiSaQVej3qaH3fw\nxEN1+Sn1HFkrAs8KCa2z8H6YFP08SSq7t+k16tFxC2ERqldSGPFmbpM8IwAh\nb4BgqQBiUP1e/bUMx9GMT41W5BDC3uR4icnGuTcC9MQPfz3d6gTvCKesdINf\nAFwl4VTrSliqbCVRCofdNh04ku7GIjNCfMZKfOMI4YRfCdf3fPV+0MKP7i0m\nkubrDwDzhKd8v85lq+8h/Zs7T1XRclS/5y5nNxB4LANJ+OModCNUEeSpL1mW\ntvYZlWZVYiJt8wiadYE0anBNycrI+sbJwWPxua1yP/eM6Ip1KGp3Mo4nZFpj\nU3mxC0JO91pJCr739VFj4bGoXTstJHivFacDDvs0wKt2VLxr+4gtbtdjRbxZ\nineEjziNP8Wej/2u3UKXr4fR0e1VdRW+CRWO+GEKR3fnW/jf7WwOdYCifQyQ\nGRWeCwR2JmMsppSQ1UVU68OnenRUhloVr3c4PP5cYvkKpoRcJNdupyqvumHp\n5zE4CCF+6AXLs4Esf2wB2PnQXCxyVSCvV5h288IT6KU92PJYH4OfiTzwZVOE\nWCD4\r\n=8Axd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBWLPzu7U1e4sU5JWfqVnga7tBVvBTlGJ7jfcjI6Lt6CAiEAhOD8GuPT9j7ikRAaix+79L8HPHZmGN7PRc9p99n9sw0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.d371d9bf_1543922173734_0.10859371868833922"},"_hasShrinkwrap":false},"0.15.0-alpha.999185d3":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.999185d3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.999185d3","dist":{"shasum":"f061b29ff6e713f59b603c6e00d228abbaa95e34","integrity":"sha512-LhchWHkSxuSq//gHXI84fFlJek1ZLJelfYKhxu0GmTfHmFNXDBdYfd5yfb+lBtrX27j7Gg3RYVOm4YV5YloiGA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.999185d3.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBmXwCRA9TVsSAnZWagAA+BcP/il8VJTInz+5Q88gAGCY\nCdjPTWr5n7etAHYq9Xxf4+9Zi6pa8r/EtLVIF1anga8nrlPYDZBRX20m6q6P\nhOAUsCq7zA/dwh/c6cCyqOvn15CrnK484IT8Ca7gCKafav6zIG+omCk6W8Zn\nTDvfjFrGQEy3/Nbf97GpS2qp5lhmcDVqEV4PkH/ygqqevcFPJEPyE6OoI5Tk\nNxUbr522D7AWesrvrRRtpziBaZcdNdfCDSrPLXKlqqfn+MGlJt1/aRWtx/q0\n/fFOBhQcfCTVWe6nN7CeXC1t4ptfWPmnthhmfWP4osr+ZVQDBeMg9cybOfuu\n5zyKhnikOTyklPgRDLPIhZRvjJoqVki2Ylqrpyjpz/iHeYZfmbix55K2Il9t\n18T15HlUJ/DOV3n9aJ6brTerJnyC7dk5/odYaYVFMsQ/vF9YTzh4eLt4EkF4\n1QUlwgk991qBShKEZFTf/bNSAAOWfDCOPvNnn1MXv+jSjNSAf5O3yVaneKh7\nqkIK5o0FFvyfBwmCoN2VMhJR06KqlBQ+8Prb8cT98u4SaR1m9Elcfp4SGVfo\nzvwSvY5XZfoe4EI5f1or+haStbwgP1Nuu7N+i40bzx59tXQsqbvnDEWVN6IN\n49SUgQ+LVIsvcPGbGn9nDn/S86oLhjTKXda/8ENiBUMns8uNCmkP+xEvAvnG\naHxc\r\n=xehD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCR/fEa7H4n2N9Cp9VU9RZ94b2g3n/SJxyMFDPg3WR8pwIgWVmMACMG9fd+L08KFJST8Dzs/pOzu6pyePR0Ze6xjlk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.999185d3_1543923183460_0.1791878301435832"},"_hasShrinkwrap":false},"0.15.0-alpha.18c25909":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.18c25909","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.18c25909","dist":{"shasum":"15d1d84f12a517b3962a6df2666ba87799b4b50b","integrity":"sha512-ldUwEiKGETfTwDZmvrQahx1rL4YJVCWhkNz1RLf6t2A/UX+5cUUvtOhlSPnJB+hhwdPTxvCkn6WSjblDVk8+dg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.18c25909.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBmd3CRA9TVsSAnZWagAA+LMP/2mee056hv/B9B0FdrJd\n+rJCauGD6+oC7Smc/xf4MtaLIAk5PxJ6akn4g7SCqB2Axn0WSbgehchN5aFL\nuwSpOts27tXrKpaqEZu9wVkcB6jmYf7Qg14ExTGDFzDEcsDQ8dDRavFVuKee\nQi/ZqB7xMtcUBC2DqPW6IVvfuij3XWrASGE0xEIjLbC+gjO4uBDynMbZ6VLZ\nXCqMj6FEiThSUOZjsUNO7piXs4SSJ3l9RHlDuoSwEpLElu4bxQNIakJalyqc\nZSkoAtN5U7xQ700lJVwz3nHFQ7CVo5/nuvujqEgrmNGcBwTE+PpjdFzZXW4q\nD/oq/Xu74noRitD9dLjQoGbGJ58CWtFOl8raamGPC9zS7PROzrhFbRKodKWD\n7ItyuhmDFLBlEvgqK+ao6tnFveIvFhpFF1AbRaFQZ0Uevr/lBrgA08yDEvkz\na6qPAp9ngsdHFbcXLnnfusW6UtWp07KsRekF+RzodmO9wVdZEtbYp/h2oAso\n8avS/7V4ABhuIZgS4Yu+MMih6oPhNjs22mDkrn51G2Tg+8AC4msheYsNOf0u\nLLRM2+HnUnPaGDsIOyf32RUIW0yvPGYEBta1ryQxMKyidT0eAo2cjD/y6S4d\naJl/Hnjci/EPhVsMz0cqBMSyym4IyM0D/ALhIdR+zwoZ/tyFXB7FLIwAON3w\nPIXC\r\n=b4c4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDRGaNfVQiNC5qFEPGGbczrWepkhUINBhndTp0kgFIPAIhAN+Pvuo7hSPKwogfooYIleegr6mKFphd4hp8xPvpuqOr"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.18c25909_1543923574665_0.22408589613024388"},"_hasShrinkwrap":false},"0.15.0-alpha.aabf7a5d":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.aabf7a5d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.aabf7a5d","dist":{"shasum":"6f039612ee051a1f2e559df5101322eb78878275","integrity":"sha512-kVSUZnembM0jU3pbk/9H9rCeF8iTr2xSKxQBDnpEy63f0410eBAk8AHY8GiKFr+AZeDXs6aBcHO8g5Z4i/YE3g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.aabf7a5d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBvJzCRA9TVsSAnZWagAA8XIP/2zpMg4anTiUcF7nKk6x\naBgoWNWEMwr8rjisIaUF63Qa5BSNwOsyfG0LtFDa63nBvOJYnZ2Q1yxmdL+/\n/fSxhwJu5A6W9Vt8ewMzVii2dXISU25Wg/+fcaFzPuydYTeV9213/QQy1xL0\njtg2Y57Vm6jrDRplp34jFdODcpKw9wMpi4WycKjDGWQLBRH3plv3SqDsZSCn\nZzZu9NivlB8zFjOFkv264cDNZi57IV/FCYw/O8DLmZbE/AbZYYdJ+vncUFgA\nsYPjNELHKHlvokBCpel659T5aIgP391mJIcNcAdnbEbuSM6ibEAcqM6yZ2+/\nHDmx+VAx/bDKJWSlwGtd753HGnCWBsjbckIoqS+/Q9cIZybS8/ItZgouBfLA\nw8gwaVK4D9IYJ7GahZaBfRYZirXuN7GMquPKtENj8AobQli+Q5RxRn+wi9ua\nVG6nDemHqqWIkuIRfSMoZiViPdK2Zygh5Cjk3i17PdHgSvO7Ks/LtbaVWmAI\nN99wxTeW4eRkQFyPnr22qB0m5ry5FPZpgWnDLYlERPN07VOi1Tz/r/1pU7bg\n+XgXWfO8FNSm3P9yOP3oNS/mxBihlvYdDQ7GfvAT+PGkxZ9SL3Ypd/HJjdtB\nyYAR3J53k8VzUUqTE/5bPKaxJyr3R+vzT9uFCyOnEUJPZWYNGWwpUfMYRzSN\nCcqf\r\n=ouDb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoHTOeFuD0gUrUZmVKcTO4SLFYCGmyAIoK5N9sihwi2QIhALyBPHBwPeqAvqbImcUtyfwu/lGRvAyXRdbPD5SDIWkd"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.aabf7a5d_1543959154962_0.793825877523453"},"_hasShrinkwrap":false},"0.15.0-alpha.f15d01e7":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.f15d01e7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.f15d01e7","dist":{"shasum":"2251deeb7813fd79cc898c1ff9e57867bb937c43","integrity":"sha512-KsmkswryVHhrKGhvzDrt0XBA9kpLjduL4Kvo1+/maSl0i/hc8YqMb74gb7LhIjyxd+s3waOGsTqSemena8DVag==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.f15d01e7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBx+RCRA9TVsSAnZWagAAdl0P/imMgW6NeYXdVsOLmIQ3\n27zfyOroEpnGR8P1Wy1yOvJUj49OdihR0lsPJF6p1rGVbVtJa+hRPPsHafbt\n9g3iP+NKcbHM1LvHqGm3+9bM10a4oRIlg5bqYs9Hwoie/JEMSs8llvFAe59o\nU3yrYQ2Y2Wy/1zu5+kghkt4PpYVa7uwV4QjjPBw4EsWpAGgcfRmfPtjoN6Um\nXUNSF7Wt0DXL+q6n1nuWCbSX56vij+QjGzA/pAq/p/nPgmSX1H+PwB/h3FlC\n0iVusov2j/qXA1K6yEm793kSMlKi7rFJbNRY6KCu+eQSJGrYrultHOruNUMq\nZakb527fO1EkFG/qL5HSQ/CcWR+qvXSOAJi0zdH/v2Ry6pvyV5Reowqpml8b\nSIs9y7iOsOBvvO/FeIdP1oYw78cCnmm8v7VELAQ51y778R3mYJAuibb2We2t\n+HJ8DBBxXIDmcLEs6++Nf+M5pMRXUAQfgh4m0fDGTmXwJkFS3rzVBKZ5drtj\nYaQb3/86dHxlRTqOT7DD9yZmpHqy/M2HoQ6Gla2XtWwds9xLAXIDUiVJJaEX\nqsVLaHAODGV1cJdMC1+jrkMNs6uwBrD1yGG3ulsqZM5C50EpLyBnYqwmj8NC\nf3qQhauUDcXMzwUzE+JbLyOVpHv5c3U2mg3XNvVvG/a2aQ8FD2m6dyWGA+9e\nlCKK\r\n=YQKI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDRum1UBlVbrvALqUb6RcBCyjBKFD4fX0K8ZSyo+M8faAiEA1gCjDBaDbMNgvqD6mlyDK0PdRX8Jy+vHOAfrn+4py+U="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.f15d01e7_1543970704151_0.196808016341113"},"_hasShrinkwrap":false},"0.15.0-alpha.2c9f532c":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.2c9f532c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.2c9f532c","dist":{"shasum":"82665fc24af2e62b86bc461512b11cee1c5ad84e","integrity":"sha512-1FcATpSTBr+Xwz2yYqxaWf3TbpZ3eXsIhij4aU2K/nQ60km5DPT1iTHKy4P/PHawKxcPRrkhiAOZoIasMAyt0w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.2c9f532c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBx+pCRA9TVsSAnZWagAA9OwP/RMqBH+CBcD3gTypDErr\nZOxzUG3TGl/VUiWkn9TmSq/gzuqkJOAjgiQZlrnzYlaMiPOWjEaeDedaAclL\nFgz/244FJ9wcN5iX+yQ/bzWkRTjFPQrloWVFlrSFLirLwck9iW/SKNd2tMQT\nYdHkm4/9aAq1nARYvM/NB24aIa4InLIWr3F/Tp2QIIVLE8Opa77AIXU8C1zt\n3Ghc+qDgmaimzWfJIgJHgILtxoBDkfYJKbgAwyt/DO21rmum4dYMdz3uJ/79\njN7SbPD6PJ9xwomzb2R6YRxAacOVFtsB+uljfb+A4A6EuMBvjv+JHuq31fhB\nJI7WZJIDQ1Sxnmhs4ertdhKYoYjdnnO3TnGKgHk2h82gZTb0eDzW8S9Ozro4\nifAtbp/PcVR1+rf+zK6tSkkqoJ2N8KLfICWuL4cZImMFhNdA1ip4V/HEQouP\nJOB05MiHmJi5UTUx3WT01ojTvLl+8Xs6sG6G7pSLxAOCmWhFh18GcmfU8rUz\naGS9zPnK8txlcCPKadO30DnTntPS1ROO4zaDqoNV474jBg9Q/NhFGgaXjZdP\nPlVTVmzhj+slgewk1fyGpxCUWLniq9Qbu477ZutPeUtZDqe1YWD1KTJtK2D8\nYIOx2tWvRctBVfX2bmcf1xgjmaj2RGqqUXUb/BBJFtdV7w7iNp+qZyLOZMIL\n18Ch\r\n=9lhT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHPWkIthURFWQ/+RLEDW6x/DktU3cMgGOabH/zs12FVIAiA7nE3yDWfsvLSbySPAU6IORHbasTndk2CqFQRMMPH6qg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.2c9f532c_1543970727944_0.6106052086243627"},"_hasShrinkwrap":false},"0.15.0-alpha.c686479a":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.c686479a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.c686479a","dist":{"shasum":"ff2a4a7e89fbafe4814d2713c1091bd8a146fc7c","integrity":"sha512-Wr8BCFeI/4xafEbde+mT4tAmaYQTFJn1sKYHrb7c8bH9FPMejYpR8MF58EN6Zoe7rAvzShmGNpSGeKhjPV540g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.c686479a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcByALCRA9TVsSAnZWagAAxRIP/2QzRuXOFhXVRv0Bm1hN\nRe8KB/MrIMtG0w/Bcm4uCMCzPBO9u6cU/SeIm+iG5FWSayyj6YXHAwHDcxy+\nYXGnbFoGexjOuNGMoGGKUbWxJGxqqnS81oOFieDlmZs85vszKA9IOOJSqEQO\ntl3jz+r8pHaiLBs4pZ+CfbJHGOsb0Py3koxYa0/cjderqRTkwp25r96Jw3Sg\nLWhL6LtzjUL8RXKLqXnzItxmuXx6381BHQQBt3xOHYh1dCLORWob+9uuebY6\nEMvUKnQXj64eDklbkaeXatj0TZMifUVTU8DUBW3Dj6axSCnFWe8Xq5OlGcdb\nGhGL7gDREjYy33tAgi/m1JKfbG5ekgn03tR2f3QLJtVWPe1wFZfgwSSeql30\nisk/MeG7SiFUU85gwgbBztvvlnrJxkYLBI9LhaRG6n1XdAe106Uw7hmzmGsI\nLGUpIy031gPHB8ONfoNSQKWiJLtuCqpGQzttI8s32L7+3s0BGTRn2bXU9KNc\n2113u5QHN5Iamw9LuUsWJrcX0TSUslGisADNUyv48q/DHSTraquUFsOOuJkA\nMdPQljr9or1FpHAuqCNlMq3GD4agZOlgbP707YYtugYTXi654cr61eUxBzPv\nyl8qGMaQCOKGZ6u1vmgt3JxV3hOuifUKOkCh+fJJUyan6j/VM1N9VrTVsclF\nSPWI\r\n=5MEI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICn6hkhPmdThMdKfunci55kgz9dgAQhJbfFHgBY7bs8yAiBqVm1nl0zgaoFb44CRDM1gt2SqxQrtodRKPeqcEZ3Mfw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.c686479a_1543970826789_0.9759598348970882"},"_hasShrinkwrap":false},"0.15.0-alpha.62ff8d36":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.62ff8d36","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.26.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.62ff8d36","dist":{"shasum":"fb416841c05ff7e24ceeec56a1a48a4aedc8cd3c","integrity":"sha512-VxwjOLN7tXE+Xi+y0OivTR2uw0jGPKAIChzhrkl8hNRuIrdp8bNWm9hzPPk15oOtxrmP7kCZXiiA+jNLsrXMFw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.62ff8d36.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcByAeCRA9TVsSAnZWagAAcpAP/R7vDhTIga1Lod9J1KpI\nppHN7sI9tYvOzS6z0JX7qORGbgHidCFGb15sdbT+PrbiH+YeUKzVW/aN5I0U\ntC6J/bwbjGK2XOjXNKNFoaxaC0ZjnTpRh5rcuzwhcrDDmj31592xZQ7kxvct\ntWi/v5C9VOD/hwqLTtiONHvBi9LI/HR9/BDBnjT74DguU8Y3+uK7lgLS52cB\n2DM/MJO9fr9KQGqZCANVIdEE4c+r7vm26f1OH95EMJzm2UIq+1ImVO3S04Ll\n5IhZFMofqJ7aygRRmILxsDC3EVZWyo3ySdWeHCCk+Tin4zIYt3QIbE7IruQ7\nfOAgNZvwX+TUewDzQ/npOCT+Gcg911P75kSW8cGQiyfnewO34JPlqJE4aNbj\nsm7h1XCvVd2UNWseTtN5A87RF9awYPkWB9HiIJfyb6TEqSIvkC8OeGFduAL0\nmViiOA1e9ruTIZpyZIs7GCrq1/5TXbnnRtvLBGtYbrHTqABAEPc75HFgu3rd\nxKYDHL2KaRrNpUVHaVzN82kiRyvrUw2ha7Toaqo36P2nxOOa9YHxi3LD7TAv\nRWZmEuCRQtEk3wWiVhFpP/tzeR6EcnTQpLF11rw0+1/uJgSETwlgmIexr6wp\nMP3iwUOowzq5iu8rG2rIUyElm1IHJ3oYSVDMmwfWRvEEn4S7iQxaD47G/sDL\n142F\r\n=htKc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBLqMvIfjhC0VtUqnhnUZxS4gFkkzs1gJirqlS9/CnFBAiEAw6pRIO26kNW7VNq+jdm+sT83fDZ8pCyD2jf+U06cCOc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.62ff8d36_1543970845659_0.4671476234293481"},"_hasShrinkwrap":false},"0.15.0-alpha.68ce78bd":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.68ce78bd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.68ce78bd","dist":{"shasum":"ba80d96f7a4e98aa23ccdbb62a622826d1894685","integrity":"sha512-cWBvaRVUbtcHGg5SsYBN+vfH8Q2P99h9Psfa1GjfhxwDK+kzpNhJunEwW3cdNRXfp4qhlGhM+bD2A+OPviZHlg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.68ce78bd.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcByCbCRA9TVsSAnZWagAAdDcP/iMOV+oZIC7qYRrWP844\ne4oAXyovAj4Ctz8rGqWxRJ4NjR7GkSWt1WDsbmkNqtq26zW1MCaCEUnoXPrr\nE3yKpMlf0iaxAm9qeVxV9trRrRwPXJnPyxbTpM3xIzFZr7zjWlV83cqlL9qn\n2tCvtvlLWSHdTUIfsTh8ZqV2ybrcWe++TJnMZ5El4mXXhTBc1XYgqKOkw/kY\nU8knsbd8ukHxeRm2hPHA/R84oQiTcEfEhq2O6gxttDA+T/w+Kw+TstBCO5EK\nS6LAqkklDlIihK5lDTw/8U4sx6GokzfmC91nqxmmiaWQF7hWm5MqDMTHrxw7\n61AOdD+uayFNKjFGr0tip1NyX64soQUSm7haJEZd103NvSKCXHa1QsNN6cgC\nKDUNWRmkri08SG5iOauw2P3aXYJnmdeS1YSZpbf/tY9U1aZMKtdJx/bu/ndE\nxwtg8lG1y4XZgSlhqvk03k58t+2mus5jL5wql61ART4v8xHJwc/gWa0AeNt5\noDNrUz05zgk0CKUg+4TUB47VYl1sMEmCGaIDgDVJQeiIUDpY5usyNHp+c/o0\nzIi4RkIuGeGJnN+/dBq/hVgMDS2nWATgmmMWDkmDb/ay9mRu1cp3L16bCwrH\nvCVSFJXQbL9tqVx4O/z6inglKDwJDKkRzBCdux4ILJwk7PdlN4nauaIOgn+C\nMz30\r\n=yKGa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDPQjFg2YKOoUQ6hO1/3w2Cg8NpRvPF7p0uQaz/xFvarAiA+qDcJfAANDIhLzTjUppezeSsgmbnwUFoxjiaeOL7VEQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.68ce78bd_1543970970456_0.005043785247280885"},"_hasShrinkwrap":false},"0.15.0-alpha.4f004b37":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.4f004b37","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.4f004b37","dist":{"shasum":"6d1e4fa9f1a731be6785628f1524c97f1f89eadd","integrity":"sha512-f7HtcGECep4n8rADFugFuhioGQT46Ud+K+3IoKZGul/XNROgFhDkNEyPhwWoieUezHOegP/2KCW1eSGhADj8FQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.4f004b37.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcByFrCRA9TVsSAnZWagAAKUEP/Rxlnk+/iJfFA0Glt0AR\nygc+bLe6JxxypPt37aeEWuEasRK+SLIaeZK3gP15qtXlu1eMOmnTW0wE5cFX\nrH/VUKN8n87BIay4VzVv4Va27f3o/AvtUuZ748vgnoMkqkJgQ0SgfIYiDtx9\n6/pLMO9QurQUVF+fxl7IsuxuQKyKUYOWMlOb6IqMMYXFr6dQvvcfAUROGiKo\nGfQLRydwRDS/nEUFHmR6EFcNG0xAVkozeYmTN0x5I5hAZyRQH5cSl6JIGzuj\nfXd8m4SlcylVxeqh7dwgnFoxEz8NnYdXf8oRGEwf+2cHUbX4Qx2VHoQWoKE4\nXrkPh9ciPfAgtVL0kc4+Ez4jxicmNnBiRVZxWZB/ZG0tJN/8M0dhfLeP2H/z\nlgirDfbBh9+zppT6w3zENaL2nzLhZDT3wOfum7PJrDg+s1MNZAurPtpj0QDW\nopXgx4XCyAsiXtE/InYCPhCSfgLf5Jo1y+NjwH51+dIFZpHzNKcWMpxDBQoV\n3HxpXtMg4xa3YrJdoYejBO52F4QwX4erjMBagpcYta8//sAuQwudMeiJnxvH\nRpRKZS2NdBF7qQJ58PdwD4lma+xd22MhGJ1MrfSILzBrlnQ8NWEkJxdQSJG3\nQZNfOOe6pIlMde+mIUXbXqVebr0gREYRG5qyt+f1vrqLcampk9cARdqvdbXM\nHB9q\r\n=3IPx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4MecyTtcDqQZr6qlh0AWjF9wgJ2XABNc8Ww/7QD8Q6wIhAJ0Ax/LgdT13C6IntERVOxooZ4c61E7Z8teQUd1EVmTO"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.4f004b37_1543971178571_0.9323389645910347"},"_hasShrinkwrap":false},"0.15.0-alpha.1885b0cc":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.1885b0cc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.1885b0cc","dist":{"shasum":"cdb7dbd1337d236df6d62fcc95ee573b60d50eb9","integrity":"sha512-YrfQ/lmWhFwd65DYB7pFD4WYy1yF8NpupgZKN3X0s1mLBcd4H6EV7U+u/AOE9+7slXT3Iy+STldxoLpzFnN7dQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.1885b0cc.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBydsCRA9TVsSAnZWagAA2A8QAIgUVZYS8eMyOdj1lwmN\nt4l5IxIqGQf7lOpVcwDwSRcfDIjq7Syboa0bdTdnmvOjJNkuFnPdrV5B0Ve0\n8CZdocy6ViIIPawqKgAsKEC6nilcrWwvOGU1w0FNwh3G2hglHqjWE2uwQZyf\nRQn+yLvyQeeSXX6SJu4wRWnVwvx3s7uB6oYYislkl/yboOHuw3U9/my2bYsu\nm1pLJdbtOTHX+XHRMBLn8YYk43NIqhVEbKqe/0d+sClqeCx1c27cSAaRcvdj\njrrDH0RXd3k16b2yw75cOA3B1/J3zyb7fUF3YHzn9iDJcf/MANp7NE/Ipx2X\nWitbfu9mduqH8IIbgKtEYHLqLQHP/Le84YHyHKQHIoxhrzRp7/4LeQzo8PaB\nHKBaury79fb//hUA/zYWuZeQ6mOIwC7OxAVNp63+COIBUc2z++qTXm5gOl5n\nH4t3xTcK6ZQ7evvlkw2iwEGMfm//nSCMDj9a/OqT4t2svhw/ee4SQTRNWoCg\nNlgP9egBYa5ea2JXosL03kdUVD7lBqLWTPj/z4b3ShV8hmeg8STCkrumEK+d\nzgeU330dvepZQWlexVMCN9HUgDllvJTWo97pn1SA35UvGelH2RQb6/TO+o7T\nHt6toeE6u079MJit5h/7yB8O4qKlZChYSXKedvsKO1G2Eyo4oIltPxaZKDWs\n8gmV\r\n=zToY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHfYuKCMbl5zWSsI9uGPrykAlqZngcQrDbLE3AUFLeoBAiAekbx2utb2T7++ZpghMHq4OCXI/B5aD56RiGdjyUhimQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.1885b0cc_1543972715457_0.34934497952216903"},"_hasShrinkwrap":false},"0.15.0-alpha.a60dd7f5":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.a60dd7f5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.a60dd7f5","dist":{"shasum":"f53cf723352d7976a5e79be4a92cd9cf248cb217","integrity":"sha512-8tFeOgLb/QpZUZJdbRrQPr7SSz/8j0azyHUvom/BPKrJyVF7d5iPtusURYazCTz4PjJD5qsXxBeXn1LTEwel9A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.a60dd7f5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcByhPCRA9TVsSAnZWagAA0OEP/2Yf+oxwthTxm/RIYWOT\nX6Bkq7nLpZS3fqlSnpBdAASWBJQI67BJ2qPrOuLPQrTk7rUh/nEBhQ0eW/GD\ncRZMxOgNQ/g+c8hG/0F28xleo3Dr+hbOlBN+2dZouWy/yJyIEntJv24o0sZI\nh3VTM0sFhxaQvmhnDuLu4JVkwrV8LDb5cqQLK65O9pB+VQDffaBxPJqiSI9y\n1itHj2k9G7MnfqeqrISyvEY1/dmD0TDhIEWeJL2BuxfYKafwFvsvTvJc+II3\nBK6hZKBrkTrra+jP9Wt3Pa1hSZdHsBXWq9SOViMH45lxmbnRyzYxJPcnXagx\ne29TSdftJfoH0L+qecjziEgZKiKbNm6eZhDIeaX49KWCTPoshA2iqtjG52mX\nDCPZ5ILDcEy1y9XHaHZIthf1V+FnaHnoBNfoPWBReZF3VoDSafNytpA9DE87\niVd3olZJymEA3LgAOVFXgfkxlDMv8up/k2FMhuUuDDizmrXFPM8vIsmLKpFe\nP7rghbWmbNmu/mhrRiTQCF2FAcCHOcnOVyk/JlAl0tPKZUtZSWIOO7gbEj/5\nUk6pwBmA7mdglGNz7YO+1VGpbYrxBM2wUSg6FMobSYI+R8rJ8PiLZTVAYkxf\nc/zk9KVehLKm8X10zZnY03ArKfmzhrYw4qOInEwyenxSWBLgKv1SbiW4aVGM\nfWpD\r\n=eTTw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHr0KyhFEChX492t5kpuatZqxSDqWVcglATTlutOzttBAiEAx/DSYyNRj9+4aY72LYZOfAEfhtQdDqN9c+Y6UPO2C7U="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.a60dd7f5_1543972943191_0.45293224304188606"},"_hasShrinkwrap":false},"0.15.0-alpha.3e5bbc85":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.3e5bbc85","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.3e5bbc85","dist":{"shasum":"3ef537e50bab3bd7c7188b75e0bcad298c058975","integrity":"sha512-Pc9rUfh4m2gaN9xUKlAADBZjyJCyt4gSVp876Z83mGQ3IFJ1PhAuxCyUalJMZ6m6LcjRAAwqsiEEHAbYN19oJA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.3e5bbc85.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBzMFCRA9TVsSAnZWagAA8xsP/RaBwSK9ruJXSiVftdyP\nBpLYH9zyWVsAt2zqkJG/dJGQfh6toBVnWTA613U79KP+UT8Pb2CYoWNWZu+e\n5iPiZIh97jNKjFXVZjltRE+yVxYVo+B+p5wI173a6BnN9LHgEeLlcKAVTrZ0\n2me5/fLJw6Navne9VcH3iAG1weibQPP8O+EpI5yC97qYuDS2WOQwQUgk288M\ndAF5T1fwsNPAuLp+Mv6oC2WWJlQK6cMbxa8LvJSZM/VQLfc7oOVCEqn+5fAl\nJ23nVQkrsJQH2O7KRbbwQV4wRjg6nxhltbojjrAJuFSzXg8PmK74d0xeqFz9\nUzMpS3kUFeX+pvBdvJfhOcCHveN3HnBjPlQBnviykYK1K2qq70AzKQS5Xgg0\nVIYkHFPoRtvhwHUmmnOJRSJrhCwmNHGpfqIVVJh5R1QSDHqNDt6uW9lZkHWX\nbHN/omv2I4WEoGqfo1/jQV835llmH5t3oeMEcaflIH37jOUrl+RAzdxXJDna\nquL7xbvf9sxdln+Expze8Cx8hqC9368oarjfGtaQxR0oTwkVPPz1hr61ySJE\n2pA8+5012Fwqt7tH85newue3ginGRCzSDQJ6xqAWx1PIrEIJqGeWUVbDXY53\ngRpJEGvDJ4ZGGlADZ3hzI6LbxxIciulNEfMsXlLbXClcxG4cfWIqBf1mYiAz\nb+35\r\n=+xYC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC0H5LyQ+3qYnCHOAh8h5C3i/GweiUI3ncfXSzIrvQ+xAiB1tEflwardUJNOMsaBny0fLlbUg5EDMGFhb32vYlVZwQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.3e5bbc85_1543975684245_0.9777055096293437"},"_hasShrinkwrap":false},"0.15.0-alpha.538df1f6":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.538df1f6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.538df1f6","dist":{"shasum":"858823587c7902bb1dd14f106da45e1fdd57a3c5","integrity":"sha512-CNWoShwmuICpOtij4oh+SB52vVfCSVTMzIRCETUjBJJ90LhSY3yE4A2SxojdR/XXFDnSrleE1oSkVzyG91pYbA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.538df1f6.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBzZ1CRA9TVsSAnZWagAAzu8QAJ4Lgo1pDMypTBrovq6T\nSWQw1S46CxpyLQJBhWgU9lfhxtI3DVKZZdmpOskR+JCv14LrDiNv3QJr4jIO\nrWT1k+pHLr0H+/oBTKav25ARfPIowrt81nKdgqa2hQ9BiQ+wWv5vg1/PfUEr\nwlNVBg/7mgirxs2O926sYyeWkzFJuRiREPrqcrUoBBmoa7UJUuc5MEFGGN6c\nRFbvrBG49kPG7sLtgihXoqDavQwt32LY04JRj/RyTpwT1mMp/PoawcQOjOnJ\nRONFcxNFEsX+AD7nmHhynqCcQx1W6j9/m/W5eqG5NL2vCXNwxfQiV8oPgc+P\n6bMCAxQfnZUTwlVUB1JZ9w3xkLTUSadfq3axApxWrtaUpKkjrs22Xfo4rg70\nZXk2ubKfqXS3ofDzdO8MOfttpbbxNKaHbeXzvsy8ri9JZPZq/DWikK2zAsMQ\nx/VhCBZKpnNe6fRUoQPIdBnGPMXEhkD/qrFlhPae1obQBcv7u7/KmMCZdO06\nHThnAWiIjbQNwpgi6CQnvryClR8RKBD0XwH97iZ7fCXMQJG6XDIowjR6F9vo\n1ZzWkcwuP9Dx1db+ZcXENhooTvZfsPJBmU1UZ8PJHWu8DBMliTnwhKEnCP+e\neVQfqblcX4UpPxTEW95dQDfuED87LSBSrbD6IOwVzegV+gnsox0nhveVEnuZ\nkZWp\r\n=ZsCL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAkP1XsK3RpLE/H8j8M+D4hl7xnaoWAwu/edgE6dO0IAIhAOufo8mFaRgog8xSMwqcM0UW4795qZU2dhC8H11ro3Zl"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.538df1f6_1543976565122_0.022550241976676544"},"_hasShrinkwrap":false},"0.15.0-alpha.2fceaaa3":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.2fceaaa3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.2fceaaa3","dist":{"shasum":"d4537aeb6b4823ab070e402c93d31f6e3238f6d4","integrity":"sha512-yOlKu/DIMRrtvxh2KphbnugIYPE64sB8IW9M5lzCRX7qw/LIPKLuhpxmhyFZJYUuTJHjAVyufYdHr7UF7TaPyQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.2fceaaa3.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcB5G4CRA9TVsSAnZWagAAe1cP/AnwUO2Pr6Ri1YoZ2+8g\nn/Y0O6Sk6ZxQV7uMhqIqpJxeuuAtL//DpCTgNVNPQQ6Is4yrlKegiJmH5YBM\nEAZV2SMkFArmwz/ZwlEH9irgsiF56Xhrd19fAvxIx7wonvqJE3xeBl71oLq1\nUIjPEmPq0+6rPpBQXzrut9eOKrZMEV2+vL7fF1L6c1jd7RV6qb00nW1KvAoj\nJfgqZmTQFo4g8yXMoSlTW+apHnN0kTxHPqHzZsJrcbQW7vtEsjtkziQruYVK\nIi6MxIu+xiIP+9pEypR8eKxvnGqJUOVixuK2IdQK2hXbil8VKSQRmrAE/zl1\nMTrEd2dDAYlvspfHPQYZswc64GfylBrFEfBHYzoNtxDa+8RjWP6xwt+HnK2U\nJPYmMRWDYt8YjPT905PZfJqIkA+JGJkn6ePSiYmhywqd/qr5PxwxvjfA51zw\nOpsQbt2A9339DREC43I3bu7x9ONwg1xs+9XDbHT/XCklFZ+dpC+z16Y2bpiA\nfhCfFKNS4WHC6sfjbIhAfV/IkAKfQshVco3QjYcQlCF+JvTpoFsjjyZ9iBcL\nzFLdXCd6SHsSxfBifPuzDduC0k+gnNnv3lQxxns3FoBiFMBJCZSvhwCCmzHV\nAVwzyfJa9W06ohFPNBzCzTrhTQQ2GW5KUUOEgixJAKg3lvXECCOxebKIljhQ\n5nKJ\r\n=zrdW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4C3Pqhaw4RfAvSU00pXehIEpss+i9rG9RrM2uU8HhdgIgE7Lbp9Rw7xt1+yzF+3GC/OcivbN+v1bcisHjWDVCsYo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.2fceaaa3_1543999927342_0.8607587348827155"},"_hasShrinkwrap":false},"0.15.0-alpha.b9fd3b3b":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.b9fd3b3b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.b9fd3b3b","dist":{"shasum":"1af4f79cfdd1ae1316617c908a984a2d7b9eb8a5","integrity":"sha512-lnBK5ChSkS3O5yVNbFjcU4g8QJq2ADTCagSnwM7GFcHrLsEVWNfBvwhmL27q8W4kByuweBtnFxLIv7Cdz9DFJw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.b9fd3b3b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcB5aHCRA9TVsSAnZWagAArKkQAJGWx4APg7ics1VFfG+c\nWiu7/U0h46T+30cM9heESYaQsKOlSGCmZL73g5W+zY8H4n7dNhasHdSE97eS\nXivOZmOyYTf4n9R6rnh5bxj9RR4P7hZc6jJywM/Jkd94i4pHAEXqm9qSthZm\nQMXcl2Y9cOdlYYxoe2WxSfaAfH9frQ9Etg/iOKCvJtNZXTyvmZZXiuJEDagU\n3rctrDEAnkUqPcWYAdaRo+VKKdiFchxN+9oq8XLuYjIAwsUeBxTfVo66EpfO\n6+DlDWzktiAhdhdapex2srb11Ml2Oi594Wibnz3sC8qiHpZBYBxteOLoawN0\n/wJv8wi0Q0gX1nkB7EWEvOWCmdYlYW/kUK0BC71NWBKlizSTDBENYguJqSvI\nhVMV1neSDpVaKqxeUJGvy4JZhJidGJd6czjvde5+LHg5ZE/Qj/7V3yCl5nEE\nohhCPqicaOgpnhgelpbb1TMCtAwpdiB4lLVQFF9PY+XB8xlGDCCZO03tbt8e\nLet7X6aaPObBeHHVbHdXKUeRl994vPg5NkhDtYG5ZScne70mYDVB+ep6ruM9\n+NVlFnCCi1XxWwCO9+gWKPYMg6WSAfY0Dy8nuhZwOPjwbpeZmjZTx/Xhxyl8\n7pQcK7vI/mfq/lXAxVeHCzagPLN4nsHx6FEindqx9rG9MUOHNdHy0HFKJ/4E\nCcpP\r\n=ZEFN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAUSTK9VHqdPOqIbXJJ6NMlZY9g3eGym2Yw8d0Q+KWvaAiAB7B9ZHShxbwnYK7BKYqpPo9e0jx0SoBL0XxTNBaG1ZQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.b9fd3b3b_1544001159026_0.7841839619919726"},"_hasShrinkwrap":false},"0.15.0-alpha.9b5f3445":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.9b5f3445","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.9b5f3445","dist":{"shasum":"74ccece955fbcad5c8cd35d250a441e246c39f95","integrity":"sha512-+8UejA6pGE9YJQzNCtZa86GVhodjQ2uAuN0eAfzs3Moimn7wkzGDk/FNTKsGx2eI9eV9jZQvJthmNhYjC1S7ig==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.9b5f3445.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCClGCRA9TVsSAnZWagAAe9IP/AxdE2l87od50Fzri7O7\nTAkl1TywoDrp6VtuG9/MY4gP53yiAtOQeQDUyehuTBpwB3yjBLLZdn2SrG7q\nig42cubnIGz4zAECkDShekcWoZ0MhfCUqFLck0Hy9cZcEwhVDnt3QPrPv0AI\n9egPo4h7f8wNAwy8UO/hwbkFYiRh6a9dV3Dr5YqKCHKH1aPZ5nwsHOCxd2n5\nKa1okxyWqBmAjReMYTV5wXym+0DueqKDTaJi6qC+mc21BK3EdzYGAKqbgcJN\nm0dyjTy/owV4+cYA5TdSbLOmOvdOgn9naptsjmg6LRwoWka8y0upe5dn92X9\npCYhqXoTC9QRISUWOnjASJ4P1yT1SzZnSg3VVtdtpNBNAr8BVLc3qfbTqpOx\nfn4eoWBd0SMXlX/5d51cKQwtxYV4brzx95HAmoB/v2q4yc/xwoKkWKYhJilW\n2vaxDglvIeuOmBeRZ8MDXnb2kxHTnn/IYRz6VAui7Yw6ZzbApI8ik4kMI4Kt\n5/iUJMcoYARmmBLr3VG2TGR8FxsFhW1ID6NdWQ8qQ+3eU5+iuQ07wb+QRhgH\nd8I/T/9dTPSYxk20jfJynbuWinggtrwecC6rR1PCDyrmndviTSBdCofyFBwy\nGOLu/VsHkcFcNUY95lYt5EyCr9oLYfKzT/xUJDsCf7zo2G+n/oU/rAZ4aCUS\n7CJQ\r\n=RQUW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDK9/1Y1biJ3MxUzWyJkY9d73YwRw6Qv+g1LmDsuNHdKAIhAJEgtzDEezs5Son0WtnNnlezrN6VnjYLQ9NoYcFki7cJ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.9b5f3445_1544038725635_0.35626413767462917"},"_hasShrinkwrap":false},"0.15.0-alpha.9c2e949e":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.9c2e949e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.9c2e949e","dist":{"shasum":"25678e53cdc21a08db86578b3a058c3930a48392","integrity":"sha512-6a+H5uL3xAs4WBVaMGBeUw3WIkJLZtb13uSo1e4B67xp4YowQZkbWghlUdc8atbjfxod/N7fNI2iVHiWVmkT4A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.9c2e949e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCERuCRA9TVsSAnZWagAAuw0P/2q4Aj5wVsyfjOmqb7cj\n+fNv5lPMGpzmnUbPBBEfLNn/pdkWUzrFPkVVfC4/P+WGrM8y7XCiMvvXbQ/p\nJfWB2zu/eJQflckPv3n6qFQWCk4REnL/w/OCoWbJ/Skx+Rv30IVSQv7LAQrO\nG2+2WTws175OMXpmz8XLjhrusIxloP8UZmPoKOD+EnzbS75YtmJ8awT5tpzs\naEr4+AcaKLyfC369MxOvJCOnGYpHYzfvfO8h7O3+pM5PbSu4Dn+JW49vUWWG\ng/86hv8kcCtM9skU/n84bTzPah0AvT2aFMlsY21X1Rx8Sn22p1axArdwUGCd\n2AmRyJJIMMpXkdXZQyabZfeet6K9EMfFMXC8mSf6aanups4yCJcykRm0Dvu8\nBg72tD+yAolYTf4b16zj9Qu1BbpvkvvRfcIw3d9FkB6K8ApQE2qVARkyr/j/\nD52BUgGFcEz4AQaVTeq9imOdoGC6ed/YrAsqS1OIdkw9raOEiXDn8IASKytk\nmDk2QONy607+Y639LrMOxcyy9shViEsZe75PYwFwGt4gjPRprRRmWgFiUN9U\n4CR8/z+t3eBcoBkuheJdJXpuFElfGYHWu0a0grmKlE6n2Gcl54rgbTMnAwyo\nGG3dinZPAfS/54II+DZge73FlLpcTA+F73lykvnsAZk3u3TcBkcI+iOGE++E\ncWws\r\n=I210\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGOxcY6W7err/LtYf1s0ScARqVOi+iyPSA+kWAhIvignAiEAzXeQ/ju9GCaRO+ZcEig87SfDsfNE7ME8QSiiMBugYI8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.9c2e949e_1544045677474_0.8221060714039123"},"_hasShrinkwrap":false},"0.15.0-alpha.6e78056b":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.6e78056b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.6e78056b","dist":{"shasum":"3bb722cf341a5b8b4bff0650baf8e61d98661cf2","integrity":"sha512-8xH3pq6QrmSh0T1CcadJ9lIYNh2ZBrsMP5c9jgp5XEmlkl6JO4CJm0z7G4tjyZNUFbhhO3NmJ61JfjoDjfFUqQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.6e78056b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCFvcCRA9TVsSAnZWagAAEB4QAI/4YJTU3CrTmncTodAB\nuCixWd+fK6TgLH6rbt6ee5noVOKLKwg9dwjM/d/0UaoqpYZEyS5AgAl9aIxs\nbl6zkUgoe2LrjgJeEtvEOwJZPiZoKG2lTMUctKDF8rlXvmzmKhvXBL8Qet+L\nqobMib8pL2EeMa/ED8FaBm63rYHUf38PJTC4nxPm3c4DfGmXgGaBZCIais0G\n8EU8lPGJ/jbWUyAzxVbcFziC1ynCdnlgRF3uh7XX4x4YbIPaH9o3uIH2IGUV\nPJF14FRGL8IH4W70GwaNwr8i4pY8OaJ5R53r0Yc7KqgptVj9a7soWezWxCfq\nOV63LISgBXxsNhV7YqV0Xs6qQrPEkTo5fH+uMatlDVtfxBWj+vZD5wflPqDg\nj3FknN+RenmzL8ZK/adNqX8ObN0bAINyBqtCdjcOszj5sflJCbPTPue3JOAB\nBwMr+mLs1bpXZ+IUD/d5YdS6eNdiycdBPHrP6mERvFgd6bx44M0wzcOBTaAv\nci5g0aQ065Gpk2FDqZUDz/7ZaWHAgAkPyK5wsdSRjofidIBL/6oc7ufvx2A+\nH/pUONxLchixXVcEqekinOJdsQ3gRb/R6h5/wwLtRP81UpHbm9uSwTUc7b8d\nsqWzxhboF8EVEce7Sy3vdLBOfkd1v7pjgpsH05+MYQ1Vc15e7NuQ4y9G/vvn\nxPA8\r\n=uwUJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBmZ+VHNz+iptIZYMiXs/FcNvuHJLa8/b0W8eFjImOGuAiEAq028VqXejQTF275Cp+HGByz7+c11oiIYTv9dlQQjizQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.6e78056b_1544051675345_0.6794486324580886"},"_hasShrinkwrap":false},"0.15.0-alpha.fcc6ed88":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.fcc6ed88","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.fcc6ed88","dist":{"shasum":"e56fae4c41cc9edb5e379c6188bda6d2255e030d","integrity":"sha512-kWaGtwsQq1KHqZNc7rd9eBGjkDsa1ys/GERAWmk+/9C+9IgJSDxVaPVMm1Nh1h+oliKUmBL7u1OSVvF+GvGxJQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.fcc6ed88.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCFvlCRA9TVsSAnZWagAAXT4QAIdvnfQyUWAXJ+TN0kW/\nsTF61z47NF5hZcvE2rzcvPV6L5q2zvTSOwEhbG7uwx7/pvXNoOkSHKI2T5yo\naFqtXYXdK1Fh1SKIFK9QzrPYBhfC5SmLD01UNO3en9PVekzu3pbPOP6iKX7j\nvwhzreeNShBcmQcMU6iueqoFNdm2Oooa2PxnxIbmN4HPTRwLG1+FeacAwYtr\nK7uj0YeDPvs/y/UArdIl5VStY6dY0Wn4J7DHhJ/YLDIKVeTM1uMu6nIL5Rm6\nXI2Zjbjdfip7FRICaKn4e4nBppjt3uJpcus5Fo8yfcJkt9ce4/eWWtQ43M2H\nPnOmMntgKrtXO+QQqlfBYGZPcybxtS9JQIl02aM30K4t9hAfpyzDRZ+qFpmO\n6M0B6qRrhXNRxroAJVFUVfF676NsGrZsK3Io1A2yzvkE1v5+GlNSfz0AuQN2\nMOmn5YORbqAi0Y0XwxzZzlAV+11U2KKStaHTF8zqHBAUn5jcg7ZVvhsb0Lnw\nhpIeN3pN81HgoM58+6tL8w8GdbH6qgd+ZMWxCMUzNAPlnHz1Ae1wr+N8IpKK\nfkp578hj/gsd/lvg69lrPAyY3Mk1348AD7VWRSsjyNJwLSm3T5ciwihapOVJ\nOmycvMDQ8MffAJ640XONqWUpdN6d+jgO40OY3O91dQET2abvDmaAUzhtjkDg\nkTNj\r\n=CZ/2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDneSkbHBCJYd/miFRRCXkjMmsjwUv9p4zpjmMzus1LJQIhAPSusorN8SUUGDL1JbJYdoVz48QMUV4sRtHuT4vBkNXS"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.fcc6ed88_1544051684754_0.19661384170578433"},"_hasShrinkwrap":false},"0.15.0-alpha.074adfa0":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.074adfa0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.074adfa0","dist":{"shasum":"ca3b095b8ddd3b4078b51e151d646ed51ab35d04","integrity":"sha512-KOcNdGs2OaZo656lgYDSeC9Fe8xJkbskkgQTUYL0u+9cKXu36yClyUZpR3gVg7v3vROJ6u5FDsfPp33zsY5vSw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.074adfa0.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCGVrCRA9TVsSAnZWagAAPRIQAJrlmPt1mrxiTUq+5dRz\n5s9HW4hnhDHmxY/SHOSZ0x8aOwKwoY2ptBUzq7pDQ6sVTYhrL6U22GfQSIMG\ntpMk/7Mo2hQhyBnM4L6ZWcfrMPGM95w7psQ9qPaFm+c08WhfrT5CjitUNYI8\njIvWMgJJYodxHOh0il3VbqkMCkXBq5GlulamMt7dOC7c1fyaCInrxUSyyPEx\nWulqUiiw5vmSodxr2z0O8HFN1FRTqoUuncBszTG9edFAdBRMYsyqbPRtzbhh\nEf581spyvrBidPFlgiClajKyae4TyZc29vslUcA/yD1ySAjEVNGnKJy6vxN4\nq6+dYwYn+SDJIaatRa5EOGh9sU6wBDWFUW4dWu7CZUc3pvT/z3g6NwBmumkz\ne5utb3hgth+5EZaBgLBFxaGe0EniMC2tH6nmP0gSkW1lQB8jCq+XLI23XQN/\nksUaBeOf2whBgdObePmfT94s6eXaQiB7lM51xI93cxf/hc+orwejmLQqWVBn\n4beZ/6kFTs8aUdW3KXrmdd4bdJhHz8vDIwM9xYmpH1kG/Yvq+5sHdQpLHAxi\nSq+e4piaft06s/C4I7f69axp4aaYewcXpOE1ibZm2TCtXkQ8sNX4CKauvq2p\nlRFAiuXPHxeXgpv7PAGFkLXyoTmR+EvtHQ8vHTodx25Ecc+6rpNYNd2R9ZQV\nTdWx\r\n=TiCR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLyDryF00J7p9DekmICasbxmauvlfS4GGlfV6/hTnZCwIgRvK/VIopMLBg7bWUdJvYBXbqzEiMgtodK0Y1lYqtSBg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.074adfa0_1544054122958_0.8881257525283912"},"_hasShrinkwrap":false},"0.15.0-alpha.c80e901d":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.c80e901d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.c80e901d","dist":{"shasum":"66a914e527689da40dba86b8d821696172bc7212","integrity":"sha512-SdVNW6+tkM0QYEtbJ57e6gjBigP3HsGoVjxCn+Svvp4JRZnN4MsXHbuaW4eD0lv0ZbkfnayTYDnxXzrGWrOMSQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.c80e901d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCHYwCRA9TVsSAnZWagAAvFkQAIhHoaGtNWL/LrI2zXQG\nnrO6fq6VG//ObJERU/9811aWZAkkwhAIJJx6NXpLv/q1N/R2gI3zOscDhz6M\nX3kiGLKR/B3xTW7JONeYwbSH1E9xodWMUig8paWwtlH8n4yn83X91ZepxBPc\nYiSKpIAd6TWnGaIOar8CGtoI4cHHRtUvI2Vm3oTBkOavf+oGam5qXIbmcxMQ\nxa27JoMkMd+SOJrDrBzSArSkejg493/b3lrTAXQHe4cJGwIhZvuNGsgyRiDv\nBcoU9xH/azQmAfCP1BgHI3oK9jCVA5BxIgztY9kgEkDnbpwrI9QHOeTRtqb8\nF1XIOJT1EP+5CLYhKPatnxo0qXVirdQYH2mhn9OOKuuor+P5zQS/VnKkh55H\nWG4s9ktkgOUn0oIYk0PviKw1RMs7V9/8PmZfRKydTAxWVmOu+OUwEHEj0HLt\n07hDHnHPODEBJtTa71JFj5LjhOGFMPL6n7IOtUAafQq0EMFXJe4qzGxxtmlE\nwpq5lVDDrE9MvtujBujmfSghMLDsozCfydF4RZRKCMKD0usgt5jQzdUSA/lo\nPVp8RaLBPYdE4V8EreA/VJpB/ZVg0PWpzL4abAYliL/TrymWL6BrYf9sNAcj\njdoTB94mStVTpDYTCKi4/2VjyZj9PdkQsw9l1t4sLdA8+8creJvB0EPcllBW\n0PaD\r\n=K/MM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE+NZWmlTKvkpmqB8gIkElTYVzAB1Z/TSFjaVUEuY6PSAiEAhpN3NeawLAHHI33CkyQmQqFRIoQGlGp6Y9vtUd/pVQE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.c80e901d_1544058416062_0.39083447441471053"},"_hasShrinkwrap":false},"0.15.0-alpha.28a7330f":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.28a7330f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.28a7330f","dist":{"shasum":"808309927dd5a667238eda23f137059fd90bc4e0","integrity":"sha512-D6pdK5ixp7M7QsJkghQO54r7RC5O1gfvaHIqGUgREaFQF3Ilsa9K1R7MLT8fk4eFNfC46RuacJ4ICLeudMwZBQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.28a7330f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCHrpCRA9TVsSAnZWagAA7YsQAI+EegZJ7ox7Ey9HomH5\njeh9+2TAKWE3+PReZSOpRefr5aSP52g5lsTnoiMgUraYdLZkJ92m3BRf+Km1\nRSyYZn2+rM1o/qwdOUIFdSN9CaHYD6fC6UEZqWxmxDApNN+k7eyUbdK5sbjg\nagSnmf2UrhWMUXfAvQ29y5FSMVay4b1bzOolRrEhHzTvCMrw4vgqfUT5aMpU\nfmurbG7PmfmjvJlgeUE1cObdpOvltDmYsk9fMCNo/GPwqMzxT/TesKIWq0We\nblvQ9+L0+cZgS1TVDViDFkTUVAylqWZTfwOeVavnq37JMWrekTL4z+agtvm3\nmuB2SuNAC4JNEP9PzjsORX6IMG9GxCt7Q8mAURcuEv2wgIILCU2Q1M8s31NY\n9Mb5wVdJQ++lnS/oOSawq+4qptHIgtQPrMJIyt36SWMnsM/c0/dnFOAGhUte\nHVk5jWD2bkYlg3Gwq/5HHqijHkwbHpFxoJME4XeaBJa7pmBE/SuODTilLYx6\naMmVldvis7JPVBb/UMgPUFkfo4FiBgCGLfeelhZmHJse8AQCm1K3cNqKjDS3\nL4KLD4PvKbEWz+gWoB5BzQwMXBp0mYDxbt+bpwwiEnl+Kj7ST9fKibTdTTCB\nybN2uK2mgJC8RH6c4fl2cqEVzHrDAd21zb80NEYomPS7dSJgvLwyOpMwqZqq\n1jfE\r\n=EJPe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBT2sZFI8aAbFnpJE2ZsC5rKCgvudneutxtjxtMcPe+wAiEA0eo2PDz4+xmfV+CABBZqV4ZXlagSGde7b0EaAqdJxLs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.28a7330f_1544059624937_0.6444181345880597"},"_hasShrinkwrap":false},"0.15.0-alpha.510c0bf0":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.510c0bf0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.510c0bf0","dist":{"shasum":"2e9e37fcab20199694bc5837969e53ee78765bd9","integrity":"sha512-GXbTK46X31zIErJ/AjCJsU0XSQOrp0z4SOxtunD5Pr9r3b5wAcMWT0CEngF0FgvxJIE+A2KCrCVaL26GaOdYAQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.510c0bf0.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCIttCRA9TVsSAnZWagAAQP4QAJj5zToZGl/eQtGv8uTU\nNL9omBIG9k7/SZLzCe6Ww8yd5Tycf0mJ+afT0307NRtQhhJn82nHITucn7Pu\ndP4/49l0Y2WsYzS6hLPoNiHPfK/XBqCqiNiLJT82Qz20wrgtJohJdEII1Zqq\ngzlgagC/FB68AC1pm1KaI9O7lun4qCORCef14jnrxwMBU2zm3P9eKseUkE6B\n/jv8yQ6i5Sns8gUcxuUKxKLqLh91GbIqIFWnhSEc/qvYKj/XA9PgBrnF8OOK\nceSD2aYRePNhShSMvv5WZjQLLAEzTNEnI9CaRMg2wH1uLHC5vOau0MLWkgtJ\ncoLPFOe+FW7gYx/nNkCn2VdtjY9JtBJ8PkXhWCPGORpr1VNvKb2gHQNNq7rN\nXXApyY5e5xf9V1ljnY8Zi48S1MEaT1A6felFXcFhLk+pFKZt759Vpgs7OCoQ\nevntXbWoASLiyW/7ZLP3SOxvC4PGmHYGcbmuTdGn8FyBsS0trkyvl0dKGOoZ\n4WpgH7nQGYkjm+CPnKSorCvbE76gVJcJPXIKTEUX3YMjKljyHDxWlFBhFNO9\nMi+x20uqlqma95Uy8aQSSDwXsCddFhNoGip+3QAdWVPyCHCsxcto6ZusweQm\ntt+F4HjKAgnh4b/J6aQtFqNfsj4kwxRcdtZdulE+w3ZmknprbMApnky8wiaR\nNrVc\r\n=mdAj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5QCuM4MI1EPejabDES75IKgVM6A79tnHZROJnWThabAIgMqc2k+Lr71VUoLk25Ior3haIoJvSgJ+3lrCd3jxep14="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.510c0bf0_1544063853137_0.9518527312749394"},"_hasShrinkwrap":false},"0.15.0-alpha.549543f7":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.549543f7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.549543f7","dist":{"shasum":"2d1a55a34ff553f43d59087120685d1feb2907c7","integrity":"sha512-2IhKBub/uEQpRwF1D0mSNrgYQYc57ckBA3t17lQZ/mbbb4XwFHNNeEvnDP7APqaNHxJT0U8y6Stg9ShoBCrF0g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.549543f7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCNYvCRA9TVsSAnZWagAAafcP/1spijsN2caL5r43egqS\n7Qq7erkj/6375TcH2kB3xC1J+EJuSgvrC+PMBMr+1hXrf35jwMRLwCr8hOEO\nRqcII0GhAdS3hJLF9LAr4RlptmZ5Oy6EO4re56dIPbpnygitHgTNpyd6rU5a\njuKGgOWBjJW173sRtRrlrol87qm9+Bc2V+FZ+cx/oJTRnMS64vz/tV5OkaOx\nNy5Ymo1AAsNq39ajYTj4wVjRHjl3prWBQql1gt9Xo9g5f0y4hIj8WQKtbReM\nnrhht8UJtd/fb54roH82ln2UB4XDDYaNyTRke0/vv8KiMQ1dA/T/9sl2bCEf\nQSs6QVfAoJQGUHFbUvcopBgHBolfChrmKGhk2Ocn2H9V4K2Ad5rmqKakVe7G\nH1vy/aIS/AS5Jn5dIx303X/JfOY7Ldg4QOIK+o2EtQE82/zkpUwg+QGV2Z+s\nP/aT1u3VNywKZj1cH//soiXyRffHv21L9HtScdGUuBFtzGFfV1zidNJbAQAh\nLgKrvzK400Pattz6uofag/QAmzX2GsoUOGwjqaMoWLb924SnYFAbKDGqn7ZR\n4vaC9BY66hanhkOHuZWfBRg34Ig2YDgMpElD6PXZTKwV5p+rnWfgB7S/pBmw\npPxQRxKeoNX2fjmqtInWhsuxl5JdrGnnFp3TsR4FL+1VUx3Tax7+4AGdIGWJ\npYIQ\r\n=mZ3r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2+L93NjfnsQIYDXORCEbF5wldgW29PCWGmZfMF8H7dQIhAPtfddXAqOHdlddI0X4PudSFoyd9SgqjTTlQndZ2onJm"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.549543f7_1544082990707_0.4494523618750197"},"_hasShrinkwrap":false},"0.15.0-alpha.74c74309":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.74c74309","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.74c74309","dist":{"shasum":"7f68e2665c6a6023d808e1c2e0fc7f1c35ee55a1","integrity":"sha512-xPkjtQUdIWOQlzrwINwIUdDB4YZiZyEjcFzo2Zy8D5egwPcff56fB9GhNxavivcupFNIClro5duIopa0KRwvuA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.74c74309.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCYntCRA9TVsSAnZWagAA2eYP/3GX2/PdU7xPZ0dt/KWe\n1A0z/T2oYZHVoAvqGyzBdPhGhmBhkAJH6qctMnBA0d08mSlJVhrtoAgYbo05\nT59mEicKIRKxf9BgAnBRwEmJEGVPxDTqEH0AzZKEl8IVm7eTV2/BQsM5gJ1C\nhYcTLjsAHBvZggjCBUm9vpxjow1zSZeFgkcLu+8Z+7U9rt73XNAc/1QxOiwI\nEpzDs/WqZxNioL5uHj8GIqsSRnNwALhEY+98tZSMimnDvtQJZee9tLB/dXSh\n9VqGLJ66pCZl5KBsGLtEtMap7ivyOiedJNY91QUYFesQySlX1Iq2lWpUTzFf\nYJSFtIXzlndpV61y0m4mTjXx/LEDUAVq1cOJtmjb3V0elG6Nd5DdonOgpCua\nRIs0zEVZFkp1MkcweFOYqBIG5LG+vXdY+sz0FO/mhb3DaVTqzpIn+FamNWdN\nSBbEprNimCngkaUld4HJX1hbttJ/Ck9ulhAtsTwNJLiSgOM+w+dyJFB4Aj6J\nTT0jBalB/mx7kGP5t9rKHl6s+w8za8d60Dd+sQ8CPWKkke/6j+zMv2xH0s9Q\nncvgnsg7QEpPE9ozuewi1wjIcgjfzpyPn0QmOmgv4fYHjN9REUmcFX4NV/LK\n4EOQZA7FN78nq96V+BUBGndr5YYSDkXqqH+ip0ImnrJkNaPHAmC7YgFSPNlj\n/AzF\r\n=/6bo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICwvEZCj9lValxA4vy1/2xs1uzx0aNgfolWRhx1WLLMzAiBNU/GelBrgf5eu49F5yiwNlBR7Q5mhNUn2DH+O9phhEQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.74c74309_1544129005046_0.6833185477986512"},"_hasShrinkwrap":false},"0.15.0-alpha.df7f6b80":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.df7f6b80","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.df7f6b80","dist":{"shasum":"ac350e7411ea7f5cc7cc9f6329bc2b4965c173c0","integrity":"sha512-1J+RP8c1SWm+ys/n7rQKbQfZ8Y9mL0z7GaRGWfzc1oyaJHLEyOmgW46vWfWChdYNXFS1pcfU2i5c8rKaYXhh1g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.df7f6b80.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCbjKCRA9TVsSAnZWagAAmX4QAIbjHUKLdroq4eTdBaoW\nhP4ccFgBoZd9fuMvg4ibXxCWGeu39B33ZZlvq7i6+vyVuaWYmhqOGdJ3rbFF\nBEEGOsrEHArgzdgbu2DQcEe2C5csKmU+pb3mDhNRRo/n7+PlMgdeUrgHQZiM\ndmRFcKuRGrODZk3XoSjWfx+spV0C0xu1RIdvXtYfCSC2Ve8UzRb+0GEWsUot\ntl/g5UNDPJ4dfFE8S8sQFceIQD2GHd1syUpFWhb2swVZnErkIP2ya04ZHQB3\nZsuaYHVML39Y8F4qi6We0yAyUUa9rIf4RhVgJy82w9zn6P0bJsSENLu3wToy\nGYnBsOfW9a7FrKiVwVPqcJcwJrEfJtFlYVsa3Nk4MmjTKV2erpqhczqWwBJQ\n2MCUwExYHQiImrFuiredWNzR4AXCRe93KeZEnL9j1hBDqogiFvIb/H001yP7\nbQZ8/oyB0eJ5Jw85WPoTK1P4SgDmFK/5Ipl+5Zda8t/afkd8pdRj71mB3eMP\nXn4sBtduK3BsYIW7bZahYGKaEB3XBl/owsccohEjoWbt+T2pYAQki3cqzzpD\nDDnch5VMOaGfpFR1LjM/+zWSI0RJG19jrc4lKWMhOQ+sMv+/OmO75cc5uJGj\ns9ZLq+0tEZ0zfbiWm4Khbdbo/OysgKdr1HJkJjPqdeT6EseYseyxjIDl+19Y\nswIF\r\n=7VAk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDacnDss2BgDGI1B4EC21Ym8OuYG+esHIJyww+EwkHazgIgSq7Pee4iQYKYTBHsca4TkM3Uhvr/f/UiZYxwnEAf+ps="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.df7f6b80_1544141001506_0.8049413924168511"},"_hasShrinkwrap":false},"0.15.0-alpha.02405b2f":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.02405b2f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.02405b2f","dist":{"shasum":"a8ee69c5a0da2e5a8c6432663524da18b4cd135a","integrity":"sha512-MGV7UYP2jKFV1x9XI4sPL9QPPzLe162+dD7RV3GNEw6ciCbEbyMGEZPdJAPSFLlmQV3FfkDX0W3I71upsEpVXg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.02405b2f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCbkCCRA9TVsSAnZWagAAGrEP/Roey7FHPMae5EK9F2K1\nWLSrRicYzsoSKNX6qV1Mn2Msn3Yp2XVKO3Wa8qoYgvDeor3gsxue3eCHNn6V\nCGU/iA9DuJPbJ+91yN+aLz7p0DUwfaa4c1Xu1abVgrvHxfp4KigbRFKERoxe\nRrnd9yaxFtm60dVj7k9K1ZpNoWr8k+LArUC2IJzaBiM3cgovRpjn50bl19Id\nYH2YecuaAubt2P+RwfwFr4z+rFVXZYuf6dTffqWrm6QNNHeuHea1MQFVUYLE\nowXIzNGedqLAuKVkcf5qA1P5g9rSybiiloUxK6sSBxwsiGKG38Yipwq1Lhmf\nsCqhypB8JTbWJ0aNT2aAUcnslgo1mP18vBKnZOP9KCZOmp8rCUFykNA6sQRh\nB35r+vJ0ZqYV+Plkq3Rpg3yt9wXJQcypyKOxgwtt6xsGZvenksNYis20FLLZ\n0eDpYgs2KjeiZU5smXSuZTzdEaUTXw1jixsF8Gxg+5plK2zQSoRHsAU3nZQc\nmztOoPAvzk8ILxb1yn6RZ4oQrLq5/A9DX4OVz/jykjdXOh1LYZ84FmjemO8l\nDML7VOIs+PwMvlqw4JHCPHKAGKpXrZOfy87r6ZlGDdbwEBeCSKi4CRRfdKrK\nX9SbkfT0MUCG8WF0kUwrXEHY7NJxM34ixcjWWNcWTwp7fB1HkzbpIDcZYLEL\nPDBB\r\n=1raY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBOi6tOz8hYrUxLybvZul2ln0SRq34vNL58I52tLvKq0AiAaObm2ajibM4a7Gy7zmVACdxuAcf++YX351p+1hmFTrw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.02405b2f_1544141057815_0.2967314624923565"},"_hasShrinkwrap":false},"0.15.0-alpha.07f81e62":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.07f81e62","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.07f81e62","dist":{"shasum":"6c60ba62cda3068ec581d9e3b64326a750d88b44","integrity":"sha512-bL57/C54Xu7/emJaSx/FCnJ+nPOwwl4VXfx/YYOJ0NltL+z8wNzfP/3PwX1+rREeb7qm+kdOptq4L9s4D32Igg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.07f81e62.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCb0ACRA9TVsSAnZWagAA4gMP/27Iqev5J7/h2I01Wvu2\n1/dhuGJA7KpYXHTo63LqLqhml1N9ZQ/Tegzg7K1cTvL0nPoZkWOcmQMAo7H5\nK4ZNrOXMsYjbETtGkURnsymQe/byJyNNH3O2eUYq2JzSw8dS4EQonCq1Cad6\nOEL1+9gBQ1H9ArB0CQ4uzNAOeQPS/unNM2biOXp258stcw9tDW750DTItBRZ\n+5T/iFeg3Yyo76UcifIvMVO86728T+apjJVor0dg8vv+huU4Fp29NtAYK3hb\nYC65hJsO73StmzpPAtbwC4ZjxLg8Ax4PCcsUhwf0HMKQzkl8L7UeLBuk61ot\nDUDe2Crj17ND3zvdA14/z871U2xzPe492Cl8COfB61OOMZPQfzRvn8W7i7pK\ngN84I1SvEjd5oBFGBtyR50O8JrQ86Fv17gBnnhKDWOFDlHkSgVZ/SyGCA/qf\nsXzrizaewz0LTSnegZ/ggb8/FinLLqOttoJI+4M2awRmLB2zllWWRYwDLWmr\nHuY3SH+IFMToW/FcytvMK7RyRFJ0faFXXXaeO5ZfNSmKr8zTFm7tnr4/HLTo\nkRigfkJ471wZrJbxZbQywaxEObnay2gIuOcTj0cQpk5QfQfO+V3r4+yavNBM\nKooaPnBMgXwKJBxaV88CGN4RbUG6bV80JiSiV5jwfS8eE3QA1MkIU+Kpdrjb\n6E7a\r\n=pD8W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBWxi9fawZnhwasiX4SZAW9imDcjcCVEECFbqnEflBUuAiB//9xTYl6kDM3txeD1TDNSToefIIu/UaD2cb54ABMgng=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.07f81e62_1544142079876_0.7959737134749185"},"_hasShrinkwrap":false},"0.15.0-alpha.347bf8c0":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.347bf8c0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.347bf8c0","dist":{"shasum":"d71b9cd47aa767ed8db56902156dd19180cc1b40","integrity":"sha512-cw6imzsMRbS5pJazJbTiwy2qNMJIGybvm41UjjcwFIIPvqkjElIuVJEEdv9DSLCCDbFxu5bz5Ycd7IGc1ee0Qw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.347bf8c0.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCdVVCRA9TVsSAnZWagAAZ44QAIswCOGv9+pHzovqhF74\nwZ3lmpJqAfuxL7WfavF1p6zHEFmFBZ/g/7dec/IzfFymwUv33IP/RPsYrgn3\nQoHdq/fA6NeOEQtUSh/rPAFSt9X7Q/Kn3+tRoexrWYvIX1wBIVoCfAZ0VVOK\nKt9aR0z8Ffp4m4I4QaDo2UtzeITujE8kfB8F7JD+o8hws63MLV7dBUJszJTR\nj/ETKENqS8d41ZOcqPmLXJIrmHUOzbbc7mqV8FjtewgSJvhmzrySZn2N3zAo\n/wjmapwUq7yghV8rjOUd9aFQmsxt+wLJWStb3O/LDifm9oPoCm0QzXD2uG7P\nfVXjmJzCMP0cyXOaA6EM9+eStrcFv11d6KEPMKomRKhvoDqjI8MLsgZPx3DZ\nJjwfq0smTnJxpLZ37e2Ca5EVYmcqHWXnkt6EUfldS2zJ1mTN2cdabTgyUVvW\nZ0QG22fw9qw8HaxTP2/0dQCHozJqpQOW76zpqfbnWPZZtQUHZLYhvJQEaIl9\nNH69bBc+2OHz3kQ1qbt3Hin3qpoQva0Nx+1FUdybKUsJ2gcjPHbcSlsr/8i/\nBOkzGkrIEp9yBpJdVYCbBKZFMCymAcVWWB4ihHDTlI1AsDCx6C855+cOKOpr\nFnp9A17DxeKMzFkV3MA2NFrWHEAfTgUg1dg8JkIbHjgQ+nXp1a5qkLQPP1xX\nwMf5\r\n=95WL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAZav3xtMHUxKVmsabiVK+NbdDXT8fJtt8E9d/YhCpekAiEAihBVh6Z8rlT7OJ1Bqg0xi2PVjhDDqJgnXmzCCgNFpYQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.347bf8c0_1544148308308_0.0031783832121097255"},"_hasShrinkwrap":false},"0.15.0-alpha.34708a2d":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.34708a2d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.34708a2d","dist":{"shasum":"b99b469fc3658f802774f0303347c5fe1d2ddbd0","integrity":"sha512-RQPHRusL0rmMotvRlk7U2j1cFrSM2fUcXMKTFbri+dSUtq1pXzWYyw0nYjxOl/vrCjP5VILUE5uk3OF/ohFw7w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.34708a2d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCemECRA9TVsSAnZWagAAj3sP/AuTCpKIAX+vrhhePDXn\ntedXWZNYoIw7SZw3BMv6H4ea0X35l5OG8QKDLNrBnbnBCj/vh0JrXsTgy5MP\nb3AMpWhq2yim0xrIX0/+v9YnBimVl39Xuro8FcKPQlrAoexzOFyzu8bsmUqf\n5hS6XI5vNb9ixoWv5qHB6VGRTdZppYNWwSBx2qtg31dhc5GcJo00fM3eibsc\n4J8eyG+wIPqLCRnu0Dr873MIkWxeehINKvja3m2SW0LZyLVk4t3XX0JDWZoK\nAzIAKLxnbsuerA56MrpKf1Ckt18I5xWes+y0wjT9bZQ2oWU88zYP3sBUoZu6\n4f7mATypVYq4Cq4vXj8qZdHG2ZT0syfvFWtn650FPMQL/DsulmIfr2s/pnV0\nBE3kqN1OCkUSdy1K2AtxIhSykE3oVj2awds2ac488Z1S6Gav1fQVIbqy1Msy\nbAo4fDnkcVmxFyLsB8j++jaz/CEVzYHHolGXJyvRQZRu4TLL/Fh9loGH1mj4\neM2Vr4cR8na4gw0erw8AkwlHK6QIx5uKR2oNr2Seh/hz10korzeHB/NIz0J3\nay6eTkrYkZUUA3VdSRUyDmwM5Yvo00x89TjnDU02eU34fqWKF4y0A6Y0oQ4b\nM3R1+CYvYlzDxK5oL6VRICBlTxirVSzx+SpC2OkH5V18tZsaJEKi0JQ/bwNQ\n9HhV\r\n=kRX+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIETy61RMEFzfB+ji5yLticVhq3X5QmqoXOVVLAPfBSZ0AiEAhAqLo/5ymI11kl/NhAfN0KkHKxJkBktC3VLpCdti4+Q="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.34708a2d_1544153475133_0.7133047642904577"},"_hasShrinkwrap":false},"0.15.0-alpha.dd183237":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.dd183237","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.dd183237","dist":{"shasum":"1b14114ddd4e86cbf020805434313fce2f80d1af","integrity":"sha512-DvH90cdyy7gES/uTRlFlK+39f5bmE/zuIsWL/DT6/504PzSuvCOEdCFHKOHWxF1Va64ZRBWo1SLp1CW/kHoC5g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.dd183237.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCiDxCRA9TVsSAnZWagAAvXgP/0OsjYy4RUwyIJOxiDJB\njMv9zS5tL26pX57+l97EAEQ6PUtNKj36m7CHyRHdY2nW9RU0fuqBFWWEpTig\nZl+74rN2oGdLkxCHAXcs9PL7yIdfKf52UicZN40QMNJsf0rvxx13MOmED2Vf\nIJ9x2GjZBmEVoLqjMTAkcqZE3sdVPi68iiEpuDiVz753kZOQtMPlU/fWmUQ5\nKnpERDyoqePRxMCNaLkwZ3Dyx1MhrnveDdRlHdk1ZpKZn0T6leEnjBIq20WT\nEga0BI4r0lmJuj1CzM4A3J7Bw6+bFaV+ZfWeeGisJ2jRUBXpgO9+tTqFy1OC\njAtiwEikX3QSGYPlvPg0SSrPmTJxvGzAJLwuBvByv+UX+JM91RKl9Yo5o3Qg\ntiJgqdSo5RRXkhOOutttz6EY62z8bnLFQUc6kePhK10zvrt3cJN+kp4kN12S\nG98vq7K4UOH8eHrD2IegZSguM0KZcWqA1u5OGeXm60HZZSPd52cgbNiyDrO0\ncHX0dnyjggeb3a+CaxQwz7o5nf79ZotD90R2Gw5UJHx4hiOZaianrn7G0yM4\nhqirhuw9AARe6JpnHjIQTbHChiF1tZ6hYjwOGZGSz7bz2LEb4esYug5vX3B3\nDf6E+e7KTL6cJkzDEoQ5G5qBMOhspZSiA3jI/jSy/JGpCI2xuEnosbqj5T80\nP/Ph\r\n=23Jb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDEtM60xRgEypY/kLhb6VUuDciV0PebyWklwB9ZZmm0BAiBZBowc/aEeAFFwS0Q8bNhhui4fy+MJbMsx7oC6Doc5HA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.dd183237_1544167664439_0.2644676597635329"},"_hasShrinkwrap":false},"0.15.0-alpha.e278549d":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.e278549d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.e278549d","dist":{"shasum":"80aff1c1885ecf3ced2748caa5ef6f669d60e52c","integrity":"sha512-IHZTCW8uCNJAyg7PZgRnw060ZMOvRgLVQvfQxbDzBONuOMryGNHdNGV8kFCjTN/dschFpvW2o7vkgtjPZ0l7Hg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.e278549d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCiPuCRA9TVsSAnZWagAAyaYP/iGj2izStgL3tlA64tyL\n6DwRz0ifyc03k+ywxhwDbbbOeZjPkUUQ8dBGbx4XHRqEzgCMeEcEGB0bps04\nW0Rylwwlm4eWaQLozkuAKl8+yBDUYQOtTX2/FcvKtY4GlyE+mwvubdybE6Vh\nQEL9mlUuYWOpn7Fmooe6FOgRVI64uySw4Reei9dxMXYlrFvNYDzXf2QBejrP\nSkTlN7KG3qbtqKKu5HTsZ0+zynmUdsP1YaNmJmQwRAYhiw5yok8H2yBT921S\nuDp5b8zkgRNGq0P/DMyuS8pEdk0mNmNLZgvKNOFHYNQPvZ1eLehAzoV5BJvV\nYpXr0qI+Y4oWcPghyXqyDn7Vt8x+3USvob1Y+2RQvCjaOpxp0yh0xgWZ02H2\noVBhpM7vjzkxykZv051Ctp6Ly8cT4aYH1NLVW4PCw2/7gsXI7E9XAcRHjjFv\nL1gagmauL4JFr3MPEjO+YisYMtvRQGQbumacDpDibQBuOirKoFs02r2KIrJo\nb+Ko2Sr+educBQNTz1jRrDGOBRvnlmmkfz5W7070obpGGtNoK4e9hVh+Q39Y\nzX0rIFbEs1kPZM+HIVxzQojmIUYJ6ZZgmXon5pWA51U567+PIANKiJQcsNuf\nECQ8geDJXqP0UFqQMWcnEj2ikERmCRGUlGG3iBucoIL+IjFRC+LU59gkbTrI\nu+zv\r\n=bzyO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOX5dgNgsDe0lOE4kaJXedsgb6sywrZP5ZbZnGx/EPpwIgHGuHZEBMsGY4i56ByXTB5vNlVTiimeLMVQi1y6g0Ipg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.e278549d_1544168429669_0.9483543449966374"},"_hasShrinkwrap":false},"0.15.0-alpha.f4c97603":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.f4c97603","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.f4c97603","dist":{"shasum":"f57846b74d3fd3d1f4bf3d9f4b0ed4d9d47b263c","integrity":"sha512-5RasVJW6rQ2kpzdDbn6dADP9Unad/VNgR7mdlkzAopGZ5GimMeGE1LZUoQZi+eVeFUk0QLE7Zr7cQHiTL9td8g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.f4c97603.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCi26CRA9TVsSAnZWagAAAVIP/0tQ1/NkM2G6ynLEiWFY\njkPMvyni+uEHYqOFeZ4QDkT6ahFs30ZfsLiCUI+vj9JYEeQikGUlzgGoHesR\n74en+/Ky4H2MKwI0Tgzkxwoce5F38mVZfMLqPqVSBy+qcNRIy3trrq3sLYzf\ntF/swdB3mFMZNpDB9v5zwcqQ043phK9UjS9o4789N7sXJA0ODWHjNfmRIKaU\n8VK0buaACRMUObhoYaJRMQVR0ftwH1SZ5lDUHGW2igw1NPG2wOFNgRthhkbf\nZgAIcsGMjfCweDpD5Obw0jyXIVV8pLCkuvTyiXZSDD9DMw5fwYf+/XNB3KkW\nU8vSVVTPuYj4Yu4kda65L7iEe24I+Vr/Pr2FNmlvK5nwX33chu3WrpaWJIaQ\nCKLl3GaLxww02vPwNHGiPjjxLJ5iYiyGmVAfsIB9GVTotkXQPXAZPUCTmAOS\nHYEmCBCwQ3D+LdB4knUKhMF6AWohwN+djb/18E0XzIInQ1b9qRnVyEa1eADx\nkxXGq5vVgAKrbEcs1C4EVZmzQMBZGGzdG97eSk4ZVtfLgxMrCT6+1e/Gh+/t\ngpQo2EmYaNnPgp3f8L+5kqD+GFWdho7Ih7xEPIAWnC0BjpZp1tL6LEHCM81u\nssWEr0EijgOG9m10rTeTaagXeFyNQI3oNdzTCAryHTcUFEJxNUXaQulSIu0C\nfIo6\r\n=nm+8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEgpnCTZ1NadvMJqq3qpbbhAoUOwnkim1rsNsPRhJp8cAiEArLlrmMP6cJl96sKKzXOkZxfU9F7Iy+D8Y/kNWDLY4s8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.f4c97603_1544170937346_0.6836315454663906"},"_hasShrinkwrap":false},"0.15.0-alpha.4454e11d":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.4454e11d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.4454e11d","dist":{"shasum":"3e357d0aa012c3d23847685c638aca86367aa458","integrity":"sha512-kC9Ou1O4mKhx7qH/IJN+ZwS9t0BQXSiKNDSjBkEJ3zLi4Tk98HK1vXhN3PJGRWtmld2i3SzMPYn1EU6ELI/ozg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.4454e11d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCmFJCRA9TVsSAnZWagAAsMsP/i6tIJogCd+kql96YdFs\nR51GNMG7kdgoKsPG5MYAs+69DL4mwDSySWf5Hq8XVGp5oW60vim84u2rW+tm\npr3sw8w3rwEYm1+NBD8vj0kN7UL5+Mc8tazy2HObDtOj0aTvm84hltHRqSa4\n6jcKqIacrPWxYKjLT7Qlb1b3uTfb5j/Hp5T2cX1Trzo0NanKgMdbfOM10T42\n/LMUhgJ72DxwiOc2hjuFWvTdkyDNK+py7KMQ6D8LAKai3Rn/PJjrEo0XRxrK\nvTrV8qfRNnMpTSagRxD4hv6tL49e8kZoUXF06yvSiwxUk/Pjf15M1yaOUwRT\nZo1vR+VX/T0Znsc1hSbi/9PKHeWzFK51EVTDdGk7ggrESdxpSEVgURa6K07Q\nSV9Sbdr6I+HKk14i6hcFfWSlQq7LMz2ZVDjdRgCt2c+XoSnVkIlOqrzWE1aX\njYh/DrR9OcVa4YAUnRw1qHGvuxf5KqhyokBDLo3cIGsuvtLW0hJ2y2CD5+b/\nYGNw+cwIg0QLN7Em+o6VI7KBOQunqb+A0gWwvRSFmOm7R6VZHIO9s3CHmlKf\nfplVvqb/Oy2qZhkEniDG5fpU9zBqGV1mhuo1Ftg0pxPFrPR9yWDfujTzFy6X\nVLzG/eggNRTo9xspyeK8Mp4UFZqnYUiwfyWiPfVAa3ZtXSLWXuEn4Y1GiJgi\ndw/X\r\n=fIp7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGi9WBEM88bOAinBW/Xq86+hMziaQdy7TlUeHpDXlR8wIgWA91V50I2/pPNB/iHSDd0DMN5Wr27dNBE2Lt67XpYzE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.4454e11d_1544184137066_0.28804986092859974"},"_hasShrinkwrap":false},"0.15.0-alpha.ba2f31c9":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.ba2f31c9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.ba2f31c9","dist":{"shasum":"fad9a929a4e7890f7a8361e2c390af66907a9ac9","integrity":"sha512-T95axyobvZIDXvhEaVLztH+qXpEDiBgzm49Kva6ZS5f+y3NArl67YI4139zFNXxVdHlVKBvblVhi0vAdzEy1aA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.ba2f31c9.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCp1qCRA9TVsSAnZWagAAnJYP/3qq/l4a+/C5fvF7Euea\noqgniTcorClcO8qp+jwbY+WNTpdIb4RZECC7htKGMB8eaf9FeJP9Llcau1NC\nzobFgOHYk89sN1dqyin/pd5DT9SnPkZwMDMS3NgqSirnSbUS1r7FExZCdDVI\nvyYWIX6iPkHMLM6ZoCiYW1msqFptw4InSBf+PYmk9FDs65E8rXqPQw6GuaNz\np0s1PmCoP9ik6lz/PJZBHdoorRuFNy55IZ6szFhdkHzd25I2WQnA0e4SDR7z\n1Fmke52zD+LtY0SHBN7kMWAitcL4eboetAlIIaPK8L0Wc4KFCRYRHJz+akJ4\nOC/G5rXYH5Ibr77hA3PCDAPn+koM5ZCQ5uqO5w7aBtAnxynNQy0LidOV6jCB\nYOKwq+6w3BgQNVlE2x+mYRSWUrPelDGL8uI466+HCGAorjDWHvnE3Dn31WfK\nan51savo8fWzHCAUKuBr2X/UIy7ULzHGp5yJ0hrRmhK1wDpaWiKzNVtC9Rtf\nPzCwz2SaKZAUbrdCCeyHMsDQwpLz+fh3lRkMg2intOffNjkOC22q3HopQEvC\n5an0gdVXZh5Mm/2OI4kIOqZRmf8o1lf16jTV3iaINafmvWBA74uHIKHOjshP\ndga65aDiQGEGlz3DAT84Fc4xrpYlpdDsdT+cN8AMTnxSe5RcqZUV04z//CMe\n9+VM\r\n=ONmI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH8fzi44LTrWubKUyFigAvTzTUkcur24HKFjno/CNcW6AiEA5Wajcun/dPxuPNi1VBSJuzJcW4uVbVAGl0txVYgktfo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.ba2f31c9_1544199529450_0.44754601943503025"},"_hasShrinkwrap":false},"0.15.0-alpha.5870a18c":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.5870a18c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.5870a18c","dist":{"shasum":"1a488b549fdf39ea2ddf251900a749bdfb079d31","integrity":"sha512-yk/Cad+LQevZUpcKVlQIwhn7tBeVRw9dItc2BWIjaUpQ1N3TY+uX5jkuabIgscGYw+KdsJNwjv8y0htujiJtZw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.5870a18c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCqDQCRA9TVsSAnZWagAARxYP/2cBllLgtWSqHwAl10Wz\nPsHYPxbl9Dfv6uZG184/mMU34m7S47KLX/hXNMqxCGUeGbb/CMOPPbhV4C6o\nTzR2IoUMqriqz/sqxNN2zuKCSF3OeBue5IeZGg6CStWx8CNU1CzVjQA3Vkc9\nRamD66klrQnxScHOcmpcgyirbjHsZFyZ389xYbnWpRttOmMf41lZmURqm0Kc\nQBobaPKMqyQJl9QTmAdNX5EnVjg4/kQQ6te3MvXY+gy0YyXJMhsFYuqgNKzk\n8lATc1c4oYmUOS3V1XDignMN0OQ164+DAAqGaHqtknbx7iKXZNvrvJKpGI4+\n9otDKdpzc77gPUBXCVKREn2LDby5Qxt6gb4jIY+cK4rMGTRWKAnVISJOP+La\n8Igzf64UpE3wm72QZB/pXo2JureawMse8Y9tWyX6+6NtPu+PTR6W4M60et+r\nOq+ZgD58OzZKgFVu/t/ccnxMctSGO/uVVRfMlAQmFhxjoDl6XH4ByEchG9kD\nSdBF+POy8Zy2TgMQShegC2z990VpSBnEH2A6XPP3PkuCH72Ij5g1KQU3V7DS\nr6NeNVxzkxdXmGJRMTBg/+4nWSF/d3OWtJagtqie7U5IE+VU9k7kapPMmRPQ\n/CAEyc+dTGPxJ8JE/BbVh7WokqUn+A373oNHKybX44bgBH+p7hiNVOyHkOCs\nUUHm\r\n=lPaS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDg9ZEfV7oOi9Z3KmMJPVHQxPDDjoyWYhtOcQmj+ZBohAiEA093WYs14WG1H3r84l+WfOenxJYidqZ2bZ01bR5C1Fd0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.5870a18c_1544200399834_0.1686244474676888"},"_hasShrinkwrap":false},"0.15.0-alpha.d7865d22":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.d7865d22","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.d7865d22","dist":{"shasum":"a93f66300fe5dc678be6a934e6c2bfa06da330c1","integrity":"sha512-kQZJ4rOPtEOeVQb1291sUnummfoBZsSqdFimCM0dr96hHT8gYQ8DK3QYmjW3X7MsBgCgIb92LhnHhOyox32tdg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.d7865d22.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCrr5CRA9TVsSAnZWagAAA40P/12hbISk8DgEffpYdQo3\nPqlXaTLO8z/BrIcCVOZPPPvS4IRQet0gwFmBcmZt4azWLBlaznyjcDlU2BeM\ncr6Up6DFPbkNMW3EoZ1OvVS8+ZsvLDTEdit9hVc3R+SAnV7QU3WF3yGzhWbp\nyPpwW2dsu8Tdd1O8TAX1hToo+y5kYSy70AY/T5RQ8H6dLToY1L6eahz6Z2yq\nhvIUu2/gH88GY95Ue4P9YSEI2KzHtEjAddPAecmENf04vdaZuwB1WYQGCJ2P\n5ICeOYZjuLdj2YZIxEs9wE6uClVQl3qVTS4rWQhQigAtrvGgXLYC520+K4al\nyP9X2id5t5jld+DpzKXlRZkv6vpe5gp0EFDlvfTl2dhx3tU/CQrrONhuvaog\nZyZPTkXDpAvEpjsZqpmzQTSmA2jtDaZO9V7qjW+GldOBzzLYffos9zJnbJ/z\nH9wa+KHjst71fotRil5xj2eV4dss6NR/EzZr+dL+3h5b77zThtJCd5k/4awe\np4aClNRkEcxn95QcD22bA/E6yrtBkaYGOsKizTIGyRTMJO7s65Eu9Kv1N44h\niXuQSipYKBEUJf0cnX7X46rFxQeWXfE3XppESCT/VtjL2UsYc1DyxJM4q3Ab\nwcnP8h39uCDZG7W8lGy6Lak8cFdOIo+r0BYa+rMWapOc55+VbHc8HMysSeh5\nMAta\r\n=azsi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBXBo0X1bOFjqHAdJN1Z7RcQAJauoRaEnXfHmohBg/OJAiEApG4Pb2AbA3XCuNW4kzAYrd7plg8zRR9cuuLNB8LMfy8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.d7865d22_1544207096807_0.15079149095465705"},"_hasShrinkwrap":false},"0.15.0-alpha.058ad67f":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.058ad67f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.058ad67f","dist":{"shasum":"fd1dc173b10e04ffc4ba382f979af03e535159b4","integrity":"sha512-rZIgomCwEv04pbWL/xd37IgUjIJajZp0g5xgJaBbSEWiSsBBbItif0IsJL72L879dji0PqKnuTHa2O891DHTMA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.058ad67f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCsKhCRA9TVsSAnZWagAAQ4UQAJFuM4r+D8HcOfEQDl5F\nOBDCVLdiJDYyHpFAVxh1qaWhcjErGM/EGMweae1QUvzVoeorN4GY6TPnPjxb\nHkU/Ns+P7Vcbfto9BStYMisE1fTdfDa6IkACL6TFHsV4sNazlyhzSY0GM9QQ\nvN/kW1DHaQXdasTLnJ4KE0Xj1QZaUM80cPLyh2ZvkdyJ3E4zcUD/3C+/v+26\n4i5ZP/sh1WuIwZvFh8McVHZmApYY5vgyRx69GMG6J8/ePM8OwGOLjsmb/odo\nQxbJvBKTHuuvqmGGiPDpNJ5bK8k/9w0vfCXnw5Wj41arojMAY0+yXrUrcNML\n4FKKar/BXINd5DKDTb5o12YlAEkqj7RnBwQUWiP8TfSSiGGJO9s0ZneUtout\nZfzi7ECA29cLUJJGNVyvN8QgK9mS3zNbmfA00eJTphJmFd4cnxz9wtTk8Hm5\niOaAC2e/1fNMHIbQtx2NEZwgNqLvZdzHZhgDpPjPOuPaRgZcUwx5W6VJPf08\nbsTqfiAeK+wb+Xrb2bXSZGE2jzrptlV0G50KaziRgH7tlRxvYidjUhUbD9c+\nPEwPdV/2wmU7ykVSmtzL3yEslx1IrgHUwZ1o2sasXx5ilgxDkT4mSldvIMpr\nq/pPTYgJB64H0AUyDJlXbgUZ/+6S59Apn+NyPMKIIz4342/Ks3kFH/+GTa3E\n/f77\r\n=inz2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDlQ4tmGY3PHQz/kuoyvrfgqmzbY5eUJRazCa8pAcxqiAiAvfJllf7c5yyfOhM/gddJ7OuuzNQ4f7go8UuYDTNZt4Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.058ad67f_1544209056812_0.8177296686777176"},"_hasShrinkwrap":false},"0.15.0-alpha.db3889ec":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.db3889ec","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.db3889ec","dist":{"shasum":"9d1cafbb37ee01e526377af27a1173ca5723d972","integrity":"sha512-K2LwlTjIf+CcVOWJ0OEVHCQ0yZPsAaRQtuCUXbWBEMfF9WUx0+v5x00T3hR3dGKXW//pQ1Pi1LddhgLwp8g1jw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.db3889ec.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCtSDCRA9TVsSAnZWagAAdbYP/R9HWraRHMxQyDFmJcTB\nlJxqUvaU5fr+SMircSZoqj4AU0iUrY7cNfg6+oUFbXp0Pv4p9PZ4EDg16JhX\nH/EH98S0JClWDa9SPzzoatl+exBLlFSz55bGmxof2su+++vfFacBfIs6sB/s\nigvh93WjGt6kVNvVqgz5ZqZIE9mDMUWrsKMyj4vK2RshF4qR9hf3pDD9GVPn\nQrrAIDRjHb/MUyvUQVIrCu6NQLjV6+Jd6Vcs7up8fisYkVNldjSimfuTW779\n+xFkWKjY1xQ2rVAwhBFLKiijPsEBeyOktgEJ0n2vcA6CssNJA0yCCuqr+Miz\ngvIe16iXQPBjbkkRbqtewik4pFeZn8rK/QRgay721MXuaZn2Sj+kkeqowxr+\n6a/IRlRwJ9514Ezc+edx1uekKmwEDAThznznyqBb+ksQN4ewmSbIgwH7o+Qd\nE+jvgmY2PHeFRLJGBF0zFgVCpFSojoy5fyqcJIWTwqYDZCR1JcMUie8Bdl09\nXDV+uWogZtcEw/TiZ3lpo0wKi5dPwjhaRS4cLc9o/iMUWofukoqUtfnIznpG\nVDUGIayH8Eess9xy49ZuJJ6pQ+BeQfb0cY1tpoIkSFTHYtkEv3IRG1QzGg0T\n0c/JpS9tGAUJVfwLwdn1ErogajJiWi2SSJjN1Plrwnp1PwPNWTdotznFfhjK\neBof\r\n=xaup\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGzwS7bBOYPLsqpczYeXKZ0cyCQ2xZ1k+fEWFGiG3qBdAiEAvsRMWm18CYdC6UWyPIS5a29sZssUepyw1wwFM7NGWOY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.db3889ec_1544213634743_0.6453683107303316"},"_hasShrinkwrap":false},"0.15.0-alpha.c36f3060":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.c36f3060","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.c36f3060","dist":{"shasum":"ee247aa10c03619ed0572de6de2d5e46be2d550c","integrity":"sha512-KK7w8g+uIntqQVVSfhGQuovW034ATRow5bD57JhWfUBIHyZ2CKVmCzcUsN3HjPbPaYSyWnYB8Fi04SEDnEaBGA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.c36f3060.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcC33+CRA9TVsSAnZWagAAVCwP/iXD2VYeyRm32w4wpSUT\nVH9uJRoQpjDmrrQwAqwYfhu7Iak8tvairLX52/rEh+N1YwklhbIj5cKvSqI2\n8CLVyziwE+VQJCsq09TDRQ6BX0nPaRF0qibdANAKDWXqk0UmgLlpbvODE6G2\nr/1piXlPcXu91aIqtROiLLh/RLmlEOGHVi6BVbj5UdGkoberf+ZFo0O0d8mL\n2o/Lu348tAezi+4xwMqFyOOBA9juyAK+vHf6V5juUvyuUucWl45Sh4oSlmxr\n0NGgyDWgRr+TppVz7bTOOCwuldIkDsyCiLKKLG7OGiCnCGmL0l0jE3ClTd6E\nU4WsR+UvJqsdZU/3QHA8luH15L7rvtn/44hXCkWxtqDWoqfLdy4tr1LKuM3P\nwRCrfbulaN30zZZCv+JdY/iZPgyGa0WZSwLwdoY/PG8Gwnqw1pMksrOWbrGj\nexHKz9Ywh7WcEk2166XtR1zZC4buzY/f3BDlWQhdOOmNKCzNDDa2nfDCu363\nfiLTSAOFl3qWl7/lOOHETEdlBSqPqY7hqx057G+3Zn2UmDhTLoG4KVhUMIKc\ncj7fwes2NcfAtiqZ3ExYzPgc7pGmBgld9V77GpNklMPBD4+BQnx67yJR4R5O\nnbmM+R/qkBJdd1SQb3kSW1Ackwp2KWgBIT1FJUG0vw8EbNW10kFcYir95bZF\np1xM\r\n=8Wei\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3emc0pQKbqUZ/HMsMzuTj+zXqgAHBgk5hWzbXWZj4zwIgajJnAKu2FUmDunVDb+6W6vry2pdw2upGi3bGWGTs9NA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.c36f3060_1544257021835_0.6799060619472077"},"_hasShrinkwrap":false},"0.15.0-alpha.414627ba":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.414627ba","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.414627ba","dist":{"shasum":"cf279221b906c659f42e07882c4dd02ea648466d","integrity":"sha512-A0C8s/c6RCP5RnEedLo2sLAi+VMLp+3XeHjm06sHcEXhlvWrCW+c4s+WHVX+1tXR+KKXG2rrFSEqQgRE5DdWYw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.414627ba.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcC34LCRA9TVsSAnZWagAA/14P/3lKbI3PO4xqXxkkEYUs\nhGqDIS3oTVSRmJE+WghSBalhZgAylU7lvwIQGQiosaTjTb0LiC2qd499/tRA\nraqWeuwaQ6ExgYxAmPRiR1k+PJjW7Z6y1ppRKAa2YHPuUB8qXlJtKg456Nn0\nbw9CoWOUGSDUoWHfc2Uhx11Pe335KnMO+wM/7TYHmKSUC1zz/yntJwc5y3wz\nG4RrFB+jbl55lytu6G4fq9PU56mCYuuCCHnkof32Lysn0OBrVvnxF3UoQcSS\nQQ3u2BWALbGVuG/8nW0sQaG9HyrefKHnNGSCojdTJSU0rgzWsmzWnmuAP2Qe\n2DPRQ7B4so6BRJ/bBFToBxo35pzcO9hTHSftXXe+bBMa7IAyaG0MV8jPD1gr\niCfAXBMzN3WNfspkX0Luu9WJrIcSmNfjCN00IEAkbUPSOhPPtSaiIlUvDPLe\n1uKF/zD19U8mEBvJ/4h8YzOrOjNFZHNZm5DDawe1jihmSyIeqBZIV/GOYGmo\nJmWpHBrs1UwP3HJc+XVuNn8hA4qrvoF/ZHp1PyywMLuxnJQbheW9A1JHJf54\nXd7J2mR5nsM7lnJrx1TgTCYuSliYzePqZJ8o3EtDGHiXLkanekxCeJh7lCnD\n/mEBWKofp4MI+YWOJMSZF6VQKs71F5it+LThaysExNX3W2/jsNaVwD/b5Ga0\nbKbS\r\n=2eVR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBhYKx1II8gISoI351OQxScNYEriLtz7tVLPDMbCksfDAiEAwKx+0Xhm7AMg3YdQepeliUM6KZ3l8odapB9WgPVT0nE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.414627ba_1544257034470_0.029604637735959116"},"_hasShrinkwrap":false},"0.15.0-alpha.36a4b837":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.36a4b837","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.36a4b837","dist":{"shasum":"bd743cd4c0c7fc31124c5bc1aaddfca4ab77ea64","integrity":"sha512-r/ObQzW808KYrBFrIGsOL4SYtFs/uOTmI2PVXdp8fBMMrwtHdr+CMh9O8ClhZQ8CjUdtu4v/Xa3+Ve5K03VLFA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.36a4b837.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcC34UCRA9TVsSAnZWagAAtqYP/jGI3/q5zwbXWtxk6ljp\nfOjhLzJfuUaogVjiUze6WaEvBRa+TNNR7E/227EIwj7TuwrFujAGrc7ihnJ4\nsTd73O+VdwLaXxUtlRSoRTqmP8jQhVMtSpT3POI7Jcb7lyWSnhhrmNG635DY\n7qh+3IyHxoXb+6pGNZjXKTNW8HPQGft4arG05BUs6WqLFIRObAeX4PiTP7G3\nCD7eb7wum2Q8bEcChJv8+ESg+dpcd0qzWVD29mY/UMvZtlOI2eeSZ5QlPKhu\npyAMZFsiZsvEn+hPIx3iaPdsUIJr5CQzJqaKC6ApVqylXB9dtVdaGfCA8SB2\nttxMhC1dhk2IiuDShjxf3uL2FAPt+W8SMIVIx1uboWbzWXJphgeB9+6iqYG2\npFlEWRpRrShqzZIjlU07MQBNY73fcCrC/jxe4wXbhqE2g7Mm9M1vAzJmlk7z\n6uS/PL1AyOxQvzQdfHICsjPeLfdlG0fmjX+hRPurjbVPYuRSwlydo4wIfa+P\n6RAX4PcVqXMPaNNi4+o7BBrOgZo8cgpIe4eOhybTAfHNXw71jU2+hf/RHfWH\nlj4KtlvsFN2TSViYDVQ469SBjSpkgO3K7T1oXUYUKyL3exAEMLhfdJytFavN\nECYczHmBCGA9utIhVAnYspp387dY7ogK5HWsjtlREx3B8AnOKzRvaBbCy3rh\nd/iD\r\n=f9As\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVWkrZrCBmXTv1RsD42yfcsaPjynUN8vY2gV1h31rzowIgAiJuT5QHipOAbB+6ucqMEpUVzV2lPLvn+pGeJewZsiY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.36a4b837_1544257043488_0.3834081453657716"},"_hasShrinkwrap":false},"0.15.0-alpha.e954e1a8":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.e954e1a8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.e954e1a8","dist":{"shasum":"6024df7cfbe0735724ea6a2daf3f7e191b1a3dca","integrity":"sha512-LaMa18vVSTbE1pw2iW7W1JjkHDf9ME4HvfIxkxK6QWpyscgxWk7T+0Xs5lbgHA1+E7N6sX/CWhJrb2Ruc6C8CA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.e954e1a8.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcC5z3CRA9TVsSAnZWagAAilgQAKJUzX6HYybWMzSw5aUp\n5WTBq6ChslP46Sx996Ka+0NT0OVnNwmxA6Q7hoUlrya7hdbYx5EcWl3zv1Rz\ntwb7fpHCpkDfAhcZdi6/Y/+OAIEJVt2FN222KJMTmY0mi7KhxPxNfUFqkFwA\nZb317epR64WQY4/ILsusfR2Nu/+FSgEz8ZHgeDpN3xx49ApHdH+pUfTnaraO\nde7GwWHFyFMYCbfgC1tlZSBPfZyA0eC24KeQ6OoX6fYyi6cXbkAFtKB2GUQJ\ns6ArWfCHysYXUrPADnZPrmXQnkDDVidRfQYwOiYNyPgiZCbMxFQnnoOwVBgJ\n3/IKgQF3bsT9M/YZ9hprIFqpYPqGV/vpkCtsCc5YpE/pLPK6fUCe8eO74CGT\nrSKFGe9X4RrL6cDnsTGoBBFKkpcVVXnf9WeGiONqxvs+OEPds9Q3IuBEuPPI\nmFVkgitx/dnORem3BxVM73K2PTWOHjAVR2MXHxfNjJiJ8aCbTk600xKjcpfx\nuHGVc4tWHGmALZZnBZ/N9KsMv7C2Y9IF8BQgYs6xiSNZuucaB1LsOOeCWCFl\naHU7+BsnMHb1D/AdCDO2Qrv6vN5k+52kYY8EPAiCxChI28hJsk6s++PgZlgr\nJZ8msipT6ZWSBZN63TW6Hrlz7MGkAPIMGbLT5cl6kl3U2XF3sVDVGqPjTUyR\ntWz7\r\n=JxRB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIArMXjrCA4KJR01YyZxQ5YS8Aa6x+V6kX5z8rnbFXrMHAiBBOi4abE4eBq/63MvLNm+q2bGOkuMYR2/nFiCgWBsUfw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.e954e1a8_1544264950254_0.7002202621516236"},"_hasShrinkwrap":false},"0.15.0-alpha.e01288e5":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.e01288e5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.e01288e5","dist":{"shasum":"20bf24529321807ec916de6675e1855744a9edec","integrity":"sha512-s9+Zr+Kz3yiZusTitvwF1EAy0eX+XNj1fgxy+BEdUSdWk2nrMLQTaXo51CzuWFWzmB+4CVkZ0G6lZDpYZYFjRg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.e01288e5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcC589CRA9TVsSAnZWagAAoQMP+QAG1CSiQlOBuNSvw1Gj\n6NvJMuHhXeoyD9TEjhOH1nx1qK1z+kMn2ru/csJJjOfww7IitJqRpFkFTe4E\nl7ud2vKepsfDvzHQcUVQPHzFXy/8GctDT1gQEIU6Pyc3X23YScWOHfLonEG1\nCaa84y4ux1sAl3MTlW99vi7mOnYVlEygwpDZ3me2HOUFiIUiMMmi05cZcQwk\nItw2AOIsu5XDJuzcqgNnBFnxlVV4hZ3WsDHn0sxP7m0Jxs3oKJWkFHQaTB7E\njm8VvmC/0s5KqZXDmwGF2/+jiLuc7MxxYdgn4F0izhzidXvWMBPLLxTQze7u\nQMRbnY63RcKxFIYmBu/pwzGdxVl/Sfynpu+l0t2nmqjbptZlXvaNpBp1saip\nUMeHMPbRcAB+TnKgRL4GOCDxApeMM6edZvpaueSkfuA6cfZZPtaur++JfbUy\n2q6ML0dl7lMUqwnDto0+AqO+/MKmSjIWvaDWRc6IaK5M9/U+WKpdy5/+mvN3\nfLIBopkVzJxRqpKxGIunKa6prSpWM9X3/CqZwoewAp5Vrd332Hh2fCT/FxcW\nMB1CV2tmZ6qOiRHbFDJf3JvbFTgoMysx6EI2O6kM+LJkFBKI9158TDNh3bw3\nVxDZo2CWyJHQ8KWG/a1GK/xi0ne5y306T3BEaWCQ9O34tfO18h8dL7aBB2t7\nijhD\r\n=nYMb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBwhLd+WArsG+zHWRkMMW34ap9KVGCQT2JteG28xcQLQIhALZrly9lH/zML7gB/5aadDzcA+K2TqlZOYYD4yTiKMw9"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.e01288e5_1544265532680_0.5786012244312171"},"_hasShrinkwrap":false},"0.15.0-alpha.6cc7a3bb":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.6cc7a3bb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.6cc7a3bb","dist":{"shasum":"48aa62452a77643b643d14ab0a62c5cb4ef971b2","integrity":"sha512-prWB0r5UKytoJNnXMC6pihu6O+9VYNpu6PM+cRK9QTWADOusnuTGP4llYq3TDfDX/GZ4QLgmN7xV6/d8ElKHCg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.6cc7a3bb.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcC6QfCRA9TVsSAnZWagAA/FIQAIc3Kt7E/+qxOsCphyUY\nr69zP6P9g2FQrZQE8SBUIYHfmYke4/vTpctdFDidgscrm6DrW6h5Oaah/kTl\ne4Q/pXCi7MZGvoopCTwJc9oaJHt1F9RNOhCNRRSs3dGZ2KkDepXxCEeYlzXj\nKgR0CIldiQOYZ/SXzhvjuA3LTLD8vADQOrAXWSv1DkRpBMaxg4ncQIyOaK6M\n7kJ92o6yn5442k2Ycz1ygq3F2fjD0FgaV1kh4vqcpX+XabktxAaJMBThKCoi\nEV/ExwNi5An9U43KR3mJL42DW7I9WfAmz+eX5jgEXkx/DhaJqlQZeEcgnat2\n/MHi0VmFdzQG93lEMQn3WD3tj81grGWhJwDZKYGp7Pdd8dFEySR1Q3K1v8IT\n0+Qf+kWfP0bzJNKaWt5cH7zmy9EamLxDxm+XP4My5IxExAPjmDzrC7wrluQq\njQpiE6+NVPeWiLDASD7du8cdG7w0luGFhx2STf17SYc/wqJxGw1THhKAtKi0\n5yJjT0sra2ahw9fouPn8KR7nDMkUsrpkUnQjEl9ReDzob7Wb4A3JmSdnmfEC\nuyHuoCXOVt5JPC8K7W8tHeGPOUTRmG2TPl4s7XYzFIyabfW450fmMpxoecQF\niNu9/Hizdbd06PYl1j2TppEgPI15igkpGZNS8GKKGTGOtI/Kqf+GhdhRriPG\npy1V\r\n=vami\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHntRk9SJYmuniJX+YNA3SjhS1p2Tj61k57XxpODu6lQIgbx1fQ02v5KPIVGdYIx6vJ+aSXm6qsxIGnuL2ttHd8Bg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.6cc7a3bb_1544266782518_0.23425540115174037"},"_hasShrinkwrap":false},"0.15.0-alpha.fb0d10f8":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.fb0d10f8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.fb0d10f8","dist":{"shasum":"c29327578ed6fb43502b7add0044fac3f5685e5e","integrity":"sha512-axVb1rSKQBkoD5cXfU0iiKoeGALQCnEfxPovNL8VhMwaMblqZrTf1828f3XKUpE1PWdlqlR9Q2qbSyl+y2gPJA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.fb0d10f8.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDOOLCRA9TVsSAnZWagAASg4P/jaqYh/Im7+6ZFupbsus\nZuwQfeZWsgouB8lUaQ/uyh1JAToK4nQMBQolt0RoSGnzGYxCiBHafizW9CEu\nKlpywZBL4Ysj8i5Dd0CCkxFFhtT/aFkvkl32Idl7mvC+ZT+23EMtJkf3QcA/\nKyCC/30NZ0ZpeZGAJirbboGZ0S0tqLdFixVD9R9KlDTZfwsNPzwPVw2IAEfi\nh+NQ6s1skNNE7ynlzZXDRSkukr8vG3z5M/VyjMST4+Tsjfrwp/+FO1FrB2Yy\nW5rAoSsER3G7DQEhre7m8RzRoON495DB9X68CJtriMJoPjND7VZUuTIZAVEy\n97rg2sckUT4+hoQCphD2Zd/d9IUxBL8/dJREooFLcTpUJGCH1PvvjBoHDwDc\nrQNBOckOBiCbVIwrYt35Wdd0CdxfIOSqlsfVCWTMID2Vfik/svgApK1E4Xcu\nDdivv0PHEZlE5wAlwNXgsqUkj10uApTeMyMY+fBNcaGRM7GNCmoKhIdjEwFO\n5YIU98p/7Sd9roL1S8HAC0W9RS1FbxAmxpPbEn1ky8L3K7IoF2GucPPFt7I/\ndqK091CJq53+56T4Txe4a6d5ik0+ZIaeFCASWEj0ai07ow2G7VT6SNu4bQKf\nymiYoALkbRAoeeNedIzcBv3cqZIyMQKFa6CxD/QkHunX/BLMTQZBfJH/WTyI\n1h2Z\r\n=vBZf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8xAKT3iidx4NkYY1r58u649TZlCNKMFQgmS/OrKnBZQIhAJqDxPoCuOIFVslevPk2ZWWGANkvLDzrfI8wh2ueUBP0"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.fb0d10f8_1544348554627_0.0604396099744422"},"_hasShrinkwrap":false},"0.15.0-alpha.f8c74d61":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.f8c74d61","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.f8c74d61","dist":{"shasum":"6ec840e96f7dc642a38b62fdedabeaf9fa2696bc","integrity":"sha512-IgEjI9X4syGkjJ6VDJOZCSX4c03wLgI2JHQtoJyszwKf+RlyyAcDy6wnfJpzlQaHs5M7Grsgg9nyVnazN+UAJw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.f8c74d61.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDPpzCRA9TVsSAnZWagAAb9MP/2Y97b1sQOt+TgZELk3a\n/pQLQ1kiBLGxqcUXeHhN+tUvT+IDoY9YZTirhuNYV6QLtAZZcsElydmpkb+U\nvouAnZyU+K3+6TtyU22FCR2mA+eWBLoWvDTY8P1121IfJQ2JEwmbrGQj2r+v\ndwGrjaB+BXyNfyYxZLh9BrnkeIUYoi77N9UIm2S/QEC/Hquv/y2BjHAQrroL\nZzeeorxnJtZqz9x6bAOEwDwl0vPO5PytYN1OFc4ZobkKnFmhJ+wozbn7lUxh\nJbvbtdUTvjQq8X/RBNTomkUw3eHpecbXQ/GDOUDgKQGWi7JENEfTZIN9kwmY\nzyuqsASPGNzdwUFs/wbfAq5LDPylPJLGlzc920w9fCbHIdbaNkB7qe0ICvrl\nPDr/bKD1EgMQBrgaVhNEGdyvWimgrCcT7QXFYVSnYEGejqtFzhYOLmNLXoBf\na4JSh+bxX+ZtTFmKAuP9TwWUst6nYI+5qFk4Ra6oBrzTC6ZfYqSzVjfwYbyq\nNRwwhwTAD+SrdLRjX3RETcNzwDvpaDlWiAn7MUvjX/jIuFF/mgqVTZUX63qM\n8nLIlCLJtAVKo9jdFwTeo+5ji5i71t+Le5aG430jElfuLb1kmAuG1lhlT4Me\ngEFAJIJjb44Se7blkqIH0ajlTnctsS21EUXXL6w0q3t3Sc/6MIRcLPxAlIQs\nxjS3\r\n=KVQj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKoc5as3wi+6IpR//ycCKOeiXxj3QxzrwnwdQMeC2m5wIhAPoktytqxkS/yGgnW3LQQ9MVT5DXMO3ydcib879Mffh9"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.f8c74d61_1544354418996_0.23954170941463482"},"_hasShrinkwrap":false},"0.15.0-alpha.7285693e":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.7285693e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.7285693e","dist":{"shasum":"2c56191ba01a670afe9b1d85b1b40f60a4fcbade","integrity":"sha512-K+mnkAm1xUgD2CEf6J+TLvd9SuANriGQGGu9xCT9ZxVVxMdzc4w8R4+2nzFf1BxBJQJVOQUo9L/MWdLsuRms8Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.7285693e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDR9KCRA9TVsSAnZWagAAHZYQAJsHvvP1QFNNHa9BtVLR\nd3Fzc6RXGwI1q9Kf5Kf1j94689NXb3oCD0ePzTm8y7tZYS08XEMwYhrxu2c+\n1TAIGAxogktLpDNB0nt82SviLnGJvwchFtXnXO05P7xtlTnlRkmGyDN7N381\n669Ba88gjBLOZfSjiz+AhVke3BrS3TdIvCwZWBmwK0DIg6SpY1tCWdIlYaSp\nQ0aAfw7R+TUwcgCjyebzhbB/+ETt7OIdvIbLzmYXcmkqSYdY4Kj0ZDLXL1+c\n+ct6m1aS3MDCamgZkow8U+SCFj9tCKXrSRnRTR2bYBwy9KyF0OjH8/Dm8a0U\nOvR9laudAP/H5er8STKP559IAaAagn2RubPGRSOjBvSiF40hNx3kVVRWFpCe\n2ZMssQOUIWT0pe8qaaR1/21ZX9wHThZUwJj0e2l9GAhQwYYMlb+ydllfyDs8\nZlDlB9/FZF6mJ9YcvG+7QUsl3XRg/bFt34NMbPxSoIIaeEiVxmkxu9El+rp0\nKfY3FKjfsk7fIjcBvWVsd9gt9uL/0ragWSwVwwrqm4/gabANbzT+2+fO4rmS\nfcuOqKjY1nzCRCQdUJTAMweXf/zVHedIeIDftkEAcjVZmMQvz/czU2N/ubf3\nBO0bn6vwvabm9skulnMNR9ax+cR3lp92PoJaTNArwhvSeS+VqetFNQ6jLovr\nzSFR\r\n=3HK2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICB2YgcKgWpwtQ/Q3njlgK0WUJfanROr/cUWb3fSBbhNAiBGfVqLKTp1C9AxXm3vAxenN8vHqAhEZh1zr4NOSogn5w=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.7285693e_1544363849746_0.7279576375609222"},"_hasShrinkwrap":false},"0.15.0-alpha.980062ff":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.980062ff","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.980062ff","dist":{"shasum":"518d4ff987d538eec18916aeb85a97f6be65a6b6","integrity":"sha512-kIM2N1c5d4ttKtVmDoll+ourwMbp3MsDrp5OGwCRTfkoPhChPjGI8l1HQ0otmy9PqlaxcTpE6lKqH+JM89Ud3Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.980062ff.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDSFeCRA9TVsSAnZWagAAxIIP/05XEBAjnUFL53jITVmX\ntJgynHyUSgZHydMND6pmeJyLPAepqs2gT46JfK1KxVFqHEoDWj7xr8UKvg0q\nAmUX8vb6+buzBM+YwzvDVA2TDXVwTc/yvzjhSqFy+V/ZMISE6R3ye0PbJN+w\nLZJd4E2iEYfbFyk4IA+cBf0Mg785Ii45JR1v7og9ZDaHo7u2i0kgIplg9dZ1\nUB3zZo3CfSHLgf+XVIcSesqPxr4WALfwDZUBCZbpIpexpZbxYs/h25hL+Wzn\nHCTVHF7M41TBfp+mwoZQJPRzXQSV5cCqtCVrQjXOtjQ4ubotMjeviHaghqnL\nO2IoMThTxiCfwuf8yU0y0IB/pXPaHxtWW3WHa3w/zPYXe1VzBmS+rod7ckqV\nnANOsApxw+khw/Wd+2Kh7JIuqKGQDTqVY9vYP7LvR2VbzE4eIqKFg2hR4zf5\ncgWowV3ujqNr7/krvGetXAeSL/MVtulZFP4XuLLrx8YgrORH0T7cr3xIwitB\nHxnKQz+Ma61tjwMQ9GABJuQdfVC5RBBKuX9TT6W0zzfnDahHtQfhTCa2Va7a\n9+PznfqduDx1idRvLAi2Wnje1P1z0UHLb8fTPY+xonOnJi9aqmdfVxxqcX8P\n6fas5R8UoJpq7IW+DDKfLj7Vk2qrAXbjL6HPFfte9MC/Qh3gPLSp17V6Ejxv\nqEuy\r\n=shEs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC639pMk+dzIBf0ilp8yEtVAqSK+tu9yCE09MgeZWjNgAIhANV5flVdNhEI7/MMqe9b5n3D1WCilnY7I2kCIMgWCyzQ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.980062ff_1544364381904_0.10130977239010774"},"_hasShrinkwrap":false},"0.15.0-alpha.9cf18568":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.9cf18568","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.1","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.9cf18568","dist":{"shasum":"0c35772497a9130f1906b761d1b418ebb81d763f","integrity":"sha512-3pPmuDD2zEouFw7Kc8/GDY5TbY6/C7/UZHlfwj4QHZHKfTr/hJmPRuHm5NxBop+MIQXDQDqyycV4KNjpKv4TQA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.9cf18568.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDST/CRA9TVsSAnZWagAAwpsQAI5e/iUvaXJwtfXpZWoG\n6YRiDEzSlwmrkWvwwGFmyKjAmljFTHT8Fe8pGVpcwDtpTXIhEgTiqalkLT4B\n4xjw+RP0p3iQWl5yYuQK6XAUHtouNN41+2PEO02PNblb0VPN+idMmgFL4tWe\nw1lDGgcJjJr7R/f3Qv+LbKqM09dyNqI3io4+UERaaK7En9PO9BgBjXY2Mdr0\nAkz+QaWLwly3fYhLMmcvN1lJeuioVPYaSrRroocXhz/9ED3qJBZnbzqf1yrS\n8mbZPc1T2atZsiRbqJahZDECwQOTZMqS43JjF0+1c4q4eAHulh3B+9XtPKeu\n2gHRGRByGfCALQ+BUGGPJwfq5qTa78oCpq43uPKt3Hg5uXSVZhwYbJFNATIC\nFkYf2Yp2kBs/xUFE2yVvT1mc3HrMKgbIjOBcyulIjq/lu21K4jnPLIU8q7E3\nyw4bdbnTvRGr/itIkPXW51HLjxfdL0ZDQmfdxqQ2TeCF1zW7leIeIAgq1plP\nU//Ne9f4L7udx0rj5h8hEkrTViGDSfMZd1cT3icLXRuek+DF0KDzqhVNnWF5\nqLU1z6hQCKbUYIEm557PnQujScHNmcJEOppSrIzeW0ITe8hGoaLtmn/okqwS\nl+r9SSrol1SjFLzy5Ucc6OXO8PkWJykPS+SG6GYrAZHeEACUPoykF7YeKXUH\nBl3j\r\n=M8/w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDZlpIhtRJclX9JjWtTRRFFZd7HEkX8+EhmCxQ5gW+ayAiEAxZTofUrsOPMdsuP0UaoNqjfvO9GJBlkpBGE1rob7Dko="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.9cf18568_1544365311106_0.7770933974882259"},"_hasShrinkwrap":false},"0.15.0-alpha.b02d66b6":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.b02d66b6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.b02d66b6","dist":{"shasum":"104834107565c32725051b2f0344a180a0411a53","integrity":"sha512-BYccHXOGYBjkQCXlCrZ0jKYQJuJxww/VmXFfb3uFaXLtkxPjYsZ8JtN1aEIjgeuF5gwF6YQTvsIJiURctJYdEA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.b02d66b6.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDXp6CRA9TVsSAnZWagAAm+0P/3hgLsJSNXqrGJN7R3F9\n4wOWKt10Dgl8xsDj9lkSSWymvaL/DUBpxi0t8CTp+AKip8CloEFw7RCUrH9+\nLxHbntLgyoVEl92oomZfM/hMuzlEXJMW2dPv+9XxBo0SRawkF5DZu9g/3t13\na/79yEe149jhbm+AAh+MTLOXmD1QiAdNHuny6zAt6GDLbsHbzJ2WDjkaauuO\nea8i2JOnuPhIEPaSFPpijjUywTzvYrNcpMgaph92wtQNGm2ULSsMnanU9x5a\nMhbbqcdhBLjXJNGupIG/ivqxHDHvH5/warKbbEmxydbtiCE5nYjb4aKwqCKb\nVpZHzVeeQj69Gm67BJOrMGzCaKFVZqLX3WPyiu/wr9YrNxiaIt5uULYv5/Kj\nSSjRTcKsxkFiiNLQQ1AARIfiMDuzGss5NrdwFn/yZoEg8Mg6rmQ36N8PSL+u\nsgz6I6v5Ls3aLl3uVy6wwB0j/1gwZrcqY5Otuk4WnLF/ZSurskU2BmigZOtp\niOdjehvrfmUB/9R6RUg5NjGFmEvaOhKeumKDGJcYr3jvyhp2+vKdgx2Z593T\noRFsHbM3EgmpU6q5C8n61EutpAG+cYtkKhwJ4AmEGQkrPTOI7AKoLN6lImg0\n1Zsv11yaYhcUtC96mbwxo5dH9i5ngpuALx57Nx0iysuuXFk24ij287ttmU2B\nQH/B\r\n=IsM5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHz5izV1ZKvZO1znA66KwsoVjTjSsbJsKw2YYKltD+gjAiBl65PQySbrDG9VN4lR9Jp7EcZ3c4J681ws5XcOrcg7Mg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.b02d66b6_1544387193953_0.5932288250541142"},"_hasShrinkwrap":false},"0.15.0-alpha.70e0b7bf":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.70e0b7bf","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.70e0b7bf","dist":{"shasum":"5e8f439a34aef4d926d375b38c18a7d7a5221c70","integrity":"sha512-tJtkza+Uu06NhlWQK7ojAOzEa+GF8Sed96TUx1LnDLghHqQZsJcIbCjsfiKQakj2qRY933HQ5qczanwgdmV5UQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.70e0b7bf.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDgyUCRA9TVsSAnZWagAAg8IP/RYiruNRIKe7XGOO60Ul\nPNw9p/9niga+LNI4ViYyu3iOn+0BNCLqsG44pItR7fw66bzhJCoE3wnuK1TX\nwAtBCVxtGesv4KEaFMAUEzJ2DNVEKMvkLRA1VA8/MaU9iaKdQ1RFp6uVCXl8\neaXcq0nS5c7HGZrnyIua8nuVNA3LhukKaDJFRoj3fyh6Vt0TsKpteAHGnxBC\nMhPp4Byj/8rIzLGEoyDvQ8e5RUzzIBZiAzC2OkGbUkjAkdHfBQ7IaR+bdZ1E\nuLPKMCzpHnXpAWv5j9LXZUhmsWSsY7WWOif3AlOrCqqA+EzqBzVlsx69cthq\nNAdq04QuUYVzXx1ZeH/N3Ky6i3/0m/LXflmb6Qfv5BhP6et+B9HOGTVkC+/z\nD0Fsq1MvoWC6Bddf33wAjcMhrcB1BGtOQZtf4mYAUo1NivnNtv+LQ4obhZlV\neVrVTAQW4rZsFFbLqTO441ja95UN03NkKWUtJkAbjemOJ2PjJBcttLkJ+EBZ\nnhNNuW5eccCbp1YB9Q9qprUXYy3vCaw7suMxnTBol/HR7aFmCu2COqPLM+br\nXf+Za6vIjLOZmgELF7V4P7VwcQwwU/09N9DiJxAEq4SWk9d70lXNJZzVygHw\nzGv26YcaPRcEW37aWqE+jam0c5vCTiqeAdwuIsV9cHfFVj08YRaCd/JV5emA\nSb6j\r\n=hPnz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHyKWPzX/IBPmPazUmi4jI/ou4GfMHYkC1k4EeyDVEkMAiEA4fRiAyH4Vcx48u8rCtyapFaPmDOkMwN0JBjv1s1akEA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.70e0b7bf_1544424595921_0.6706270642512329"},"_hasShrinkwrap":false},"0.15.0-alpha.beb7a0bd":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.beb7a0bd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.beb7a0bd","dist":{"shasum":"f9d902eb34690923aa73a6e3cbb7721ddddb56ea","integrity":"sha512-F6p/3J4uvSRDPyQDJ3Bmfza49rkeouAGHptWTu6DE1yGSVC+AIVJCYN4j1oT6lCi5svNKnGAMvxg7WBdu3Q1Tg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.beb7a0bd.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDhFGCRA9TVsSAnZWagAAx4sQAJ/b90cVCklJLty9IJJ9\nNqdU368RLyR9saIie+ZKgmG4c92BiJtcnu/fG78ARzMB+MrYNby40zmSWy2L\nZWNTYNOazjn2oeedU6WQUUOFNwe+wqXICyIdtfjpAg90zakf+PtELb2fH6ym\n7fPk9645hT2F5ozKtelqaX7W1rn98XdIF/6OYh6upc3vSQpfG5Z2oQGRgcJh\n6kqM8KRuKwAqqLiTpBMVbMAtsQP0pv0JtDigPtU2rlYfMHDKTo3qa+quBnPx\njKWQDxX+xcCWa7izwTGJVl1hijpQ2pAz04mWiCuf73der7LWHOj0H25hH7pl\n0f+rY6gkG9ZJep0C+jvm5UNSDas3RctinjBUgzcWoTbgTh1Kd8fZAOo8uHZU\nNU7AvakcOkdmi2E/CDlCBTZdO7zxMWEfsO8aqucUJ6VCtE3LWRTgaGHUG9pU\npDex9ytvR8G5RjiSwIYlc6fdRPMU7AWrzxEVLEFLgREwpTfLn0CVZWLKh7Dm\n35hnv+dww6hqLYVNYy2o4pOGVa1VpXdEwqLwdmzz29nmG70+3CbrhRLQt70h\nACx4rJ0XJIZlNzKqclI5IvBSwYEskWtF+OJ4FhCkP3YfnRxCWsELHahltuOx\nRjJBkESVrkE4tNTQx0Cmob6OWLlCx+/IdDZG8C2+BIB0wELsSTiwSf9MgKQD\nagkZ\r\n=/0DY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/QYNhbl88RbenqbZ3deQpvS5wOml3p1wddBjdb9cH2QIgMslEQP9zOoohV+I51hxY351vE7lYM0/jFd/RIsbxSJE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.beb7a0bd_1544425797673_0.04505604739154356"},"_hasShrinkwrap":false},"0.15.0-alpha.79ded204":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.79ded204","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.79ded204","dist":{"shasum":"4fd9808416dc007bab915f5e7c48e7550c639623","integrity":"sha512-TH2MROb/jzctsRMdB5kN1KXYYOvMITmWY18uhVS8sVVCz6Ctle+XbNLKHaoHX1fIjztAJ9J9W33dO5d+Lus8/g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.79ded204.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDh97CRA9TVsSAnZWagAAQzkP/A4MngzRg9J9UtkDOkj4\nRRXILYmggls9yAj43GTQDr145l7nYpvhIN2ZywtWkuTuV5z7ipE6wG4AQnQC\nae/PtFup4ZcqYbfa0WwRTxXDRPvap2AcCkcgW7f8OsFgtxHRZG4QzBAlflvS\nDTe6Mubm891vgYAloqSUjYqpVLf6W5mYeWjYXdzmFJMFwvMK/o5OuuRzQOx2\n9peLv1L8NkMwzzCTYrpe9jP9w6Tc/xY351qq4z1glJhBcb5Ihi6lgV5aUp6X\ngrMECzS4MWpWZvq7nHiVz8tfL9ovHbMLzv5AnxvyAo9oEq+kT7rFun4Pfe/8\nmywFkNbax3NHLJ9PCmGy9JXheRdwwEdHLjpd6NaazpJmmPepqb9eMzqn+1Bo\nnSil+GEwbFjBUxBh1H7NVmYCuliJ1PqPn2SBw/GZYCb4cFMpBun5psRlV4Wj\nUTI4eqZMFnHBCT9FrLxtYO6gpZO3zG1gmojEUTmd5nZ5ixFI/GOUaZAqsehY\nNKGL225X56LFs0HWio7ZP06XWSod0BD8eAUrAVmUpwsoLC18sMeUITOWv08d\n3R8vcwDZCod8P/gQUohmRII04OdMJTKSbcBeXLAXoyXTxFLJGywPOQKVa7VR\nm3BdTsmFju0HMvFT2hLSSjiid1QZNX/ZG7A2MFgQTpl/JUSGw63TZEgw2KCT\nmFIu\r\n=SCYM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjpPYpk50CwEM4afOn6B4pECO5eM1vAfHZSmQPqP27qAIgZIUxeQzUXKBi54Dd1QzucAUm+km+VEyxXgWFlTsUg3Y="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.79ded204_1544429434389_0.3046437725448108"},"_hasShrinkwrap":false},"0.15.0-alpha.68f66d5d":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.68f66d5d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.68f66d5d","dist":{"shasum":"bdfb2ca1ecf8aae51ff5888cbc6044386b3633b2","integrity":"sha512-JYEitut25qHlFHyIZWzW/O8fkWtSxe3Ruk0aABEh1mePRCJmzPuzW1t+hbskRc628FCFXGkqzGbiL0JTxbjRZw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.68f66d5d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDh+JCRA9TVsSAnZWagAAKygP/1XfSyUcT8bOCV4xsRfV\ndv7WIBKPkPhPrEFwevqJmFKb7AaSZsqbNABd7S7YeDLKo2UceLPIWARzUYSx\nVXopg0PlOAU6q5gVeOE6bubz7taeVzzvVq9ygKy59+o3iTBVeTbl1jZ5WVdA\nuvhwQ93Wdq6GhNImp88xSdoDvxVz0VSn+21dt49olvnEjwLspSfFDlX9RmpQ\ncxHrsRhGZPWizC1xCgUGKIdYccqQU0z3PyQppVWcyapzUeU0BumieM6HUnya\nTS0ZlG2VazyR4DWr1xdExAlrj6v4rkB0O10ha4PfwckOcTIYnRqYZiQlXZXW\nRDIQYTrYPbPBRwp9568q0NEH/3STQxXmuyJ+pd/Gpflyvlir/RRZKRRnHHmK\nFUzU0FbfjIO0taGkkzsy4QbL8uZiLUX98hf6tWqNwsvnJCV6Is+e4LNpLBuH\n3yCZHHeXo9j6fPpgT06N7ADERA5BUnGHmEh40YeVQkgYvDEYWRUGy1w1UX03\nu44O5WgwP8BB+3ak/9PhQ/UfuRc2On3MA0A/mOogQR5TQdycUd8SNvb+Htqx\nJOOQH5XpxT1/kTiUcV0xNfGrvszaHY8bDT8CibGpnjf7+A2tUTg6WQpRt4WY\n/vCmvZUMiMyKPda/3nzcfhhCl88CMA6rewhC6dFIDks6MuEtkiqrrmnThZGw\n2Y74\r\n=Wupm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCASdfedF+Ej+ZCd6h2WMCuknBotR5oDuHrdj56Fy5L3gIhAMFv56JH+e9bd73zG7Vu8UpxZjv4UDhbMi9RKVJNVS/l"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.68f66d5d_1544429448865_0.09791756118767769"},"_hasShrinkwrap":false},"0.15.0-alpha.19ababe1":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.19ababe1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.19ababe1","dist":{"shasum":"2c894ac29aa64d12739ca4a6783d3982c2dc37a4","integrity":"sha512-z4lSG8PwhRknKaAYBBe+XkmSYfc2wTpET2s5qBk4MUAWBFujj8g87CoY59LML2Y/8AQ/aKaSO34u1opP7H4GKw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.19ababe1.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDlXXCRA9TVsSAnZWagAAE50P/iuMfd7Xu9fY69bCVkmF\nY6RHHNy9ooGKuVOD8SaZ7wOtCWnCkb2iGpuPQ3tGq0ND0XTW/cAIr3rOTCor\nyAFWZNZoVnc1RJ9A28fEJyUXeJV+Oq0gXfKndUA/zxOU67vgtnO7sbekUyOI\nMB3keeDmio4MbIysnMeHnKoJ9Xum1Ldi2oeI2iDqAQI7uHr2Q9MgFDwc7sv1\n8W4RXbe2/y9Wk0T/bHH2BINBPR/uuSr8WY4ARlOW5tysoXykeEC+/X/4DOXq\n6t6OkGahicx8Oz5jXJt1t3N8BqjhmKUhD9/Y/hBR+48VnAFczmnuitG3hiwP\ni+fBm3iov8N+TsTj5RsTfX9u+kMuIZvuTnn+dr/OGGesgSDKQZkWJQYSDzdN\n7VA8CAECnTyEf192/wdlCfnz28ubRndYv2bLumPJqkT8dVajZySHcoDszEKf\ncYpnwSxp9GLahEfIEPC6KZq+kPlATpBh3b82eXeH+0KtIfxpjCV1DbJNKD3r\nnzC3M2+t56SPQW7yNz9PznGYRV6Sj5DSk4f9VoRbtg0J4rMs5ChYWbPVXBL+\nC58t+TS8Lq8/2ZLWNl30gIGmn3KjqfdV8eHAxVyAWIiZ/LSVLtZpx4ghQnWi\nau/pJ5Mf0Jq+wE2h39JR7l5ts1DR2tMsHdQ7UojBoFTjeESwoL39NxyqNfB1\n0o6U\r\n=4nnR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHJTxhvB2bPaYwPEZZyFA0Kt+rwLPJAEJ0C4ViRav54JAiEA8cAqTQyzUabq3TjL9yCyA/Kg6zuj5DGQdCq6sTrppQM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.19ababe1_1544443350714_0.5416673901898466"},"_hasShrinkwrap":false},"0.15.0-alpha.6de1415e":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.6de1415e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.6de1415e","dist":{"shasum":"88f740a2789a5e683e14296dfb864825174e3d0c","integrity":"sha512-Qe36JyAVS3M6BzxF6gsl04O+znaDhAMjXS9zfhhLMAWmSAMIqb0Ej4C9cKFmaqSKXlML45EqxVivSiLRKfOJyA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.6de1415e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDl1UCRA9TVsSAnZWagAALqwP/jw/3JyltTTQP6yfjanJ\nsXLbmmykDwMtnVc/GoHmes8pPFOh4Qi6U6XtG5okDlc7bLi2zPUPnD8pZ9o0\nti1tsT60XkwPVxLJHbR631+TAEvFbYkDizCCJWypbC6ywXifReHQtOE//hut\ncv9iqcNajzes8EFrqiOER3s8/pf3bu+oJRwPv8aV9ZO+ww09V0iR/Qyimlh6\nzChOKNdy3M+tf/7sM7m0Ja6IaYVB7GHASZW+Lb/zZvFKfiphzJETN4Lh3ixl\n35MMjql5lfV7RH8izyKXGmFKMfdgGEPB+wsILdUAUrS7AlsnMLrwFOvmxl0V\niqk3sTOmzI1V+1ysjimbvSY46Am2d2rifadnqEP8wp7cT0dKoMPSrXe1tmyk\nHKVKEV4co0uFIta+IFduGx4MdgnTem0AfPkUPR/yjty9iNfFhb6EmR0PWgw1\nBvxFq6NduE2TIp0QLNO2T+vMZavIrPyRvU9z12lxqWUIicZjdIneNMp9I7b7\nfMfAqYIyZ6L9Ut14rNN6FR4qaHLjb0r+rAG22OYDdXRpdcdqjKTw8Wmep2Il\n3tG53eKjzYT70ztqwoUjzLIjhYt5k6xyHpaguEJtudnSf385ov7vKAzJZEaa\nTzVEFau2s8iQip5/NMmt6IzwgP6pqIYPFP9TW43v4s9Hba4I99ABvfbEbYr+\nDBxV\r\n=07np\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFxNWrm6CaYCNg0xndT6yVS/Go9kCm/kVpAE9NA/Or1eAiEAykhB/h1qikAfX4bsNiXQmmrRSdJobwpT8SkCbklUbes="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.6de1415e_1544445267975_0.4466589829492702"},"_hasShrinkwrap":false},"0.15.0-alpha.0e78eec3":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.0e78eec3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.0e78eec3","dist":{"shasum":"8967ab120bfb573f6e896dff92762a828d826988","integrity":"sha512-z8PpieAwIwwts+zIMqWHtnYKnKuVu9xLiJwK4OA/LA7ATtX1kTv7NmufxlsSH3x2zUoTFxHg1KbJxQL2KwApSA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.0e78eec3.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDmbMCRA9TVsSAnZWagAA+JMP+gI1MiRJ4zikSoJaiAj6\niA6ednqMbgiiLo9wInYsRn7BzXLbtqOmqqqNjJvkSam6smmO6fD5kRmQ5tpM\nfrws8bX64eTs2cb0GOeL5BmLxecrll00duQmtEQWeXjprYMUJUPNdMT0ORla\ndG2UadkXTw6IMU8tNlJvjo00PSwaUEVQqQCNef7E88ZNtpXAmsbrxlrPBbKE\nbWj0K7Ydej33252N64eit85azRPCia5Q1ELbztX+4i7MkJ9tTyTjAkf405rk\nMvknn1EdZqDY2s38i6j+qgeSsAUgZvKtX0LfT9BHxuN3hbe6Sb8XalqHb4nw\nvo+QGXNNvQRozPG7XU7HtIx4WH9KAUYoiCnX/n1kFqsEqF0dh7aHdkAeb/LQ\nHlrIaBixzPbdKB+VjjBy2lfBtrdJjXg6GQROHvHlzo0AMgyuIZnJ6mtXtrpG\nJU98zNKxpmzSUr2OYsmqLo5vshOplm2suehBvv2mZNWs22AARONjs118iIGi\n5z40XSnS3+CKIM/Cp3kP2DMniBXEAKfN3RZOhB2mnmitQpfGaqiA+9JjHXeg\n0W+nZb1gDqiPhQEQigZKUtH6yBIlRFVAlD6j5aVS4WBGyJSZ0FqiK4dv1on2\nGOkrv3JMhAvlTQlArxC6RwxwkiPoOu3gWegqYKHuYZBgjwZs6TOCePK6ZNwh\nRYdo\r\n=u7PT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH08wNkQyocbliGhwnVzywH4F3A4QW2MuZVj68fnRuJPAiAZoXy+QspaAnYT944dlxZdyqjjEwMtfzRwMoFx6aNreQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.0e78eec3_1544447691799_0.09000796517084253"},"_hasShrinkwrap":false},"0.15.0-alpha.632ad817":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.632ad817","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.632ad817","dist":{"shasum":"20bbc4328d0744949c80defe1bafae12855b524c","integrity":"sha512-8UUGZQdF7Dhl728Agb5uJuKxIzoj28Bq77ib2RLn51dcCwOa61Jq3ymopwZuCcdYVc6k8gAaam0R4OjPIqZzzQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.632ad817.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDmbiCRA9TVsSAnZWagAALqAQAKH6hvd70nWYNmK5LNzV\nW1RIk283r8YYqyhPm/seeGwiLdg/JqIEGSQmDqp6zkFN81OphxNYuByr92Uf\nlJdzYZa2wdjOl8JGvWCShPLawEwBUsojb4MuCPUKVynec+kZ7urmRCvDbSqm\nmEYPaBrQZhKe39n5l2VzqEA0etYOXWCeRgbOj4pJP5Kix6lnjyGZsawOG7w/\nCEWwu61wDKaJqpaVRZgNI/zkhUyTqGRRdlhD96WJooZwx67wa4s/Wufhvyor\ntjSe8npKY00vv5Qp+9OEtnVCUB8HwHCeUZ7l3ZpRM6Cf66v+xLqgPRKK5whW\nMUzRRf1Y+jEftUHXEvJcOjUX91ej7b5K5oMhWLclypZfUNu3g/RV/P7Epc6F\nBiRTBtdqbYGGXgPhSwPOsyUtin1F0B8eUV/+zlTiM2FZxUUvP20ULpN1ZuhT\nybEggLRd2jAMiFdBYSaWG1/0Acf5qfeDwkdJi5YCAqOJuoILONOFR5rAtX/C\nziEfgs92pOUyMtfGy/rwYgqbJzIGO3RxNw7WtMmHsD28Knp5A3GJ6eKKo43L\n45PMX7oDPLq4iyXVKTZudSe54Y7PUx5e6ZwJK/Exji8Mu9oflMqbrCXtccXH\neRIvFkTzh9x5NdWCPc15W11PuswPhtyakIryn6U+ucYkoquSGcPYi2FYg96y\n/XpL\r\n=Xsd7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEq/Ws+GD9Q/v5/kE1rybzn2PGJpgeGVh9XPpv96kGh+AiAxx6AN2EKsAI6LZQNGvY74fgzqr9Ky6HMCNSSFyWc3EQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.632ad817_1544447713381_0.8660400492527678"},"_hasShrinkwrap":false},"0.15.0-alpha.3ade2436":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.3ade2436","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.3ade2436","dist":{"shasum":"8ad101d485797caf70891a1d656e0afcc8b1432b","integrity":"sha512-yT+PM1zp8tStvYUavno0ScbEFmMRKxFWBxE6DRXTTABmlTuAnGEZmdaYJWlXFseTMIigUee7DNoQyXMheI0pJA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.3ade2436.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDmb2CRA9TVsSAnZWagAAp5gP/2D3+TTvVIeIDNTTIVmX\nUNG89jmQ/jAoED6m7xa6G+XA86GoV4RgSlr/A4LBBE7r1VAn3XmKZxymQr+B\nZSVONB9HNTr/ijbNI61t1b8+6LxlNw0s/GI2HlZugiZ/dg4T2yulGRPbG7We\nmmpodd++nGgCqWhv1/LAV00lg+Z8IRqxU6C9E1juBB/Pq1nXwilQpstyt2hZ\nIA47BsiJzXcVC2z7WTFpdQVYZMnhYYv0I42ih/m2Un/T4GYWoIyuLQKqu2DR\nEgfWnmf6Vcvd1Dls6fBz4yBjxIynEXl4MnOvF0zE9ayNvbtZ0wepeeEMlHSr\nq/Krn1BHM0Dgv/HCUfpk+oF7JZRB2eE7orjMY5hblkXzVD8aZepJybA/i6q5\nr0UqgttwcbAh7K6yulG5QupQ/sd8E6rf6ITzP77Csj+qBUvzYwMaivzc7DP3\n+nmUktmJnVy/1FLEbXCk2+0mQ7obx8vGHcWJSwoZau/tgY+OE45DxxOWn2uG\nkZgvw0UgfGpThE1UAUdRQH602UTXTErYZqxENDBJNMnQIcmmWlI5SKeOJKJK\nKWSnAc6BUlHpT2NwRZCR4exPdZguNqsuzJw/CnlJ7jYaAj81k4bKqXOV9pLj\ngZcj6R2IMr9+cKheTXSykfSWByzuU7YHBTPk/VoKIIh2xUaxYBUyoHpI9Bzk\nXLV+\r\n=lrCh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDD2gW6l4sT/cGec+bqd5Mlo7/Pz73HbEzbMv2aTA70EAiEA1RUWarsPaMnIhFA+8huW7BHlbsWILfzUwKcp7ucvPE0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.3ade2436_1544447733933_0.637608063761335"},"_hasShrinkwrap":false},"0.15.0-alpha.c0cd7ed2":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.c0cd7ed2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.c0cd7ed2","dist":{"shasum":"a7343d4115f616b1c5590ea2e08ef5ec974e53cf","integrity":"sha512-W2rShnqcRlvBJLdOoFl+sKMqQOJsb2sKX028fANp8XZ3ukEnMBzN99z0ijBeGilgC7DCQYr54HYbgUL9e7wVRw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.c0cd7ed2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDuwdCRA9TVsSAnZWagAAxGwP/ibUpbpZdAZKQ3y/dJFN\nuI0+16q6vVmQzFb9E0vRnsjtW/Iumgg1zezJ6vteCiNUpsDSQ2Cjd3o3SiQ3\nMWJ3uCsUD3dMIxU8CzdCTtyoFlBNIjOC6qe2DQJnzrjB9vfTQNZQpILOJugp\nreuRkxb9MWAvlCaP7BJoVdkyLu0/IWy1eyZ49Qrhi+K69XbO8h1cKmTztNzQ\nZBXRMVF8iPHLifkrI9jPHkZoTCScG3q/ydgujh3sWGbtZpdHO3WTo5DW2I6t\n4mldpVpBtCS0Ss2D1rWGukfLhX+kZRFJ01MH0fP8GeFqwTHN/f3GYSxx//pK\niMO9R2fy9NrefywSeqADg73REWz4j3jd1SWM1XGt6YR0pTWGq7+zm2idnpZq\nbd2PW/D6HXXGbqAJRKqrYgNlYKzYLuDzSDr2uAl2/hXQeR0tQwva2Xn0oIDi\nIsP9E8k+7sUk+S0IYkS2lXqoRGpWstwqeo/gbSW3CWIWCFPrG0P0SmQnaXZ3\nCqwcUWOQDb5tee0hXWMyRUcP8EXSi8RsaqLSbUGZ9uDliFgO546PR7ea9z+W\nwBKkWpQSx6+yVB4I1szvgvFfluXdXxyQg52FcAudHsg22ucYYSWIig3di/Px\nXwUwBGZNUYjDUwG/6eihClf8mbKv3VG6LQcZDwYzA843kfY6DPP30N9nzGUm\nZbWN\r\n=1iat\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSoxfrn79SbKcnRXQMDQD9UtumOlrRC5IOku4dNKPvNgIgSOhmYh66X4xDfAetaZxDr9rf6G+or1/UmhPW3LDacSk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.c0cd7ed2_1544481821090_0.4591500004057494"},"_hasShrinkwrap":false},"0.15.0-alpha.912ea469":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.912ea469","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.912ea469","dist":{"shasum":"c9f3f65a3c81a5caebe07d081ea06f6b23e4692e","integrity":"sha512-Q7CSSkR/PfY8HW0xqNY8MTaz2XZeAJXQ8mMk/R4hQNmkU2fbJyxcKDkK++HTccCD9SyDUPkiJ7U2n6/TlQDexw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.912ea469.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDyQ/CRA9TVsSAnZWagAA2uoP/RVfs0WgWbqFtwnvDHpy\ng2J62xVPg2iz8ChAFKnbvlBQunYS+bTyD73T+0lWn0ZU2lqUSGwEg7vudvBi\nH2NJQA/uf2cCRPzkcpqQHN+ONlBSfYo5LKiYtGt6WdqPurFGllaGX98d1RnX\n0+bJ5+lyIVCWII8GSTd69DX7r3SrtIwNoaYrjcE1/HXcstH0PZMujgtnK2KK\nHqbL5UMheNNnpmHJ054ypHUzVsylEvQpFulL2izsssJLz9h3ODe57CiyhXl8\nQUBYOrFzj0XspAIwEBk4KAJ6YSKSLbZeEjXOay945bvkIGy97LFg9JpFJgQ9\nkYX56AtwfHD/Q0i/qrdkEUNmWffT8oAowJEN37sHrM0FIFDy7dq8REd/pU2E\neXRWRq8WYho1/1MtLraM0+2Iu+wyHsPTcaLAy6utN+XFfAH8/9jBxLe00ELo\nN57nB9TRHB+ocV8wUCqs5lOX+G3XjN+iyMPSAWUFOdPLnKwDu55bJIDiAbex\nYZ6RR23AnRYiU8K3EP6wz+J4VXtFqBsbYVKnuCnNKek32el9VuwCy+wFa4RE\nzo8FZw1Myuv+EAgTLx3OValGDyeyGLiuEVTCJ0KX96TFZalfGDPyf9t86Ikf\nq0Ir8sRKP4ow7O0+J2fT3LdS3y44gxc93Yj8veGifLQj9iVvYhhksDSx5qHw\nz2fC\r\n=rN0+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1xGUPuNxR2at0VgIvfAukCM+Sg4kfssJ45MPRNizDnAIhAIBzMU3B66bIyY2sRy53RCKI3hlKDbOm90qZU6fJIuzj"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.912ea469_1544496190889_0.9564981461007511"},"_hasShrinkwrap":false},"0.15.0-alpha.64853393":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.64853393","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.64853393","dist":{"shasum":"6bbe2201c0389bec9fe9ede737675af344764407","integrity":"sha512-dL+n7ORIBqHGwfEpFvsQuL6f6m0XSkNcqL3ecDGMJX3L83JE05P8HAU0ye7S5JsTAmhBt145Bepv2n/uCnKlsA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.64853393.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDy37CRA9TVsSAnZWagAAhksQAJLy5rJahhTX4TojM/mV\n0MWVWFw9aqV4Ld0pubGkx6rQGb+3J8Ogsvn+JBHCaYNuudZ7ExTc+WOVESi7\nnbRptNW0T0iCQy2U5IjxTkCEdOTZTXo8Uw0h1XSb7Qldc7Pks11m0oMsITZ5\na/5vE3NDTMq7LhqLmsp5D6cfrrPrxZMRzfdkXNTRK3uI+Q+Ia7iCYMzkDhCY\na5EOQbIfgCvcIcevdX8c27G2R6BVTUJabczWtQ/pVhuHF9Z7rLqbYFAMicZI\nlhWA1XbYQPVk9u4dmgIY/R2M7TNknDPEYCCtQqBegMxkc8taHCiSrlv3XOEQ\njgOAnBfql58uCTQhE4UU6MwgCQx64kkar0wcaNw0De8RH6d4DqZokF+njlDK\nDEr1nz7nul7fo3EPGXxCbkY92zZrJQlXIqtD09vALOOHEZ1RUt1ZrFdKhEBk\n5yHxzN3lvnFuZikboV/QWRURBJ7DlfKKJAvRqaG2brfMgMxDpuyHvNNlkvW0\nz+SR6SE77tdFcjS3EE/e027mDjpL/c113KtLuo5Ii1EggMvXxj9A70gfUjVv\n7hiYntZV/lEEs8xqchy2uClYSTPypxgQm/aQLETBXxqNVCeKR+pLHpfVxw/+\n7wIjDKBWszzBOu1pOsfOB4bNw3ADgFIwIL4wEUQniSYwi+8ahK8WOoeUucIo\nViqZ\r\n=I4zB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDs86mVSaf82vKC+/vxDqun8cMKMCvBR8gPgxYMROtDLAIgJQwlWhBTcUNLlgqA7jA45FUSmicgYZdYJSPNh2sBpg4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.64853393_1544498682164_0.4977477755497286"},"_hasShrinkwrap":false},"0.15.0-alpha.449ad117":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.449ad117","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.449ad117","dist":{"shasum":"3d4bef128db8b8ab8c378fe53f1481e4af3e96da","integrity":"sha512-mviOXZpVrnWPSi8MWrWUcjk9/qNVmsG66hBIeAzyoZB37WchWZnd0+GcJP1ruyKnvkzf7aPSBbp9KbQmhvEr8w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.449ad117.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcD07iCRA9TVsSAnZWagAAs84P/3Mee1tk0VPe3y91/lRO\neSy5BrWI+uvhr2GHcytLoMPFD+IJzrQb8Tf9QdAUBlExB6CTVn6nUArbZyUo\nuxQanPsyrKFByAe+Q7c4e0XtUwDHgfZuTNArTu58K9Y0itj7s0NC7gI+m1Fr\ndZAC8FkuI7IPa3hVthesgamhLukeP1WKAvx3Z99aBUhgxwjxEvy+L+AXJpA0\nsWJ3SY9mnlpI56g7Prk0T5eh7yh+XeT2LOrI37E5V8f1ptN0nzSIOXxrYdyW\nQg4of7L8O/kSW4I1gCE3FmAvwh6R15PWrylh995eoPeeQViI0jk84iRRNY9d\n5J6IAndIZl4//5F2e7QPa1NxoJzo+uWeE54HFnoXzC0+u28LMBnMIO1rWDem\ngghJH1NeJ7Vv9ZNjehnbAqkqj8TNRzejvcdRVWWsTTJZsbXM9dIq3QcM35Tb\nUZEjLk+5oX+gBmvWR2Mmfupg1m/29rKN+j0p/J3jmRc17hfDBr/z/sz2Fvks\nUlzQM+CDzyKFG1xvSezy1SJ73yqZ/sNn1al1+kHqe8pf4JlEOivrSMkOb9T3\nnNxYa3vFJcspNhVsuAwx5lWpV8Y5aXf+oiBpsgLjCBkyXVbVt6m4BY1dF2C1\nXzilVjJIONXNxnoEfbhjfLCAtnBTTrdRWNJszb9KUMY5l7dxsV/8AG23Rf96\nDFyI\r\n=k9Yi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCv6B0Ir8p7ncCXvuG9d8e5WLE9braSUu35UmbkW9VmNQIhANlhAXindu/KwTMMpHgs7KDyBMCgKha5WlxjDowDmM3F"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.449ad117_1544507105426_0.2596741292165283"},"_hasShrinkwrap":false},"0.15.0-alpha.ce0251b5":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.ce0251b5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.ce0251b5","dist":{"shasum":"c2848c435bed4aea94275a7fc176ca5d8b649cae","integrity":"sha512-1rh4wX1qPXpNV37v4MOjKLY+UkLcRGDo9rthNUNv7Fbbze+lFC3b/rDrnXmJLmgxTIOEqRmgPrFz/PuDgagVFA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.ce0251b5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcD07sCRA9TVsSAnZWagAAycYP/19IHwXWz0Jd61MObgZl\n8sEqsX68JFRk7vnjSl0HQuOEcIOQYvAXwFDOGXPcs7AXYO9aVuab0XdM2P+y\n3ih+772rzOZQni4QyUvf7jeT+KKtLD7+AW/uHXo8ilG/M0zqd3H3wZ4P49hx\nzzo38fjHX7Y9t5aAIDu/28EMCnPurr/85cLADm9BNaEZu3JnvUyckjqnHlIP\nFOHP18VIO0R0QiP/jSQCwuQ8VvVNva4f6t6RLgoQ5gdB44cbbya4LTL+CM97\n2Ps3I/MSnsmmSJK/AZlhbRwrnNomU1gLQbsTXHBDCrVd7TRCWmkAa7QoPTgN\n8UjFPneIS8QUQvNfyvaWXxU7TejXaWSVyZvNSJY5CVFlNSy9rnkxzqY/CuGB\ncO8ASY//Pp7G1DDadGhKj+QJ/3dCiEBzDn4o+XhlJneCcxkWthhrXDSGdk7w\nORUHl3M1ERHAVuZols7gMVgxUuS1458LHdDg+cAH1DGDKevH+0sWrQABhU2J\nstCJScoI2ywxuAzuum6h5R3l+IX1NC9k3agPfC6ys8piUsrtBw/CLVBl0yv4\nQf8grYlHu0plPjjzlGjZQc50EWB8g1EcZxYNf5Zn4t7DJ1Byi6wqgjqhwm1s\nQNI5syEPFlGjOKuyd2KEXzpPVRfkNtBhbWECtmnoIo2rr+U9xyWrtDMhA5Yz\n8BQH\r\n=EtKl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFtEjitHghbZ97L9F/yF/5RFMHdSd/1FvJGhOGhsHM/IAiB853iQX5pyg51Td6L4pZ5O2Ln4lrJsHr8UkJ0OqGlNcQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.ce0251b5_1544507115608_0.5006399435902962"},"_hasShrinkwrap":false},"0.15.0-alpha.111703cd":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.111703cd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.111703cd","dist":{"shasum":"22417c93b87fddb916253ba0e9051a0a71ad5651","integrity":"sha512-1MDpsFq4lZRiNpteRyECZtru6RiGy+yydHILEwEbIIBMLv/JvZHA6foMA28WFG5cDsVsVbYoxzBCC2OJLWULAA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.111703cd.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcD1GtCRA9TVsSAnZWagAADpEQAJD4R95hCRvKkj+n3q0t\nMtx7/vYhHRNDbxyVv0dx6/RjXFyKynen9T5L7TQSrDJxczfDtrQgXoOaeTsW\n5GWn7RRUwcScQdedIduN17htdQ19fbY60PxhLnQu6Mk8TcJaE+VST0BAJSkP\nGlKuyVh0fI9weZzwJofPrU+qAcVapSmP3O8IR7klZryqdPHIXcIj6I/9fNi+\n7UbRZjbLhbtl5a02MN++sHw7QOEXDa2gURz781pDvu77BPe4sjaipaDSjK2C\nch/STT8zrOx8HB+5GzQTQvFrrtUqst2kAzktjbvQhvJ/b28hX56iXHOUzQai\nXUcNyjwWrcrhQsu0r6s85OPX5AnfuuX3AGBbKuDQrA/Io7e1esfUt6s3Sd/J\na0oMUhytLmeYHudyUfYhLbYgH5/JxSOKVZV5tjQcEEzaozLcPghs+moelqMN\nZnDINKjMPmv2ls3EQMezbgIWT3ahMKZHefL0urTFRzrhxyKkF3h96mOmY056\nuWCOHJcfcjCP8Dd1799ZqAISu18fEeNbo81NqUzjYjLWaO189jvvhA4lPWPD\n10ZDZYBScvCzptDg2DtcxEY2ww+MacHTQarfHNZWEuTRza6vvBn+avBDLSDo\ne1KPx2MxHtqmZiN0uoa8wi4V7zfZNGOzQL905y7y4DVZ4Jv9dX4JRQBxYIvF\nT3vO\r\n=7mOu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpMMTcJWAnqrE13bnaRLoF8xXVLWfndK0xy9RW+Nl7kgIhAPMwc7fIRSm/br3yU8GKRnB+VUA0tNnL9R9jmgTvJ6Bg"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.111703cd_1544507819010_0.9827597176279113"},"_hasShrinkwrap":false},"0.15.0-alpha.f93e3cb9":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.f93e3cb9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.f93e3cb9","dist":{"shasum":"bcc29d586f830ac139c27679683acac1411073bb","integrity":"sha512-lu48mNVDtdyeCNgRJyZwYhtKW8c1COuBiF/xsh10Lv5hcgb65L0jrwIbIeMzDTjuhBJ/L9O+rJAJcRATaaSNZw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.f93e3cb9.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcD1OjCRA9TVsSAnZWagAADNcQAI8RypjO91m09t5zCMZC\nisWLJQ+3ZKpic+aRfCMTKqiN1CwuNrHdNWn0PS8N7+m4SBPJ1ZW/TEGi3lgB\nfpDAjUNLSXe8Wjycn3Lf/e4TMPvG4858XHdU6wFsoXl4BTUzwhwHY2zc5lOz\n3ptIFvg/snyROb5ZLFn7kV7Jc7YtaqebquqFZxqMp5lvJHDEfUNDfXEloMlX\nIpZGORYPcFnIuBaOoXezGWA2+fYEQoTRwAh9n/Ga3P+HDzZUqAoEhK9PpM6E\ntQkt0jcjSPdu2201dyan1wXYVtdbrseHxs4vyQiWahGm+70YNHxZi3BTJZu+\nXjyLDEWli2Ij031p/01h/WDY8tcdmMlJ4+W21JPDJvLUcrQZHDBfSxZBDqiW\no3vTnMo3IEcil2fgHF0HVQTIaC6txyaAkMmHJiQ39LZE0pYq+CjmOjGT/oSY\nf8IIIwrKjXv8a6JOsvaLRSqL+I77JLNMtMtfy1GOeGGNNOsrTE9DlSAyzv08\nPpXHD+xaELGIcApfJDC1PG4NClt/HbRKPFZ6GC5ULXrnv3bfotT0Fq8REPN1\n+28csq82D+T16yWsMwDbnptFDBggObS7gW2B3BJxYCo50Qp1mluMWPEXJkTG\ncuEvfYGEmvnKutkCc3ac+Thqg61ra4K5KPEyp6j4qo5UUKGKDA9FV7ZkdtJQ\nP9ry\r\n=ydgX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA9EBPhEaI3XmWfZSGicrdnyOU5YjXnFyeIBRhBGs8U8AiEAn7B/SM0OO1ZOnvNBs1Zl2sZaABtMW4herjuejbWqPaE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.f93e3cb9_1544508322465_0.7416332444611746"},"_hasShrinkwrap":false},"0.15.0-alpha.0af3a297":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.0af3a297","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.0af3a297","dist":{"shasum":"71988d05bde64303c542f6d3e3834b520e9d60b7","integrity":"sha512-AvlQWHkQpAevzceTlwib6elLnpk9wK+GQ1QLsklYhTBpsPqRQGclMvlY3dtNUckuCebQdwtkX3Mq9lPNc6wu4A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.0af3a297.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcD2q9CRA9TVsSAnZWagAAMusP+werQu33aOAPj2UXlG7M\nLC5D6vP+nuced/YmF4ahmLqJB/VJhC+Zy0N71rn45V8zKzMUdcIc4CwnvIj1\nEdPlQ68ko5z+h00xQlSqvI08HHOY2gyjLu3OBeGaP3eUg/IZo4fKQIzhX+1g\nifvWy+Bt3LyF1INx8ZDWVUNRu0QZ/83vX55COjbqMyftBSl0dPR5btLPnRxA\nHJd+YOug5P6ERt0o6b/2bGTplRDM11wdjBKvW+h/7okzk8EIGzNip1XiZTyq\n9u1go39mYZD52hgw/EvwSJhVfTGRvUq6v9m1jsjmpzR3Vk8drtN9OwaNlzjz\ncb6H7HPGLAhejMRzITItQcebMmJy9G7lC/Bp3tuYu2Z2ZWuHAGPUHnJCg6oH\nR4R17bC/apJO5tkDI45pbKHyYZF62Rp8i7CURHYTwyeWXmA4h8/1YGgOEbBa\ny8fJNa58wy46xzdevgV69Z01DN9i20q0yVTFN3XSZCEM728vHHJ+BgNlmDoV\nVf8+EvHYID90g9S0ZRTB29uC7hstMn5+lVO88XNOIJ1khUXF5mWY5pLiXmPY\npIrrI1aRMPYhlGOAoOPEBUfEi6Jxk4UvmvYwwUyLwaCsGiHzyo12vM3ERfXg\n2MAHEVuGC94VNdLSal4OqR1pJZH0v6rngnEiqJuozTsDZF6Gq4Ha4UAyv8td\nutHv\r\n=5gZa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCaxNt7c7jPyKQdh3UtiIzdCLwdlTP9Zu7+r9WdBK/PPwIhAM3o+1EkzU2q0vVMgn4BcDnEW8o0s5DpvpJ+u94xnu2f"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.0af3a297_1544514236967_0.8848432226045282"},"_hasShrinkwrap":false},"0.15.0-alpha.67d9af94":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.67d9af94","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.67d9af94","dist":{"shasum":"7b7ac7c617d57789719714ffaaf1a1fbc9d44a77","integrity":"sha512-jmzD2uNi82UuNyEXqTs1nDCF2etIkPlDpnZkSsPt14HpR7LbFMfRqhD4RZn/eU2UJmopgtetCx/szXYHmxYiLA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.67d9af94.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcD3TJCRA9TVsSAnZWagAAGesQAKM7Ro0EeuH2n1IQy1Fh\nMqCVjNi+VIgbwzja5TzfRlqTRR0yJk8hmkFsYOJeBEY5yPMv9OQqz6k+GVwV\nN96SdTrWkFbSxHLwrAxI3OpOym5u+MEW7oliuV+t56LOQppGFIIZYA9/vgvA\nZ9zpQXkyjAwEEK+auZKF8u306TafJkz9k9YG+Ed6Mi/pi37/HCvxFdDn2Hxs\nQY3HfRiR3VRn3RC2SE7V8uYXS9E37Lch68EJzJHlZ93J6pt0GKTaGbHsKSDM\nCtBVgWVhiQaIDBPE7d8WnNLvlT78VKsNeDFg5zS1SZtvyguT3vSHbd62JDk4\nuDbDF6TFjd2uHGf490usaO6n7jEHzmkC8nZUstOfqNh2s3PP5AnnkZgeD77C\nfHxHeHdTurF/C22casZjn36Y7W3sb5OeUPMGlkQQwfgxQ0cBpEZ2JHhf4o4N\nDwHXIkLMuv7gPCv2j/K8Np7ZJ51XzUpVezpCBRe2FW4nmky9l+zkRXD0njQU\nYs8O3TsVHdgV8zblkjz2DGtoMayT/oMC5c9giFo7LmRVSrAFLzANUgHayWmX\n0Ihj0vrwhkql+Sgx85La5DXWAysGqtBoxrjQjra0kg99kSl8qlzjHbgLluWP\nQTq4XZsQykr0MsOxwU1cnlrtiGOLM2weGtFQ6oL7H3nYFSj4zqAdpYrgj1r/\nfM9Q\r\n=Ohk8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDx9BHq/qJ84fyx13uZCy2i81oLhyfpug1fjagV8TYFkQIhAImleTLSSk4u1PGaz099pRDE3GbiNukciU1Olb0Kp3RB"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.67d9af94_1544516808386_0.19834289225405333"},"_hasShrinkwrap":false},"0.15.0-alpha.2ba9efea":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.2ba9efea","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.2ba9efea","dist":{"shasum":"2d99db5247153ddbe2219bd45e232f06705a27c2","integrity":"sha512-Y2SSzz70T6OxJ9BuL0uSzcv2XO5KFmoPjYAI7A7yxaJ/GgWS4tl1MV47xZKW2nbjhB0xQGQbB9GzqwZFXsarYg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.2ba9efea.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcD3rDCRA9TVsSAnZWagAAgQwP/Ancb+X6+7sl1OCQ6qGq\noJJz6715A6fv26h7nm1GKqT+G2ETst+ywhGHj59ZZ8kTBh1rQLuLCEBEBQNe\nA/uYM5AFRkMwkzWlH8bCihKGRhDSIPrCaeoOotIF3ILBYzP/TE5+1gxGtwod\nhrsHq1ofxIabG/fvZRX400zmyGlQj4WUZN1hSstXmuUm3neLWzSEFBmL2VU7\noEkr3DDZ3nbsT+47A5FM1F3LjU7R3iGyon36QLcS1HGm59XTC9HO5bf76VEz\nPycXzXGDRVWf+Xb5vEGVPjZdPB6TqYJf7ObyU1ftYnrxyJ0PfIXlztublfYe\n0DJf1eVQsFRBBJbEphJvK3NzsSJF++rqZo8gLd3CCqjag/L116ESSjuoGLx4\nLNHv+0I9ndkipKGlCZc6juVcDLBf8A43i8nl7a327cCWIU9Ur9CbymKu7XqD\nopa06GJC2H3UBfLLGKaqdmKSw4nHZQbkapazOwZW2TN1n6FiRfoXskFIlz9+\nvFuy5UbaqUpnbIMDfoiTtzcK+fZ/Zt1eahbdfOsPUVixhmbApOdImPrQ1OPr\nmMocONavoAcPIz2RYJUX76IM1ljWOtm8VPxPvMtJtfRUC0wd5r0UZZDfQkbu\nNM723ss1O0eoRMeJRmc1Q+QNG7PdjjlaiBvn+2cPx/krn3pfj+uV2tvjvk4E\nezsz\r\n=npzm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCo+GTsj9A8xIN9xU5vANq1vhGmhC126wzM5gGjC1wP0gIhAPwX3Ejav0wIF56B3XSUKnrbOXoTlxM3J5y6KbUMGeyJ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.2ba9efea_1544518338731_0.354775871053977"},"_hasShrinkwrap":false},"0.15.0-alpha.99a01e25":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.99a01e25","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.99a01e25","dist":{"shasum":"dce4e4959f73b2bb7d2bfa1ff2a341c6cef6c1c1","integrity":"sha512-LJXdBp6428f2TQW21BxNPKSdN3Ql1cOrswI9JCa1yBsIcpj/01XW5cdMQlZ9Y59LLWA7S9W9Zkvg4CIFshDsuA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.99a01e25.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcD3vJCRA9TVsSAnZWagAA/u4P/31taYo437vxWnwwghSu\n0Mi0PWt7ryhsDeGmHRn8wVvM9wX4uzacrS/bYktrj2jEq8Qt/PtBbbc8H1Sy\npenqupw++HpvijtvYfrBBNrLGYO7cLCCONGDnsNoFmcpzkav5vaGu8tiYwkh\nhYzZXm1Z5RUb3Fthfzll33BZIuhF9B7zsICdJzXdZyZ5m3oj30PHUMCNBHNB\nvN+PgLpHahUL+LFJMWzJSsmrcyVPA66gBjp/H9CsgD/ncpekgI3D+wDrj+3Y\nP1vhUbHN87wafMqNQBz9RnJm+6wJz0BJbEzbdGu/p/laj5gdrfrc+9PrY0Cz\njrJcyL4qapCLUcKH4Z3TWBGz2qXpbboCC8/alt9x1PbTI3MefHkRK7ibt81C\nTR80ChcmkDGQ2wI5pBTvsykGeLJJHZN4N4LN2Wg2sNqMg2ojPl9wdPjb56US\n5563NNeQj7hexg9rUGav01aCcgHy1njxioCb+oK7QVW9xLRWzhzBEGtU+u2a\nt30J1xhyfuQle4GYLI9f8sbLyB9iTkpCWwXf+VtYGI8QyOMAFbIi/5HpMIe7\nqckfKwEqc/HvAEU5/AN79XPThFei2czHF4cVEacImtnYFcBf/KDi9CsCTLL1\n+bx7oKEyWIJjD6ZmqsPVG9tOkFjIk2FsIkScDxfXf5u7CnohFNw+ZTRIs3or\ntPW8\r\n=RBeo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGrsguk+xtWZvg5YOjt8HHXyEFdz4OXhXmkN9h4Ap6N6AiEAnx6SZs6H8pev9WunEtH6OxL6uEU6AZV3jAB7z4dUFhg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.99a01e25_1544518600336_0.7638119551208462"},"_hasShrinkwrap":false},"0.15.0-alpha.e2748564":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.e2748564","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"0.5.1","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.e2748564","dist":{"shasum":"f5f3c46911d33e788c91f0c2b1fd840f0596b74e","integrity":"sha512-YVSJIceP+GqzT9Ozl+63VUrO+3aBzgKtgLhV9sUyauSDj4nq1fdKJP9UNO9cLhKOZ5K6fLLAc3wC4gd4H2vyfw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.e2748564.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcD4TsCRA9TVsSAnZWagAAzaIP/A4M8OuyzGtv2p+BtSbU\napAL7wXtPvKjOV0u2YJHN0ue8BANEvbHOKHBN2Two3p8CWR62eegvKCNMb6v\nQm0scLs8a8XUmrzoK5zOsRSEvKt414HHk4DkmpGed+OlRGVNJ7iAF6RWiRo1\nkc1p/yRskHU0Uisngc6gekMmYGoyECgxxIFQ3JmAa1zQSE9zI1/qixJY9uoN\nPx6Gzlo+icvtdRZIAc43VVB8NKgLqU/xeOCgld74I06brENBR9ywJ7BhJE+g\nxbpgc2O9b8aMSiaMqC8Pr3q9LZt7r4kkL40qhtJD2efenOMvIlYhv6SBDJCJ\nqM+QV7ILK6ekJNVFgyoYXqRYmPuxBfrwDV8gGhC8FN5HTuqE1FAFoEpB18C1\nEf5rqh5dw0sSZCGieTJyJbqb6w9pZeKF+P2rrCDqc9/03fKIAVmM8SJN7Xb8\nTEXo/a5kbG7QtrkoVct8pybPvhHpuUOKSAeSHGgABSTsiGluWlqOv/HPs4pU\n9ATHYcDDBi4re/q5LO7Nftst23gut/xPb6971QgLIVltOlgAgltZ8nPzJLCp\niDBCgiLx77IsIfgFja5myS7D/N7Mka4syQ6owo1ioY/d2bOnbwdMWPtP57cC\n4eG3u2fCLSN6ueJK8vqXai/R88kkstPc+eXnQBZi+C6EejbMLgz6aDf3TT1/\nEP83\r\n=C/Ky\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGiPpbX8JBCLYms26QhAXg/EJLVONXZBYG/7Np9+8bOIAiEApuetJ9GJ3sRK+fzU7wkSTJLM0aU4meZOU5e6dYqcDUI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.e2748564_1544520939410_0.36128423017766487"},"_hasShrinkwrap":false},"0.15.0-alpha.8882ec99":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.8882ec99","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.8882ec99","dist":{"shasum":"0f024df88192ec386c22157b3b3a888eaa17639b","integrity":"sha512-kMDMa+/rboFiGvrra4zT4L4vA2IWWt21H+S1p0CjAqXtI7Powy9oYQiwu6j+esbbKu+H6mWGe7Q9An8K8mSgBw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.8882ec99.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcD/n5CRA9TVsSAnZWagAAHeEP/AjCSMzTtgByjjznxgrY\nVZ3YzrI/xJiWt1TjEGAWbbiGXO89P3n+60tg+RSZHAj7FpfVr0DTzISwrWl7\navdpwiAYx8aZeVYDpU0k+s/NJ515XdvKfroMqly1O182nyEXV4W66nKgmOw4\nJqW24g331K6IY9XQ/xe8RrFn6IIpF/5pNtEqA/Dj531GJo3HBJL8wJVvsNZ8\nbZ58S/Jyjuo/H+p1WqZdLXvTjdAWDRxVnU80aLtN8J1My3/mvgSr7BORspe1\n+c6yaA2FGIlaOx7JujyWOc2hQq1LOY+EdXw3MAWdcqcFAKcKq9YHfLbUD+Vl\nQfOLVTkruxNSsZHN7rxc6twncNSyRUbhc4xPGFvDvdjUeJPu+Z99UQP9Pytw\nuWIY93o4l+nwi1tToeas+CaAi/xiN3Z9XbPYkAOhH48ZwFBSqZPKJ7vn1ZRy\nBlDY2TbwACGfZLU8HD6Dc8IAFU6HIFagb7DG6iENkSo9MQd2Lt0Y1lYiwBlV\nikMSUb246zV5bHeukIP5VlT42M456P7FDjOeIMNlGbLPDdC3iQ4qwQN3tOyj\nTwSkzTv/FSh4GKzedb+Eg1x7NSloLlyToA9XqFKeFcUasvgpYzhQhyQDpXFm\n8m4ZI8efGgjC3SM82mwdgchmhcJs1zTmkBI/15wGzNAq8Ui6oT2YWTizrTUq\nPsOw\r\n=QPt6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEdoyfe3njzPOUefO7A6pBLGLDDmK9VFJ65pHBlTgX3QAiEA3fb85TDoIJB4xe2lisfr6JeNrYS9ThqnUO6tjRE7av4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.8882ec99_1544550904331_0.7117812077320542"},"_hasShrinkwrap":false},"0.15.0-alpha.946b0cae":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.946b0cae","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.946b0cae","dist":{"shasum":"c2aa6e67ff8fa321abc4c1c3f6014956f427d623","integrity":"sha512-eEdblihnUF/UxRYgcz88l7CcYb5ndYpH46UNqbgt5lHdFOTF5h0bWh7+9PmQMIUvrlLy7Sx0VaP74U+SCkPlvg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.946b0cae.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEEfeCRA9TVsSAnZWagAAYQ4P/1IdVhYml6O1QvxTU6kn\nHDBxarUJ8Z5rfs87QKfGLsidC2DlpLWboqt5rMvXVXf76YCtJyuUVEvdwjSw\n8p7lqHtEMQwDXzqtxNOMAq8s2Ft6GXRLwFdeD6LSbem+DJZVMV3xpnj71P7u\nUbo6/ojuUIlOP1SVOXFHZE9FUvNeh3zYst7igjcNgnXe+V5A/Uo76L++p2D+\n6g9JM39lS2Nn2H2u//P37KSGmLBlO/NXRI5wUeLXFAF9PrbrzCcSpmrwS7zy\nvDsQkVnAx6v/nffsmw/TdTybZ1twlwSwrPoFtwBhvqXj9qQYm5NuBwFCbuwH\nX98Kxmt56f+1XctmQwFbGBEy2O7lNBcW5i4c2JsBvrtP6NeW26LHnin1RjJW\nDQMtS/Ja9NcwKMG2MW0RFSk0ZI2FokTzWO2+EZdxzcrdzgZcW80r9zIBdgZy\nlCj5iIDcV6gud7WRaGRa8+G3QqHnuMuClRom1/ENGRWL9+EsXJ/DVI7/bNco\n1kGc38bcCiU/R2woyKr+cULV4K5icQMclEIvziNXPmUk/BGD3Ib8S8Z5r1AH\ntJEZPQoDuIba1i+Zz7Q8T5+uwuzigIJEtVGMyGRKyyi0Cot+Gao9vej6hSVG\n2bberRzztEmGxuB9EiUrpUJmP8yYIwYBsXCbRl908LV0ZczcEP9XduTSbNGt\nxga4\r\n=EaL+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQO9jRI9iG1UYi310VxWQnyVhRctA3z4SenUUVHkk/hQIhANc4Pz5qop75xNMoul098KyoUm/tWMsy4S4P08+hy0yQ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.946b0cae_1544570845902_0.8884263503808043"},"_hasShrinkwrap":false},"0.15.0-alpha.d63bbc07":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.d63bbc07","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.d63bbc07","dist":{"shasum":"c9a65021d0ec1c5f0d1fc9bb4ebecb097c75be40","integrity":"sha512-cDVylR/l6DcbH2TvJCDSyI7xmjxw8nmojjGEyQdHsnIw2RmKXeZdaagk+NtFJv85ITZV9ZXfcfB9rjS38vOAXw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.d63bbc07.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEE2HCRA9TVsSAnZWagAA2OQQAJ3WSliYSbZTS786t9Dg\nKjUrFm/4qsu6srwpGE3u+51O+jz2bJFtA38AuYg6cHZePLmoEouNu860qrZx\nzrj8MT2zD+pjs5l4W8QKyhxJFW5yFSH0OzGKBWXqZ5HK7yEXyC1T9IvHAFuX\nBOnnm9+bCcCqjyMO4u3Dudqwvi1DwNhN9++M7KtbYwzk6leUPSAIrsjpcpGT\nWNxskwMaUDZSBtVuton92lRS/0/t6zaNBxaqZBwhICSPizYJs95Vh1dYs/Uh\nPDCDnxLeAHLF8qT5iG1l5S6ehZAnn0ovSomkPX35kiUHTvGfTxGEro+iueR/\nx8lzDmPpVu3Lm0KgyKXTXssoxzPq/FxvBazAAnBd/ZhMl4sPSYm+93uuAADv\nuIvn0FENfcF77MEQusKNKLTGmym2HEmG4xif7cbd+dZEzjrPAfFm6Zj2a0MN\ns0PC2k+GR4hUj/W77NE1X5NyKGH8yzoLK6+nVTg3ZX1C6576ZV+lukmqOICv\nbheRk87cBA5aAK7enQs7W81wmbwBo9JN2mTnW3tGeIPm+smOr/Jg7uRh+pAb\nQQ92eMZiEk1mgDsodOSEx/ojdCtdaiHHSWpxwntiS+T0bZXJ6jbEkjf9Dofz\n7zUL14vO+tWvPdAEygqexMRm91jmKH7gzXGTxHIyqCVT8mXyRtSOiAoXwZJp\nygfV\r\n=wyAg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDM9ve7Y61envlUiSf8742HJr56WAwbIAkRoMxGv363PgIhALTiNdOKQyJizUZHW8k2jyWAuLcWlVMt1ntn86s9vxxr"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.d63bbc07_1544572294976_0.6636754203391706"},"_hasShrinkwrap":false},"0.15.0-alpha.1e95b59f":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.1e95b59f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.1e95b59f","dist":{"shasum":"465289fbbe9d797d115b91e2aa0ed13a9310674d","integrity":"sha512-QgwdSo5Fi7wnifcqW8u6wtWSEngyLEklqrX4r5cYnVTnGL9s13dMWm0x99WI9tQiKIvOeCmMQ72r+PC5/RM73Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.1e95b59f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEKW5CRA9TVsSAnZWagAAHHUP/3o3Ib0chFPILJKi4n4b\nZRKkzoC2L+3JyjVkDYo0wkD2Z4OAsMWPDsChIP1OPFrCNp5XjD4zx07BlPK8\nDHVFzimQV5eOTfrrbUAbU7xONPnwwQgmybwQmUm5pb3d7fhFLFRMuf2YNXmY\ngKTyPh+qhPh+rmPHLO8RhcLTuKXjbbeRaBDHeTkFKkOTOqg731M/NN9tZctx\nggETK58ZqqMxwuDm8+5l2ZpFsg81PziStUYeTpaIpjB8VlogUv1b9huEwOiP\nifaknJhmo0yMd+Lr73wBeuP577GpcjURXvh3WkiRl8C2dUrgyvbOMQSf7ASC\nvKutkQ6OiEceyZyPRreMxohXdl0pSChw4GBBA7YQymS5+emF8lxQGhQL3IgF\nb0C15010pQDi1ly0gztIKEs1VNvmPam4i/67vhjQkn1FdDnY9AsnascqxMLu\nD94jfg2QB/LNIHiitZhYDdwu6dt/h6HiQnLECE1TJGL7c5f1T3BqrFjGvNKc\ndlNsdtjlAm4Yw80vvkLQob1UOwUBCvOUoJlI1mDd7m+81GkYqW60Qv1wzCb5\ndrb1/gLaIpMj5zdL+noH/nh9MEUHO4lEhrJSe5QHUJ4JflvORchtx0b4NHWK\nNxpsz8yyCfz5rIEhYJIeOF6FgaaI2VqYKiADRzY0l9pnK9Jj/eviY+zkOFBL\nmnGv\r\n=+zgP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAxWsD9YkJHMFfXZ9BiwTMjdnAdoG8E67z4X/+VgwP8UAiBjrrXdrzwWOa56c2j0fVf7uuVF6RaIc2Up47EGb66jCg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.1e95b59f_1544594872721_0.737613325606588"},"_hasShrinkwrap":false},"0.15.0-alpha.542bfba0":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.542bfba0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.542bfba0","dist":{"shasum":"dae4c6a9fc006eaf3a025f7e430876dc01a44a9f","integrity":"sha512-PhGX+ZaaTf+9vM7/oyfPoSoDmbRUCc+5xHDXCueJ3ZoBTFp9j1wXsNJDKXv7hSO8rE6eOhLPsUYXPmU6Ee2jUw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.542bfba0.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEKXQCRA9TVsSAnZWagAAEBMP/2YUusVszqyCmg6jCrY0\novNGr0XUNAvZTQfaI8ONbPZqL9sa5ClgjN1AeTkbTOFatIzmxIznG6Y7bgBj\nFIfU42yIBqGDwuCbK11qe8G//kASbn6jz0MPEwtKK3l99u2HI6tnLIGkJEnF\nuKY1+Zq3s80QFSedoLguex/jUh6NgDUzvdM/4DZYqJo+Ov5jaLxps5QLS5nv\n6W7ilx+Hu8uz00icPcOHpjPQtLIg0zLWNsFntRzDThod+7DR4jMJoFtZzXxS\nk8EHFXzw7X+hL0OamA3NMk62p43jneBLrvHdQmFqhNTYpYZEQix5mkLFfxVa\nCC/TFdPKa3QHUqwCTCByDBiXRaKomslCWqxip/0d17xo+q+iOUUd4nnauxPG\nungCQbo5st9jEmnZt3+GaDWOkF01cumckj1NEWsFih8f8h1u2hqUgvdfFemd\ndi/RIv4fPRiDpo92R5hdEkllcoPv0H4lqLVAUuFGNvangab/9dQBwTCees8r\nxqnql7Ke6QQVUuGfdAKgrCgThL/ep2R+gSmQbH29wQmFDqXO31SizTgf1dDR\nfPjoVyTGMNVLt+46wC3PoOKQdO0XUFo6drBHThC4IYUIFSB8C3JzRqGYnqKy\nFKpSLptr8dQGWxVS25BHa2fF6RsmWrdx9K4XFKi6EQtKEzysOXl+LYrYa0BS\nGSfT\r\n=pcAN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDJhu91qR7JiE7oK08kXVqgqZhCz1d9lmL3RMdBobO0tAiBSczFL6N25SIg1+k5HNGI6g/MEo8XVjvOAMIWILjFR/Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.542bfba0_1544594895971_0.7765660222388597"},"_hasShrinkwrap":false},"0.15.0-alpha.6d689c5d":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.6d689c5d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.6d689c5d","dist":{"shasum":"15c71abc0bc154be01e9335896876699b29ab4bc","integrity":"sha512-ysHNqlDqyklSi+FbJfMgpo/33cqZaayazijvWTFf5j9mzQUJbQlJs5Yl2939SELt1t8EtYpj2JtoE1PHoJYTrg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.6d689c5d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEKYcCRA9TVsSAnZWagAALH4P+gPtObw159SVqPNIjoR5\nl/eEOybuBKpE7iqT84QNrp9hqGkz870xJlA+rRLjkcBJAxkrM7WuMtr106FL\nvhdgjuPZTyfv37YvbpwD6tVNogScI7t7p2dyLCfCVm4j3q4FxNsMb6q5iBYv\n3uucR3DZUfus+0BNfWG51y1vJ9MTclOVgJHJTCYhPIWbEIqZEyQCniHbyIWw\nQWPtn3pfu+o6VmQ3Nc//cOvBz97nOZ1CDvo+xQ9YK6R1fmffMhRVCmJ60rSR\nnQ4RYNm9cgdUv5Mt+I5grTQZqR7YzlatOrmlOHFG7nkwUkQ0fj/tvHFQ8yQK\nvn9qGI2Dkgnjim0qjYBQnF4I0n3aCnjkA9SqY6ZqGTah2Tq597bsD9js2kf/\n9pfyP0nmCZS3WGa9eszicm9PeSQQ9KkrGPOI169gDrBIf2LibGnsr/GC6OvG\nQ5OmJzQPWowFpQFQto3D7xP/wDw+32szSMMVMAHa+bN/e0E+g2ogtdW0g/wA\nxqYrUl7dswNy1ijPjRPBCGs+is/KibArlTMwW3HnL5AQzw5fakSs6a2b1vww\nPMngo6lvSZsuxEOTdbF8ha1i0pDkdPzrNErW9gIe/FoCDCmVeDFi0JeatfV0\ngDXdK4c9dCO7c31r6gLfti9E+Gnlz9nESL67S1xHNQwTiDRV4enV6PMyta75\nx/LD\r\n=f6ul\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCapZysTa+SB4CmU2W0SuI+Bfhp6w9zOFAnEc8UpwMmmwIhAJUuAtq0cCsYa7yShC3w165CuQ2n/8pTdqi/Mu59tFN+"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.6d689c5d_1544594971824_0.1476248369152462"},"_hasShrinkwrap":false},"0.15.0-alpha.e61939c2":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.e61939c2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.e61939c2","dist":{"shasum":"a767887da95d4638c7e83cc1f9b879c188d57eb2","integrity":"sha512-kGjpE+t/WOnOgHar/H30LESC6jz4Py41ghCvNvQRXGxXBleoLC21fvxlWbvSoyAOauB+sr8AMcdoPwyD4yWydQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.e61939c2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEL+iCRA9TVsSAnZWagAArp4P/35nrl7FR3V6QLstCJpf\nu9NqiEkjN/bDeLDHGw3+/EBImHa9NioECUJu+6rRX/SttP2HuOLNbC+u+y7g\nbbvf4+BkOJF2tc1mI4Y95dvdR92IKU1VpCJ+qINIQf9580nH2KMsSqC2VvHO\nRowTpdgDCt+8f1pKkAyA4A5HjowhpI3CgqltCjEHgllXYIFBhUaVsFmI4Tid\nPRtVmT006hhrlD6OZf3/jE8+KVYsC6zNjrTBLW7U/71QIhXqqYrhZcu1Ac11\n6/3JIiXAopY4r4xHrFrG5B1k+GSJnkBfGOJHEzJ1uuN7ALg/dnvPivoVvV7o\nybBRzS69o+DKzhYCaMQgH6SDysFzsTb0QJMYzCwXf9w7rlzmGk9UIBQibdud\nNeTt0tQH6u66x30oxvPy2CttJzPIgEweg9NAIVJNX7/9K/FZwVWo5GAKPWik\n5ug3hK3Cm1ouwesQHLtft7+U8BH4BudOlfs5tKgEOpaWqXNW+E08gbIN8n+i\nWUmDW/V0RuZOdgMRRvLRT7NqJZv2pfkEqNQbc7wdzP9ibXnXj3Nc4PXWVUfp\nvdq8DvRNcE2SwvQL5kxWl0b46unDhEA3ZQJgrWel62wvrEQCNcCngDaOS7z/\ntC2ffceYYWvnU7VqcwC+2FYjuAGK0V7A0RY4WOhF33ZfRfqpZzQgtZPo9dpj\nBm2A\r\n=mA8Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/ExBuKsbLGYvM9OTgT153DhSx2ob7audKdD/iv/PLJwIhALSl7ps0POCZP0GRYCtvd8HMCEqPs1Au0vPHyu+7bnfE"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.e61939c2_1544601505395_0.5749927691541741"},"_hasShrinkwrap":false},"0.15.0-alpha.4d42c0eb":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.4d42c0eb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.4d42c0eb","dist":{"shasum":"cd0834c296ea218d89d764839259126e3657da6c","integrity":"sha512-5FK+68sOAJfEKRnR3q6h/YnA+XIOCorsORT/y9McPtUYeMoSWzEHeQJ60eI12O1F8n5UmZwEt4Q+6fASZMZHuA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.4d42c0eb.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEOLSCRA9TVsSAnZWagAAXJ4P/0cRI55ZHxwImWxoD3ZM\nyTa11G2UopkaMh/HHKZoL/Lg/WUPjWbZVnIWpGBU3tnmUkuF8Vl5rzFQNqKH\nqE1qjvLzPhDwO0QXfOr4mM+ELhATFjejZBVdr2vPY9UBfoYFnA8rjjzdy4CC\njQvSicDR7mw101vAwTQhqF3r1pB37TBIrN9MrkP7dN1rvri1ExEIe1Ydh//h\nOmX94RHcsPBxgVaG3e5cRen1HZg+r30d6OBdDO+BBS1SEJq2+dXjhtcml27L\n7m2ryhT5P61cRkvBnD+cXvXiwNqrtBd7nmaRtOMwPZqscPDnxb9Pe7BwsMhN\nXX3wdXd9HKXpctaAQ+ymD0D1XPmjbioKpqjLdtGhsYzeB3HhfsdKm8pTn0H3\nnDp6lRNxu1jXB8WTkNP+oQpM0NLJZ2TPX1kRwWQcnV7ToLXqSvuwVdyf3LCV\nP+RJqFC7c9YxcMRvaQNWsAkOyW34PelzScvW8Ywami6eQm86QCyp6Ke34lJZ\nx/uZ02TUAbI6LW4khrNGFtaJTPe1jNK3nWm93OWrHq0ktWko28RpLpcoOuCp\n5ZCjtwAztouB0Q5kcwxknSRZ3jlZJuB3dgEpEY/2hGieWwzb3BJ96/giVx7/\ni8dipTREWLBG0/NqebJRNVtKy9Dl0jwNghOtRjhdCqUTX7BP4wKp05tjfRd0\n5amz\r\n=DJtf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4wfJQMsW2EWvjgi3hma14L075yGlBLFJpZrkSYwUTkwIhAKGaPVdSF4Gha9eBt0FGM9MLIfv0cJlGzOZAv+ZeLo7f"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.4d42c0eb_1544610513914_0.11009194285554491"},"_hasShrinkwrap":false},"0.15.0-alpha.20527e33":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.20527e33","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.20527e33","dist":{"shasum":"d66e75b8bd482b2e8b33ee63418249d6857173ca","integrity":"sha512-+m7WN2NociBNO94be4T41fjkZ/6uW+VewNv00O6IoWO5x8J+flJMWkOTjsjQlz2TTPGLbE3Xv1QYMJ5kNKwvIg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.20527e33.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEP8qCRA9TVsSAnZWagAAYO0P/A2fXyAlS/4+zqRamjHW\n6UvIIdRYCirRmpBDZj8yENeoN9BhLH1ZeruiROeSO2gpOOjrxWeTfX0NHq6Z\nyNyoxCdt0yyJ/UogzysyNV4EniveC3vIGaZCPafQM0/5nccq5in1YBbZGIEQ\nJnu13i7GMF/eRXCWEVDNNchAR9bA/rMpA7PLIaoGlP6KuRkZH7hCf/QaaX46\naXRzSuG5kGf1GHjJHKLf85kUZs3HbUU+7k0klo428sriZkc0FAsTaF+KKGXc\n1RoFIwSm0rg/2jI6FAHwJ3jzJo2Dh2d+wcIH9L6QlOYZlYwK4QxVJeQt26CN\no53x269H0+ldAeKAchEhgTQHvnZatyBKFLMCWsHG739akwNIdxSynu1Y4vJC\nvINbLbCqEubdzwPughPFx/dyfJW8j+ngsD5Y+l8amkCdM2l6mghAXRgZiRp4\nrhz4iLJogWRFLzQLofywQ5JjOUsF4qblyvpUqTP1fV+rtLhiSmqnLOwpsCbg\ntWAswL8uohccKBkwu+J4sVDGNhDGdjn9hxhr+oDY7mlZK0eA/3EPWImMc6dA\nCsJ9hsbaNeyvpFK/pF30AcmvtW7Gr9DAob2c/MRzi0HVwof9h+qrG+Lly15f\nra/kQcsmj3bgQnXOzOFcVCa92bNrZAyGG1jxXnJGn371hLmrD1hRGRWo3znh\nzIe/\r\n=Jl3a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAu4eyeUIDWW+qgNhWD+PQzrvj6BFlCv1HdmwQe1kUUIAiBHSA/A91ebxIvzt975ShnauOLn6LYeuMPO3jpOi2Spxg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.20527e33_1544617770028_0.8926592760877046"},"_hasShrinkwrap":false},"0.15.0-alpha.0520a5c7":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.0520a5c7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.0520a5c7","dist":{"shasum":"e46bf68871c1942ec2efcd60140105da57a6ad6d","integrity":"sha512-lXjg/f1Qkq49LEJDrl+ApPa5RkYxers1Zzz4J1RWQMz4qXuERzpvJV27G0H4r9W1GwUv4wIqImPG6lVpY9zSTA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.0520a5c7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcESk5CRA9TVsSAnZWagAAEzUQAIatfvWo7LkkUZeziXzL\nwfEZrKyFiWYZWrVxLHDtPt3YDu9/vrkKYyKMvV6IYvefnwjXUZ9qxLwukRIf\nOZyEmrVUYm1QoVJJot7QjpLYRmVy9wyjbvvp/SuUvfD6JNmN0xWfmRl/mjM5\n/zNEXWeByjXDeqI18tblGfuTVADmv0qgG4PsYA1NVMz+jFTQMup+wYRhh7ks\nMdoDdj4FzLqXxdL+r8Ld3BrCHnFVhd8dnzt4D2IX+OMGhV4DnVm6vNGcQYW6\nEzqsZrGhExpTKg5AD5C1vvMt0ZOZ9iEWz4FDaqXvWUhtY+mSYMp/k9FlkUUv\noq6YAVxmlNSC9Ai9H/L4LOfcgCahaWnbkOVybKvOGAqnTzXl7O2nBcDTbbwv\n5i83MwIHyTeoQYJuA8Dja0JrXHQD7N4xyjAS5l8G4b6OVF1bnxEpHnVX1ajn\nDVEK3hk+uIgFZN3MOMcJiRgf/cRapZhslCYCL6JxvEvRWgCE88wlXrvsSuCZ\n/lI1fLIViEegRD7bYiH7vvA63DGgMs796hLCGUmrf+rzIl1ZzAlFHq5NcttP\ncxMyDJk1FVr32Ff+x43R5QYJ5KgWHREnAGxWDVbT1DFvZjetON1gHU7qfRiH\nLFyDo9Sjm7eIRkjoCIOkpqViuJ97WZ/lVN5LygBOvv0uY38lI5Wnq5DVH+a0\nezwQ\r\n=ndhN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLf8ytci5wvtGsfksue33MtfHdNdgg3pMwmu1Tmt0yuAIhAIpTlcqP4aV9It9xlQz5ndJMeAmFVkijtqxDUVGDTxkj"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.0520a5c7_1544628537187_0.8954562200164689"},"_hasShrinkwrap":false},"0.15.0-alpha.9a433312":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.9a433312","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.9a433312","dist":{"shasum":"4d99e52dd2421d15a226eee1bf99aeff2c7aa7d5","integrity":"sha512-DZtRMT5rWO6u4/q0ysDK97TfNfC8BwUXzn6O3t892GxfBIbhKSG7tesUCPXIKTJFkEWDMZfOr5ylKHMX9ESxxg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.9a433312.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcES2ECRA9TVsSAnZWagAAZm4QAJJ+EwaVJ/K5XCEoldjN\nBGtwxoDmVtQFY+fxAKw+OFIMz78zbTotklNLklPrmOUg6Ecw1fwBSjMoc8kG\nXpxbTC8mK66+Z/EFV0v0E09ibJOastSOGvlUgoCuOdt7MQCVZjyd3n83PR6k\nuOikSDdxsXFBKXjBuI5M4ivuWgu0ncPH8Ib//QlcvoZiiUf3SFlaWsYDQjl9\nzHKXeIjs3En5uJlmMzzH12ES9k5XEcMkZ+m+PxfKgzZh/IQkblTenbE0MOvF\nXRxSirkBaCI1xglCqy8WCTcDZIZ0tJiiQw6tQ4mRsZbSQMVPuD0ySOLXtWz3\nDH/u+h6BhCYkY7GuKEQ6bv492XUdEft+MOQDupJsVUnWRzBk3jmhtsbxFlrR\nqMkV/1aj5Vp1ZPO1GF++6J0WpfxWmRAQYGcCbnPrMc1L4gsFzcNTJvlkBXYj\nFlh5jGUYRvm7A4afdTMDa1mIYsMDrDeK3U/3mdWeHaW9wbo//Ap8fc30e8fA\n4MKpthGA1bt4PkyKMg49yhc6AIpWY7Zn41J3gl4R3vGnhZfqJ1yXKrDR1oue\nvzz5D7eLyJMkKXE1H24m5hcjTeyue6gT/aIILGGqB4U9rJvgf+KXoX5oAZAo\nsaXveHPhRwg5BeO0w8MiBXPNavMPyGvgogfmyzvKrq7cnahwsakJGedUf5dz\nvriR\r\n=Prm7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmzVY5V5idnmQFB5XzgNkMJjlhuBbW/2fDzL6aAyCjYQIgNfd9nQdw1+yM81pF63tNSIPn6Cb9lg7sGTetUsZVLgY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.9a433312_1544629635821_0.8846823510163702"},"_hasShrinkwrap":false},"0.15.0-alpha.f580424d":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.f580424d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.f580424d","dist":{"shasum":"9d85ec90a2de5266c3c15a136168e88c74ec3a29","integrity":"sha512-Smm553b5gOU9Z3UWfdAbIc1P9B5TmDMo9RfrdYRdzq3FCkYn8hgDw9hYePT/IRUY4QxPvjZGc84e/XC6SFdI4A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.f580424d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcES6tCRA9TVsSAnZWagAA41AP/0LF2LI3uAioVot98Mda\ncInfwR9upLIvY9cW/2cuZRacStjR0wc2juTPHc29N/5s6KdJOi85voZW7/2c\nojaUvkbddYXy76VyOE4HkbV0k3gqnASr1q3vxP9RiRQ1Ij+VYxB1oeBElk1b\nsQnY6qA+8Cr+nIwmJEUZl8Am9LlUA4WxB1J58cfeac8/YU/rFgERbm43MT3O\n/IhReXIpPP9qkW8wp2gy6+e1ISLoSxm7hTkU811+JJ925ekrwRzjI5acz+Q1\nbcsSnlwZGobwF19vQvL0hp6BPBQkhWMCSjRKlPsD6vEP8/xOTIy9gKm5QKrV\nvwEo5QPUqhh7TMFfr0f4HSQE9F8w0BNhtPydodCNCGfzwT8AUfaR6Ye/Brw9\nBVmYd5fxkzAe5biIdMKNfUl+ubiHCvZpNsSJH1ekmmbc2k0Od/8eWAJeqbgY\n0WnYYmViaZoq3fbP8n63RSnGUviKdmynbQWAfU1IWCcReRHNp5HxARcLp8C8\nQ3IqiDp6yj6zUuH5Uk+25mJMs36VKT2Z4MfZsI64GQIE9qrh4K4cYK+fiGkF\nizce0/5I+btJfkxVIhLvFhaBrjdSUBpKWg6aDIePgPR09GgmVOo1jjdWnCs0\nEbZ3i10WdfweOupHtFKYHiFpDyl1nfvD/Wp9Y6IpVqlEpXGGQzQ34P4lqKwV\nfhs/\r\n=mYH+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmZoARGuyR5GCQ7hC5XIR2BsDrFb7eqeMTaqV6kqgrIwIgKrzmwpzDe7PHbubD6DuW7hUscNdR4/p978oBD6qv930="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.f580424d_1544629932634_0.6456042748197777"},"_hasShrinkwrap":false},"0.15.0-alpha.517a0b14":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.517a0b14","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.517a0b14","dist":{"shasum":"29ba5b44fe8f41689a95a1f0b786f463f4a2525b","integrity":"sha512-UPff4juRIvBjCtAP5Cr0wbx2i0zKYDboVV1mOfRtwTzi7yRPDBz2W/BrtqI0wToyX0uuUBhRH3t5OBPGHOD6GQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.517a0b14.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcETVCCRA9TVsSAnZWagAAbt4P/2g5Ua4a4vmYZgiwJtvC\nF62MelXH4Koo0BoH8RgFEyuavn7omSIqFr2fzEHWdVAqWxULxpIN2Bg/nfdd\nYPAHsdxbDgo7l3Yw0VmUIfK3q/ibBYQnOad95ouWf4OxtP+7EG66DanYZb0/\nMZ0NFO4tabrNupaTPqJEHCkcaFFPUgUWHpcNmoaWJYLISPTbdYR6lBmiHXtO\nil9YOncP2g3xjmrEFud5rsyhG5IRxdQujXDBwdfuojv7l7yWqFsz2Kz9sOV0\ntSfgQgBsH5DV4VW3TwbjjYzVZYhwifrMifwa1AoFAT7vpz5aUNzI0emnIxpJ\nqqTSODu99apEUB+6yInMfUh/KIE8priXAWCOp1jZh3u/IrhbHwym/8cXzQFo\nry4ZjrkjAcjGIMZQLPCM+4FK7mzW2+gJd5yMY/pZZzvaeOb85MrxAChfhs4l\nk8nEitSD7yxwTIsxC2Vw2GSNAu05WS8Cf1BeIkEXRDEIssofsBZ3EywvbyoY\nC5MylvF3YGHaTL/dZ+5Lb+mp2tNZ/Ilb1VV6Dx6dfAHVjhTrlFvx9tp1HNYI\n0YY54jyvMEpLbboMtCtXkSTeHM/x52DcED7aipzXA5+Uh7PuJQR25TqX76t/\nCRsvsy5Ys65RjJcgKJ8Gc/kkx9v/s8oOSZaGSaJrY312O1mZNYnEGkhot220\nBlbc\r\n=eCPH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICGoUdtrVSC0eXEz+d9N6poWLoXJ6SSQ5mwItoBMskz6AiBRQBNbTs9+kcIWIDDAeJBFmDg9WyDPiWjFcqZag1qK8g=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.517a0b14_1544631617819_0.8194920812858459"},"_hasShrinkwrap":false},"0.15.0-alpha.d5fee644":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.d5fee644","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.d5fee644","dist":{"shasum":"8f627dae24bd1e0f0ba62d11e7dadc4edfdfa116","integrity":"sha512-O0/ooZddmeVn0PiuieY/BRrchc9shTvSmxw8qq9C0wwelWOxFiBFHyouu3nQrR7lv+m30N8JqzEycnUStCn5Tw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.d5fee644.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEThXCRA9TVsSAnZWagAA7sMP/1YpjL7RQWNWBjizLPwO\n1iZxg3mc956O3r7uEW28m/OCb/x49PQENGUv77zZFz7qmSd0z15+ADmM/mSG\n9MxrfyOCJzPFQhLZT5Mf/HF/BT1Mc6/IrII0MZeOMOwGqAEnA6DUZlu2ZJYM\nlg8RYacpibn3aUivLoZVyCUucVSkZMjaDgKrbCxRlvRxCer8a44bnNF81pO2\nAH5T1xArho7zmHDdNHRvW71vmtevdZIjm7trQC53DFy1SMh4viy+WEbDHE2N\n0L4WNTke0MT/f/paGxAm+pYj76oW9fTrjJ8WtewyAOGp2oLSF0qUHS7ZWhSB\nYDpxc5Gdzh5b9ykPuWthz0j5sTD2gXakSH1ZbT5HEqamXpivMLvo4jfxWX4Y\n5wktjUPxWVg8kIv56cIC9fHGs1VHtTaXde18VEfdV3Nt06kO/4hCGDLIq1L/\nG6GeKfYut5VzNrV/SDsRBetGi2b9zdcnBIFXsARHBrtsNKx6iAqR4/l93HS7\n2mkRbG1+fm7eELzbUc22JuUsNFH+O4uW0xv/2JbKT2WaIVvLAXz5J+XN4kHa\nOio5eCPlmLHPxqrqtPQopQLLmCxWTe83T5b3IuCkMQT+HzZhbMF5fixRw5jU\npqGcUfXDfERgP+TN1zXDS9ZEwgO4LjFOliTmQQUHueMcjiMLEtj5OcAd5PIN\nbBv7\r\n=M8OK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzPBTlyGhmIeJo5VB3LxUE3qZDRMr/2PZ0fKmP2r40JQIgdAkoqZmVGQVR7EGbEipZI+0mnykLdWb8HMXGdovKVdk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.d5fee644_1544632406577_0.36939883235301063"},"_hasShrinkwrap":false},"0.15.0-alpha.55996ccd":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.55996ccd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.55996ccd","dist":{"shasum":"0ac51af098dcc3f730f0f25a0678ae5e595aac3f","integrity":"sha512-v/6WL3vOCOATcloZrjSvg11NVldjnZibXOkibV1tZfdD5XnoC3vSPPSxMzDS7IOQR7PCejamBmHr4Ek38wZbbA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.55996ccd.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEUNNCRA9TVsSAnZWagAAlooP/RCxnkXZ6R5+QoX9AX+X\n/otlajL4B/2yOWgpgGSLhcedWdxqkZ5SKp5+FFa1O7vSi9LDGeErt1dXdf/X\nfcumIMjDPXT/XC4iPycpswvVE83sXuNxshL5D9jAM/CYDkYPbl1LCMSm2H4I\nxAsS2AR58xdXCcj+BcZuv7GHQD31IxIYUbv/ciPkBRnYUTQfzm/IEbwnJlEM\nEL2Jt63rG2cMlAs9RqOf2RIPeMn7WnRbd/8q8dLQWm7QJslZczq/ryS+qx+t\nkk3uIp+v2ZfSR9W7lI8zGRmD7LoaspS4grjHVlsT49I6U4WomNeAx83V+jMF\n1IM9L0rlj6luQukxuJ7LX+44BD/d2EBSFKREXo+CZqWxBB+XkTcvSaEK8M/t\nn1Gj0xzRZd+JAXbbOM+jAONNAH5GIjYEfwnqfZkK32LOywOCSYf+bQkLqRlw\n1Tc4XLGam+zaKSnvVwwk8Z+GKHz/N6APythB+vGRXVhE9v4hM/0i/D5Aaaw1\nZ8DsFydXclX1IkICgfnatDjFlpLd6MuPAp9fz+vjGXDQso/YM/aExcX+DA2p\nk85kBaiaG/EWIUz2o1rgIMXW5g9ImZrIF8bYHeNBa9ttAApk8dUUgpvrEPs0\nRPfH96O9Lx5DIPlRCRQyJRDV4ZCe4CQvu5VM6K/PT3lVXHvTKy5LN4eNhTm0\nPdux\r\n=N7/e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdWiahu9f2a5SIdcb2bM5BUn2hF7BXCPKtA8tpRA6iTQIhAIV8/RJjBb9/PiCTc9wt0RQES4msauOLBzia6dPkAfoT"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.55996ccd_1544635212607_0.5327211448338545"},"_hasShrinkwrap":false},"0.15.0-alpha.30761ca4":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.30761ca4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.30761ca4","dist":{"shasum":"5d5f16ced4fb71af17694fd0d80464b147d0c61c","integrity":"sha512-sTgjFoo4jGN4i+WaAUgzHEXYBw47h9+keB/QDnqjvgzPrDaOpingrnvnC8Oh/1uhML1wrwfeqXsp8RLl1+L7vA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.30761ca4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEUr3CRA9TVsSAnZWagAAbtIP/0ENvUzoESWmVhq5u3jg\nQ2oiA7f5RFF+CmR0850he5XcH3xGS2YZ2Shx3XFgjfn9mjHf4rhi+zANxQdN\nNF2mHnt6dJiDCsP4qlLN0KOjuk3WWELOd6qH/DTcZ83olSIQGM3v8XFigi+Y\nRaKzj2+Jtr7SGm9Qd8ofpEQRIfuIi3I67omt//GelBpKQmv1BP/LQWtvyvcs\n9sbtEwvYBpCJZ1nixbqEHjqNXlSaTWmxSikGEtkroYSGzMBZRPYVDJct37rq\nsbOO6+m5fS/aJgXYcToHlX/uCgHw5OcT99olfnBff2chDmYySQkrhfVQn+sN\noSsu/Dfwn2yiXGDA05jwR/7vBY1OvK86DSxLfLXjoV5fd9MHsC6bmb1x7HxH\nT+eLLF+BU4Oy47vLlMTG9/7osEJL7kILH2RjidYQM5Y2fHexjw5AWC0TH2Fz\nsEzn5eJVS50nTV7Hyxz8LOvaRyAysu/s3+0iKb9hVp1oLeIXR8vFp1zN7VcB\nt7CAg74T5x0rTsGoxBnaU087CJBQOUYEXkN/sfbgG4Qqyik+znd2APxcT7iO\nQaK4SuWsqqPs/IjQg3O6g+BKiIGK8JzkMRmP0vWtPqYcYzvha/hhGgzT8Cun\nZPHX6fVtRuy3YHLXO1SGX8OYa4kTTHEMdzAi+4svq2zPzf+KEuevsFfA3B3y\nRUk1\r\n=FZlC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOXPqPw0JD9X0ato6AhmcB0xdZkFYFWl2KXAh0hYuTIQIgN8p+gp2IGs3faAgPQbOqXO2AlaR10Pp3rSYVIx+b5X4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.30761ca4_1544637175194_0.48980575777773416"},"_hasShrinkwrap":false},"0.15.0-alpha.2fd934f5":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.2fd934f5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.2fd934f5","dist":{"shasum":"ddfa13298bca4a36c9f374fc25eac1409c9f403c","integrity":"sha512-IBzeSeBoDUTAsJeulvfWTen5S9l3Zpilh8df29Za97Me+a36vEkyf5hvMySEFJDcMYqf0qOz9Zjv/M4X/tmtYw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.2fd934f5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEU0MCRA9TVsSAnZWagAAKTAP/3C/Tv2U6MN1HxgVWcmP\nFKFIgTrkMgiSCJCWqFCqPhbDpR+p2Vph5rAzVZHsa/4WHew12EzVMZC1sHYe\nUAAZYwwc54c9PD86iTRtUYkW3ZLY6tQ+cta0Qacx/rIqt2Fa1r7veooHtKrT\n0TEVR7i79sHa0G3PaqgW0TLi3bNKDjCIN4tMewMQTA9lXZzvpY+HGT0/sP5n\n4vGy9c+reGYk5OZ+J2ORHC+X7uhlgCtBiPU+LXuJZO3CbMJ60oFD43VK2R3U\nMvbC6Mt40E552AtB0EKz1CnChEUuGdJPN6lMh4m1H8q6/E+F7zSMpagyJEgt\ntCbu4kzQE20793pfCpE/7EinsGW4GvDaH+Bx2kGgw+cgoYErorfxJkBELJGG\n3H3izlcLUg+Ik5w4YUQdNvNXZOg1lGyViueE0s+LPIG64uI6kR6RvkQixMJP\nQWKU43bwcQMaW1Dz92F2sM1DhOzOgTuoIXKBzkye9CZ5/81BlzHNgHN6HUEy\nPGsQSaL1JqUHlPLqkgBa3RVZGjiyPd3nqHCEMEWPxwJkWaiRZGj9YkAbD4YR\nLAt9yKiNkKsJfrrOGhqVOrWCChmj56IjPnFX0N2zL+gf5c8RSRnivJDNgn/d\n6pf2WFN0KqAAEEyB4vDMBCkRKiyh26O3+PVVSAuq5oAgXhJF7AqILv7vKtt8\nGS+t\r\n=c2jL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcIiVHpiRJfIBVlBeOzzc6U9JH62E5qx5MP5GOLU6JgAIhAI3Y5L8bqi33SM6kS34ixnBhqNMEv8rJsfw5KGjKUcW5"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.2fd934f5_1544637707838_0.9927719392014913"},"_hasShrinkwrap":false},"0.15.0-alpha.de2a5667":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.de2a5667","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.de2a5667","dist":{"shasum":"66cdd030d4726ef4ebc50c55e55c3659caed9f57","integrity":"sha512-2uzuhOedrBfuaG1WXyK69zeYmQk33T8iVgN/ZauqwOnMG+/dz+/03QDlMO0G4fklXV6WV6WwDPZy12VRKfXY2A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.de2a5667.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEU2fCRA9TVsSAnZWagAAKOoP/A64n9pvICccZ698EG/L\nTSavB45kQo8NAdoASwsNesuu/zp2SDA9jbxfSH/L6gJTmNuNqUhxYFvvD9a6\nuFyrb7pC7zXdMguuMJ0CmHwN1X2LUlXbp9vorHhcNLSj079QGcOJWZbgv95e\np7iYrMZ28OU9LnbKtwyRKQ2qhsTA3+n8NfnaY6wFyyg+QoIYDfvLHljuDytN\nCaVLgIPkM7mKH4iVsbGZRoNFQkkUfnS+QoZur0MbkyBySeYozIalIiP0xQnU\nQA6CJlXuNUg6A1kWOz03LjJaobYXZgUugSJj5UuydbKA1vVXeBwS48b5qYh5\n6TzpLzD34wBYShb3sY7Ci9sMzxMVClqOT5LRXwSMhufFgQfW0zHc04eRy4Z6\nQBD2PQMLvtkB8oH0qKrG7B/9rJaaCGeUxlI1UB9mHXQHlS5C+D85mIqKnZD6\nPYnPVvWmVgwW6IkBeV543RWz9U41pbBTX22gWP9OgeBv9JdwEUpRWmjR/DDA\nb9wtG3LSuSBi2rXCcxlkbAgq+5ijOcsnN582U1OnA6K9WRkqzMHRP4f5AK3n\n8ZYpOcg12a0SZ06fGSJP6gwNBQfXG+of7G3ZDb+EiJf1FAPRW6RRbHTkt+T8\nRQbJ8sNpB+W0JjzNYVr/KTEAn81vzuoNsfKfbAhJRiyd0+DtKjfJNjHNYOc9\nFZ/v\r\n=a0DV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChiZqf7j+FS50b5vQSIJ7YoX1wfPICCvE9DdQ7jP5piQIhAJjdXsAJLBesFFAbV8HQi230XL2QwOWtP3dr7uFmgkd8"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.de2a5667_1544637855258_0.9745088879693591"},"_hasShrinkwrap":false},"0.15.0-alpha.fceb970e":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.fceb970e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.fceb970e","dist":{"shasum":"980496732dac0e2312a54a9691aa04b115fda1f0","integrity":"sha512-c3Mtls0VqhLLxx3GT6/l6iNj9X7tvsi3d4yR4FpyFjmUmbE8zcOOKIURUWJptHhPTwn2Q7+3sOcRCO08dpxLtw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.fceb970e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEU7WCRA9TVsSAnZWagAAD8IP/0gfJQcYfylYMWcXFXQT\nbQsmqdsqsdOsCjkwvxn0TLMjWDImUaOMKy8/WnR9BE9EgWU3dZOHPwHA6d8K\nheKbYkIu0RzlWxpJsglF/TORQ0zu1a98U8yx7+l+KqpbOX8/34EY4PzUT2ME\n8tQIptasXGpR0IVGPi0knijrbUpve2dvZLgNGqpLgcOUHfceBuyrSt/LU+/S\nYrN0tDscGceXw8ijTtWLytQ3LqRHcx3H97UZilLBaSZe0LKFWFDUvfQAMERd\nHZFSv3cZF8/i92Sqgo9MnKrWx+ncQWGROM2ssQSoDA2FMINmTkHyO2rufNcq\nKnfiVTKoyQ10e8YmgySpbGeWmyOmfc/4khiIbxoY7EmbcD2wYOpIX8SM6oYf\n73F6tgeRoWtI9Vy0Z/bhgKoPxKNbpj8qgkCQmJ/l3A2HRGzeySFVgEMCY6bc\nWx8DH6VnbzgLntt7PXvoetjjKLbjxO0Qd7pbJnO+AQkKC8GhHhZi65JyVRra\niDnD4gtNE2CWk22akvU4Frg6MSMPHnavUjYTBzNP28wkxpZXENKEAzLCPxgZ\ncgv9n1eLb6D+Ad0vot84acS0TEPnWMQZzfYa+QHH60GhudiVde0jZOz7n3Yv\nLYC+dH9hUHnmq00QkRIvKH84Uw7jGVN3DQT0prTdB2fP493hjEX8Q2uAOexU\nO6pB\r\n=ItXh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDV3bV1/iCVNQocW2fjFDX5SA0DWMz0U4dixWpK+0Ur3QIhAL0JYze/4yb8FgXoZ2RjrUk4H+dgf8wd9GlsSPH8vBli"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.fceb970e_1544638165776_0.9261221963933353"},"_hasShrinkwrap":false},"0.15.0-alpha.25a57412":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.25a57412","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.25a57412","dist":{"shasum":"7c8236a2a6176615cd6b4bed5c11a196ee86f669","integrity":"sha512-PtotmSBqKGzBhTtRPfB3ElVFG4vfiR7z1N8I9vOBB/x7I70pOfzDezKE8vl11Ce+3+wuRr6Bwp6bO0lPLdlTXg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.25a57412.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEWIdCRA9TVsSAnZWagAARdEP/RCOpl+Y+pbZO9ljj8g+\npTl0ZEaJa2E+KApS+cYQ+isG7b82PoLBWcLd0VmX1Z74A5bMBS7TvKxRjN2j\nO+/EFm6iZJhPnqZ4dXqn+jgAX15IBspng+KyOAuPzKNOSKSF6c6aFQceBMgN\n54SA7B6s1bfSLJRm2Cv9gNWkIf6pMMOwx0mEFl+Htglk5GLJuP86AiuJV7lC\nn7epPfEjEWe3yMWAQEvR07Vt7i8NQKAdpJn+jRn/ogm0ccgWPp4tMoX6ulFU\nccVn2ZCtDtzBFqnTAcNRIHwqVrFFhFPRRCKhHGG9kLaGmQTw1Yv+AJaPvL2T\ne3iHGQQlWdVR79//0/Rbbdkpz/mcXYC1foze4vrDyu1GMKWbXqVrTeKfiXe7\nB9TeFygXrJK8MFZ5lXMAELc8wJ/NtgR7DHvmWVgMdykbM2z9kXCLPDG86gbG\nMLFGJSXyuLpYE5LEtmULUwc5aDbpK6gRTg8sGQ+nPLgIR+XtVDoCJijop/g4\nu5a/xhTplUZfeZeGKSuiA3SiNXD6v0e2cpvN0i/NAARxumejSm2YQN3tBivW\nH8FU4xz13HUh1Wik4rY5OFgEmIg+0K6zzQ25zoTTruu3o0EZBFIIwTsNbvUK\nYHtosYSwOTnmASbARZ8NxbOrHD10bGatzQ27sfy8hVySBZtXcOnrLTMsJejY\nsg7O\r\n=TLHa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF7m3IW7cjTJR7E+7qrRxZoZYqgFV9+P9r8LHV7gItOqAiAyfJZPFcHT6vTThBZCIVedl4qV11AKw4l1rhJkQxodbQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.25a57412_1544643100998_0.3913428539185333"},"_hasShrinkwrap":false},"0.15.0-alpha.8695bf70":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.8695bf70","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.8695bf70","dist":{"shasum":"2009a0fffdaa471a6a2d4a3ae23bfcb5ecd164c5","integrity":"sha512-FU0IgXT3bNgE1o1k5AY9a4AcZ4wf/2b/JcMAJwneikD8whgK2Cq78DKWPyKq3PlZwm46xISlAcCVdV+AgxikMA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.8695bf70.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEWfpCRA9TVsSAnZWagAAEXkP/0fkTLjjNTenlgZZlokx\n8DALUTYYIPVTOCH1w6u2fV1MZeHvmjonoaCP+c4FtNjwCq60dny6EjcsN7MR\n3LXIv/ynH0/4JVYqq0GVBOixyWaiVMsW24Vm+ztGTyM5SiyoCMXSmjQ+IsjL\n/JvBpC+Vt/wyyW5x9O16RcUKGOR2rJJY1lzvdIXLDKNS2052IkJt9yDvEUpV\nyPboZDHUsIORjN78oTdqmYcXcfQ4aHctdY9A9kWtxLEK9iNMcpuJxxjeLLvt\nAmoQbm5LmXWYQmU6bKW7gv/hBu6eElsCsAMzbKfAx7SQYiEsuz2FWR1Z5BlK\nslLccM3Inoh3vsqfyfWgk/kikaM7krcE8fgRMc4RG9YgTpNBtL9utjF+k4jb\nnVg5beAs33AZeVRtNrC67OGNLhqJtgWJBrn5wfizO0ZDix+6D7yLu/7e2v1A\n02X3kDflise0l88sKz5MenxDUy4dd2QVxcQhFf6JPCTfjpwcbKE8Et3uzZB4\nAI//R60MneIvAztGQuCWW1RoGdTjiH/onekKW9lGEIaVcPHccFNT5NFvsiJ2\nuL+KsZnnzluEsm43XTj+6dhyegw+HTNT5AlwMj84nPMebW4YuUQaDxi1H/Oo\nU6H+mSqO9fSGvOaNDrfVOSjSf3yXOY81hqbmAhJW/erWkoC8Et8lEQ08aZO7\nzJl0\r\n=JJJX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCz1tvPjGoYm8B0AImMyq+jpsAUBt58RCeAZijc9hNYdAIhANbPHWQapKqXOV9pjEBYxKScsq+c/+XGFVenz7mAHB3/"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.8695bf70_1544644585206_0.21003024629874867"},"_hasShrinkwrap":false},"0.15.0-alpha.38300000":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.38300000","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.38300000","dist":{"shasum":"25d066eee2a1bbb2ec1d5d249d870efb5f4328b7","integrity":"sha512-yWFAvaIXkFXRFMtgiqa0Ke6aY/dXypmwMaCCMrkpOBRh5VLFimw+hexFZVXKSW/5Wi4kZqJsqUQXV4TF2ODCfg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.38300000.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEWnnCRA9TVsSAnZWagAARcsP/jsH/5+mu6QWkvG/okHC\nZtOATngVHjxg6SF+Pwtb2d8T2fYlYWbrdtrlHEWAnRpRo5WtX0rjPcJILQ9z\n1jmI+UcItad+eRtdICAGbNJe3BXjNsfn+KvTkwyNW24IFTtLnXUvz+/S93Co\n7i17o34/Gxhl4TEQEs9Cwe+QTtkVWQrFlD2pLgQPotajwBPydFctgq1x3biT\n9XPJaMcOIGGZ/hkBXGWe9XrpiVGjRJcA3+EPEjznZcPLCPoVukl9dHWdTzuC\nCh0dY2AijNOkRC512vhb8kVmmWedyokP4BbAqjknfeAgM5uFBek59ubYy2Tt\ndqCt1LrI6tIT+p+NbFz9d9CGThscYweJlECm5ZywJaD181MYZxZobMThPq53\no11c2RzBHY8nQoh7YdRspeZjRfQiEe/xO7USqv420ce7Ggjr29vGKSiS3rt4\nxebZ8IseDIhB5iaQPzqBn8TEWVchpXu5DKBpl7Zyeh1ozAeK4rC0tyrkUfI6\nBVNGwf6bPsjeI6dPT5JsoPf2P02NfLC68wp2zf6qLfeo4Hbg5yfCmb0hIjVR\n+xVNlhTBGBbzOW8qSkkPBCeXG0u58RkFKI9pmercpI1mBrrJ44nZEu9zQ1Sr\n+jcXBI8jn1UwRTBD1vUgDIvT5YhWyMEztW4I7nzg6EA/PBPXS5679DbLwzgU\nDtTT\r\n=S0+O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICs1o+S+QGiU6hyE1r4mnHUJ/I73Rir9LMf8S4vFevCzAiB3M8UwnG7gWuzHlv3vV3eLhouea8W+RAuo+gwIfur2dQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.38300000_1544645095238_0.5095495452167249"},"_hasShrinkwrap":false},"0.15.0-alpha.bab23e56":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.bab23e56","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.bab23e56","dist":{"shasum":"363e42da94479d2016c7c7e8da85c15d2d4ba573","integrity":"sha512-SPdaRHZHmGl+fEV1+7w+5Dx1/vIRD5vppdw3oDkYuJd/EsWi/GBFEoh4ydDhRqYn1aF407Lip6WoDWt1nxQnDQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.bab23e56.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEXY7CRA9TVsSAnZWagAA29YQAIqMUPP2FNt6WrXuWobq\nXxy2I9tR4nDJ3QzSWyhJB1VBUgMQQLCPhMVWfiFgJ8WJ/l4e8D0fEcTszHx5\njzDfHb0cLJH76x1M7R7so3gv73wW/vrSBeySCvu8dMitJ19WNrv6x91TePJj\nxL332EBNoabmSH+VG7MgWCk0Bqix9hhY9wiqB4DK4hwDoFq1skaOq/h5JIPk\ncYeXKC6o2mp1VylPSfYK2h/uMI3VIEH8hfftJ4ZaBz3U+psjOMtcyHfH3mRU\n/F1Hefi1LDzYAvrAZ5+s5CxYUKfMCpcjQ+z4sz5FjnZqr64N/w7nvMcdTgLq\n0DJJUBHZH/i+O9rx2ZqFq9tMpDcfRyfmYQ+OtN8D3rWqhZkOPaO0TLnbkzfj\nF9p5wfDfV0nHV4ZupLNj616w1y/wrMXFNhFIlq8Xsp63xuJbhnUeF4SOVNIL\n539Y2DVqFMXC32KErTupxUZ50WT7w8jo07bwyuDjteLbNdkFVeUvXRN3JZjm\nM7UJwEfVwpwkuQXOFU1lzJrh8TX+/9yw6qmfffe8EaBuWnIlme/2RsEQhnKu\nfDuuOeagIXhDM1diuqaszVgZp/q8VPnAe6lEWxZAq68Ac8zdUXv19IeCo6t+\nXF3ammAnN1ixPYcVGnUdILwAOfqgy9eDmkvCuPauCTSIbu5EVEVCYT/CXzo/\n3oPM\r\n=zNeg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNH91ZB9GUneYK2auVb4rF2V+dhoNeOq8LzY0wx03VoAIhANJBX/NuudeaQxZduMuXpbKbSR6K2wjyOadmww1xPBxW"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.bab23e56_1544648251378_0.6087597616936198"},"_hasShrinkwrap":false},"0.15.0-alpha.dadac021":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.dadac021","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.dadac021","dist":{"shasum":"e4de0a80f7e5f8803cb9c3442f7d78dc8e5b5d8d","integrity":"sha512-YmSFBLHg9GGJ/ylNLDXUMj9MVsq4d95stdFNhdseaFDxLTu/QCpShGvM1r339k3wBaLBbUYsy380/xku5PZEPw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.dadac021.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEY6pCRA9TVsSAnZWagAAPL8P/1cZwLFJ8syNiwYdU577\nopECdNZHdkMeOXBmVRsSg9WGAei0U9w3ZCbhE+tWO6i/N30LhhPCEXDziEdj\nTLGxpoegQz2EjLmEd8N4sF4ABMh0ekLKe+Y7/zgU4R/D6iYho2skJYYjE3BV\npu1tQEo+4xAIZPKja5WNtVjkergGnQmWuhZdpLOM6jZuEtbLSP0rolJgF71u\nhMmb70d1erz8WnLUzCUxmUJGE3RRwxywfVnEO8CPXM91J38LfQeYo8APZsRE\nrRlbSF8YhiX4/chMG032OdbzNWNKXtDl7fLmlYgzWkRo3aw2ZSHYa6HOD3fC\nOjZ+lJ042evtcjbA7n45ErLDUSRElfutyEvpEbt9DlpWb9zt00DxAKMt2I//\ncLuVVkEIaAzZysS9WbXtFRAGQTAaMbD0SF0zY4nS+d0AC6he/igxFRb81Q+W\nk0qmcBGstcjY25JPeeBsgWEajRgqNJJe6ZMIPSlrdBZ/j1ejZrOS2jIUWMTD\nDfhmiw7CFG7kgVN5uCF+oo1Vawup8fqwCs5N4mo4Tu0vRkG1RzJwmXjIqBAC\ncTGO34pWh1ACmaV1q4PHkG/poe1Uja9GY5c1w78xM4K4rlmJLD02E7IBoJ+D\nyQcxALViFI6Dexh5LdWZXEd7AlZV1ag+ZzYT85+dZ8aH/eGA5WyqO9lvt4tG\nLgXW\r\n=untx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF1s77YDIRfcpUjyS1GtdMLNt60cRuxevASGBKyYE4oVAiEA5U3MHTzrgyFpoMDTARMMyL6LoyDk6TfYMsG0fu/8eSM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.dadac021_1544654504727_0.14553651545061497"},"_hasShrinkwrap":false},"0.15.0-alpha.7b0ad9b3":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.7b0ad9b3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.7b0ad9b3","dist":{"shasum":"7df318553abe0edda853db27dd70b695338785d1","integrity":"sha512-ffwq5mdqpLNtOlQaj8s0Ehlfigu87UiRTC3+GatdaAUsx5NXWPoMsB1Xb6z+DT7Zy2B8fe65Ib2hUheoqgGAvg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.7b0ad9b3.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEZh1CRA9TVsSAnZWagAAYXUP/idd65FeRFZswYbNfEtB\n33yJzh1TxNNGVE5lc6cexwvutu5lcJs72LckBLrlyvWSA8sJIiFrUa9DTCX3\nK0OzBIbqR6oAzd7yRzasvzq7aExWS2tdt5MY/IB595HL55Zhii9Gm8FoBu/n\nZkCjA8ZKaufXhJ2XCt7D4lhqqb8juJSHf5f1uF8k3BQ9QTImlroL/RXHWX2d\nPafUdLF8zkb9KcQPAVG3knhke73sF/i7jxOze6NP9vgTWTYOu2xrQ7LP6jrh\noN3PZyYimTpIbyIRA1mVMPRL5+cRUz35zhCHS/kq03BR1oQthCgpibBzVRMN\n2khovxzwCc+32TdEobdXEh/Seh8mOO2HT4au6uC9c+pnoGAAVcM5ZMp7JZOY\nZpvFsyikw0cGoxWtMg5WQ3z37L/vuoCwxBnYTbDIMH2Kx9s5MXaVQAxuXylP\nlsvQ5d4ubcVOhqhibXLXLR+TYleHloNI3E7cMQQpi2L86t0ivZWTgaHojL0E\nsbggk0tI0HEWaKRaOY9kvy0f0eDWOUrq6ActVvOqu6roQcVcfHLOumNsdpCY\nu2ZVpiOBlndcQeT+JeXLl/0tRLhjmnv8DF3Kj3dP12dgwCNYkCWOeg0+sMvk\nWwMk1PPs4KPskgYlQEOZVMw6xmuIK3GDYkok4i0RrPiHVTpl8A8WH1nE86/w\nieFO\r\n=7wVY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGz3ThPW+KFlN4TGDAURvIRVywOovXFBfUhCMNhFEf2UAiBbvdZ6t9+EHgaKb1Rhe9n8Ne+neMYK7dlkt21nUFLKYg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.7b0ad9b3_1544657013090_0.389846088661137"},"_hasShrinkwrap":false},"0.15.0-alpha.b9dfdb46":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.b9dfdb46","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.b9dfdb46","dist":{"shasum":"80d9a82fdb3af13a8c4de0ced7b28644f25b8f4f","integrity":"sha512-jgu3vShOA/6Jxpn0pZXdXiw5uOtT86/UWcyGjwLZyH3JwGmg4FDYtwBXz8zWIMUZPVCZMPyNGB29ygMgmtCXpA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.b9dfdb46.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEZtICRA9TVsSAnZWagAAtVoQAIbAlxVNUtMTyMvqDrQq\nva3Pc65OmuWz/NXn2WRftUrYbmw+iA2YJAOgBUmfa4W25NuEVwcJ6Re3+ISf\n8JQWRNoEiNRKkZVdPZkHfC5zk9yaXHGdhhORoXEyg0s0I1kwCH1DOIlPTJ5e\nl9kKOq3AmgguigOU2yY7nr97rFTTOxUezlgNuUEgGoyl9VT3+LACwUwNIrUJ\noUyQicZvrPLeHTmYEvp96iCmD/rL4fmD3cWGpL8Jo3Kch41lV2VP+n6tR9pG\nvQQX9LlgzjUr0tT3INf5vX9dqehqQz9aeHXE5CPzsTe+bUUwnziUauouJg7F\nj/Ra9wTgkVK0pnw4LKWXLa1xPAXJbcLVQn8XZaM7GHyUQv0WjgKY1/8w6MBs\nD8qC8ioFPdGVA2TCyR7ZToQBsdeM26eBQf6IXs7YMgFrJ1Viuae3XIs1cCqx\n6apCSMiNmXe6zlo2C5MPo5VBydYxYAH5Rb3au/44YNOF7pl0zddIVynp6HFs\nOJROvDDsK27j7zAcVrmTpYT1fEXgUMOTYDWqT+aV3BqfwOP/AaSN+iElr+uK\njK38Ia5l955EYcgNfQYC2T+3nZq9HrVXrVSV90f68uChJqRGn9olTvRgz/FP\nZjKfuWvaggltFyFIN7R3x7eMBKbVpuxEO4yakPYhLCvNpdxc1aadj3dId+Qk\nl6Vq\r\n=osEA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDf9D7RFVjZDchsbKMQtS8+zbaHXlZC6I2+/FMgR2B3mgIgGzpMfO0UrI+FNK6iFzk+pK1wMxeB/ZC6xMHyTUQMI6M="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.b9dfdb46_1544657735505_0.971151962587326"},"_hasShrinkwrap":false},"0.15.0-alpha.b8753102":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.b8753102","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.b8753102","dist":{"shasum":"721eafa901e386ff6a7d5c2a73712e08d0246d6f","integrity":"sha512-oXAP+uGq+MmaxJj4wxLdskhxlEC7rLsS/uR7cDoxczDrYUinS2sSy3BUdt59kmImiyTLmrme6LZ6xbTKPSDZOQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.b8753102.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEdXPCRA9TVsSAnZWagAAobAQAIou3yYKfo4l9/thJlVD\nHo0RF1yyNoSnKB4R6sOKeSyNhVLSTQpuMusbtW4RnkDwkbbVQpXoBaTxwbBT\nROcM/xzFA44h58TidT7bICJfHAjSSK589zK97tz3FMM3v3hCbnK07iJ2GuLR\nsChH73YJZ6RU+8/fX7yC3whFHm+iiiEpvsU/MrobV8pzQV3fzMnaqPMX8PT+\nY6XZ9dM7QhvApD9r2IfwJgzHVNiywmQ41jtdd6F/odhR3ysnXtBLL8LR+zL1\nedAeaOFh46Slb7/PwOkwk81TWm4HZBTSouReIOCGQpj9Ir01RC8pd1QCmN+4\nwLahGlD0UmDvmxFw2kRaTqp7nRERjNmPoVi4/ZBfjyW2xu00+3pZWCI2a32I\nV79zBWzAP3viIgOOZfzbhx/blqcwd/840tPJtOUMdqtFeTcrPLmWjIaT0an4\n13k5hwbgA7sGRPmanlE4aD0wluJ/x4Ftm33CfkjSjp3LJLe4o6X0uc7LIs2e\ns8f3oKjGFdAGxyqJPUsEXuI5W259cZYd5QLghuEvD4gHMMGNiy2uHbKsE8Pd\nUEIZdPDDldWowxunKfwv3miqOy6ztl6e44eYeOZhJlCSLCR05OvGehRGeB/z\nldImTsnobR+RChxvpLqrIEdiUC/M8IvzzDPguLamFAKNH1jJcnD4muKwdX45\nBFdG\r\n=vCnt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEPqiGmsL2B0UoKcUYLTAQ1XnbMw5XXqNkZtKBUvjG+LAiEA2qS5XQ7YozNXHnR3kVgl4xLM0L29KtMKEvZFs0HDRWA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.b8753102_1544672718426_0.871001354109082"},"_hasShrinkwrap":false},"0.15.0-alpha.8db63141":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.8db63141","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.8db63141","dist":{"shasum":"5d9c6153bcefd36a1a8b7b926df1dca5839bf251","integrity":"sha512-QBDKkK4riK2ymjdIxUTccytmbH6ZClxejvDfvggs+4NvS6n+kSKxdLHTng67LMrfTnhxvGoilJQC7+TFGHInSQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.8db63141.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEfyPCRA9TVsSAnZWagAAA+oP/Rd1jg+P6mDWGGhmu7RJ\n6GcZWonNJVoIfI9VuSBBnCgSBWf9EcoVkIciQA588gXnuzXpz/4T4z8Fmyop\ni3BeLXnR5V3cIqyJSRyNjqqT0RkJEhKfrNO+2SThpLYec2M4HOjLCwrKdD4G\nD0admYDu4Z8QJE530fwr+BHhLMMSx6yuKZ8kiZKfU9hJZ4H/7K12peiCSMpy\nahTmtis+u9/LLPMnz++mM59sSJ/cb9ZYrlOmjbQBJqSInfrpFL7XyibqHAla\niW7qLKvaLWH0zdnbKj4Bs5SCYAQVT3f0zZKcqbZIXrv+sZ8jkpvH9XpY0KrU\nn10aaYkz6kae+qs8C3W8uqq1CZHW2ivxIQaA9GjR7lOLHZhTntz3HWb4ZH9I\nho0OkB/Nf8mhSS1yCNP5K7KRpuVb589rUEsoKofgmPcGyaHTnaQP2HUALQy2\nu2GQvia7PVb6cuTGMODOZGmxk54g3foO12WFQi2Bj4qZBtWJiBjGFhOFJ3qe\nzMYCie8lOvv/8tK9bMn46230aO42zkiSwLiwJkseTmNPn0Jo2p8A1dEXcZrI\nHVBRAE7IMcZKuFhBq/uTL1FIo+IuBiMkW6xB0Exus0PwgcUo6/0pAaxzfIn8\na47wu1hvZz3qh+TwSjPyr6NdKfvn7cDhTsLmtHQrjQM/N0jNX3/bOFdKIuVy\n08Ah\r\n=oQB0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG4JN1SF5AP/9HThuyNp2LDTpI6bJGB51XoJ5e3MrjQTAiEAuTxLOAWcbjwIgJYsOlsphiW3aoywZkJdj4moAMbGG7c="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.8db63141_1544682638777_0.37073790464737444"},"_hasShrinkwrap":false},"0.15.0-alpha.53ed69de":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.53ed69de","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.53ed69de","dist":{"shasum":"a459773ef0a58ed56ecdb3681abfc3e1fe6d4af3","integrity":"sha512-pwz/g1JS/5LcmTuiozuLqIS7NltqVDiZIqbPgcYSPz0lWgRXCzgYOFvn7E+2CdZhiEDLW6ZCJ7/HwspnaHLoNA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.53ed69de.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEfysCRA9TVsSAnZWagAAjKkP/R4BY319uYWI3Pk3bQ7e\nZLpaP2aKI+RYuxlUiMbncLc2wXiHANJB8LiKR8jF+iM8yZxV/QOgMGZERvLz\nxi6+oyrTG1izcnF8dD73TogtKt7vHxKvgHqcmAmtQJTcFUpsPuAz65QGl0hd\ngmYuREAYAQJ2DJHY52exZ3avMQYn8aqOFRjmjgudTIE4PEfPDZBMXdiBLZI7\ntFQb+FQJPNgpC6iDPl+TD2MchyffRdqGH0MwILyEQ/xz7is8D3EifyYoor5k\nYEQLsJ70lQOTkcJRIs/1eO1ss6iu1N/8kERQ+R5PYYAA0GQ2jUQjRBiuMWe1\nRPBwv8NtyTyJTqAfwGlvGERbO2SjjV7S86kq7x+34L4Tj6VFLaRnXqkIpvZJ\nyNezhKSNa2ukqhJU6lZDvtyVRT2aCaZ4XC0zwrOScLGH6aQBm8+w3sOgMtsY\nsc1LRUWyRfQ1+MXZCrRZdyF3HM5NLJQg7G5LnwMa4A4g//ERb9eNxwlCp2Jx\nKjRRCJcOC/RB6lmUPTIMPi6xJykixZahzKUFNsMm5rXFPXxXOv2p/g51Q2RL\nxc94X7+raavEYonkTRKmBrVQrDzYo3HLzAFwPLZlLk6inBP6pBe+uwUGQKI/\nFG3RkBOxl1XFNP/HQ+w7HvDPULRV2crW4zfVetpRJDWixy5pqFl1vECYoX8S\nfH3z\r\n=fbHb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBUxeon9i+2qhjMrU07KDDMGtDtYqS/lGYZGpSGY4/XvAiEA2pv0Mog6uS+Ws4FEuP7ZRLSjHR3p3S9BBGCGudjHPUM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.53ed69de_1544682667972_0.9156619535712545"},"_hasShrinkwrap":false},"0.15.0-alpha.b5ccbcd5":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.b5ccbcd5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.b5ccbcd5","dist":{"shasum":"e2ea7a0bc24f6a4453c229914c391bb5938aaa50","integrity":"sha512-zVO4mNV8+Z462o7P812Z1dm0+kUWRwUXcGLQYqNwGPcRQX70k//j7qoj3Xxi20ZGMDa185KWc59Lqz6e9dS2ig==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.b5ccbcd5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEfy+CRA9TVsSAnZWagAAVakP/01RkWz3dBVK7gf2VMjF\nbOjqJFvTReI+sEKLdZwS2rBZU2nGu976S+Hr3dG5Q0yWzLuxYi0zJ1Q0/zP0\n+rFpzgb9qyv/c9XNznZoND6CfYl00rKbtaqKlgbl+JvZ6uS+UqAHlz1VvuMb\n+qLtJb+A9GYHkkEyCMjsIppvvAkR1ldY8QCS3itXa0MFX2Rzj6WNEWVF1qx7\nczbNOT4CIeY9xhpRdl3fKxn48xdry1jadscBLDicXjDbPFD//DlAto4WLpIt\num0MXEbIIvhl7XffWhQTOoag6tJKSOTPEzzZwRs+wPkq+Sx+5wu5el7ngVs4\n0oIuT8lXM91lGd12wpayaGEAr3mJp+bxeKSzyaBTMTMrobXVT3VhjUHyYx5X\nfDNNMSuIjo8LN+cilX9nxXiqUonDh5PdnPQtBOhjN//A8BhNtAslBdNHCfUf\nbFi7WKPppGQyHNKWpYuT3IHFLU2Ro+Tnsn2qkgZcjoChYWSEwDE5sLc2ndVJ\n7YgvxxiFYDvrFEfhfyfp/j6O4Jy76fZEDXkentXJYtHUw/zWKvsBfJ/a+TF3\nUvDupxc9bX5YBZDV5zBANFwhWbRnxRhGFbOLKyeBP3+qq0/4nJz2iQsPNtGS\nszeFHG1CHhhXSYZR8TPmJ77KKh0nBxu+uKSoFdwdzy1iWYyY6+eIkKJt6Gfo\nLBUq\r\n=GKrQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIU1n+4YUGa5iMKW24JV1BArwGBarG8iA1oRfKWdIu+gIhAIhpdSov2l3IdTc42Ypo/o1YeeeObMfyNTupgBqaGZMV"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.b5ccbcd5_1544682686168_0.9817939648496554"},"_hasShrinkwrap":false},"0.15.0-alpha.d91216e0":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.d91216e0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.d91216e0","dist":{"shasum":"7b7fd4e1948b4437ece7382e19ea7820a15f6835","integrity":"sha512-hn16NjtsyXGYchCHq5MXfbRwLNJyT163kqQ+4ZLYcIwXeJNt8xhJ4KbQip91sFGcwARRP3hnolvGoLxAbMED2A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.d91216e0.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEfzNCRA9TVsSAnZWagAAvasP+gP9n+HwFN7vxboUlGV4\naX//+ebSv6AF9VMdpFcNnrKFLXh3S54hheJUc4p8HWdMVhwNtIMYPLGL18/Z\nf25/Ecej5IXz4stwJXSlFh4gV5REy2Fp6TdwOPi4tTssfGTaw2nB3hqHWDUL\n05J2Uq5n89NjWLm+ctGR2W4MfRx6OmJg7sx2JOTEGeiCj8qM8p7u1j4mjfrn\n2Dc2hKp+9BgvtcCQwGz4yq2l9qyNszwMzyisSGw0BSVrBw/HK+Ui5rC81Ssf\n+Opzy0+eiVDiQlQoilsTV0LkJ9nQRhzIg6CGGCQnPTukoec9/o1p6tEGF+G/\nlV7cdayzDIOduIgPjeICMG3Jq+JvSK/uFIa5UU1e3VdbLiUuy0s9WTAHxpXj\ntgLANNLFuE/NCZztMFMmCAkoxnMqc/E4kIGWgYbitDqIHiblhrK8bsJ10MB/\nz1AsqDH8ff0tkqCzMjsVST6Ts5usouJtLiQeKLbQezCuwdZSdcz9pOyRTm8O\n8e/7h+wBklHv/C+gRy1VNWqe6uw6ow2xXAbOgtR0XYHZyE9COhaNdSGK0HPz\n5Jt/3F3xqq/T70qFqh59dpN00INoMc3Nz3YFTJXrYsydF7voD6KZeMDMsmj7\nMXr6i+iGqEZChMCl7CEoJVgYvX0vYVAh31eLzyexp4D5zEkAoM99JE/nRYjv\n5Bd5\r\n=63h+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDU14WvWDO/o3sWE8AHIheXIVnb2iPwwNHbOfJZhHBMxAIhAPWSTvtr0ns3kQGKOq6Pwn4B5KbPXfPDDsuf+9ah3IL+"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.d91216e0_1544682700704_0.24911657179699476"},"_hasShrinkwrap":false},"0.15.0-alpha.5302710a":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.5302710a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.5302710a","dist":{"shasum":"97fa3b72fb88ad68e8bbbccf794dbfd57fdabe2a","integrity":"sha512-ZQgHkhlwPxg/7vVsm+/QRHMZF2AAkQsIzMQcOBLARe4HGKoFKPz5nmmsfNBE4MS9O1pOj/rsBw2LQDUAuq6wSw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.5302710a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEf2hCRA9TVsSAnZWagAAxpcP/34IduNogBuZyu8pNKLX\n213WYaEBr+l8LKpfkNRerYdU7lnJo9EhUhez1Sxi+dDNxM/F8ZN2DUdafbXX\n9ngOpzl7Vd39Ax2C/xJSgRlhlDv08OuCy5fbX/1Qk26+LhWc6kQg+5mrpLoK\nY0DCrC21JRG90vVHADh3ubaluPefg2L68a8Nsy+/uSPCjSQ0ka8ws42ZmYpO\n4sE+dS4KixfmyiRL4Civo+zDE8gUZ4LW0vYeClg71h0/Dt3xuPFMtF5rQDyO\nQ8ZyZMn6lK32gIO4e+Ht4VFmqfMe9ulMy1i2drKMSSkZoX5AaTujdNFuyUEs\nRbUMxf6RdiW+lYsegaYHgjWziQo/0huaFOljdRb3e6c72tFWuwuen5jMl4bF\nTwFO334M2etU75e0xkqV8PkEQmrm3MDHH2y1O3/rn5IrBcp4OYXPWIvMZVSd\n4bV6704dq/7TiBjg/AtnC1SJlk2aHbtLEFyPaZz8n3FVoGMPcNwaCH/+fFG8\nvwjnBbHkzHlgnpLSeJvx9YHX3lxr9WeOq6vGZwOJI4dk4WQioJpYiCkSTnIN\nruGnFCEOpx5ZFrg7lop47knrRJR7gtXKIzZLo7VuJBQsB5uokrgFT0fkRHSX\n0CX+W5rUa7Ri/Hwn8CtjF/crE1WYxRxqN+alnIgwMNVgiBg+cNSP2NDWiaJi\nU/Ub\r\n=dkQp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4xNCs77mYZU4IFAl7ZDiKpl4JFoeEjUfUKhPZZ1IizgIhAIhT/NGhhtcTtchMIJTT9b+X/CIDDkCuQMYMzSWjYE5I"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.5302710a_1544682912981_0.21349899197721478"},"_hasShrinkwrap":false},"0.15.0-alpha.dcb3b086":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.dcb3b086","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.dcb3b086","dist":{"shasum":"8a0470988f5335e04f016ee483c9b54a5326284f","integrity":"sha512-x/WV2rzvkLQr1Zdg//IsO7UD965oHyhVrbjZylMVOEJVv8hnV4eMsSta/IUip9nt6rLfThpzOEhO0l6Y3tS4CQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.dcb3b086.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEgDTCRA9TVsSAnZWagAAbA4P/21oQTdXGmllnApO8WC+\nXmoOw7DKkl883lD8lpttY+ZjFfkMHT9eNqwjvDWsBKHpJZkG1jXuKCDkFSFm\nzWzBTCu34rbOiBcoWxeyiaQ8B7yc4GCahgh0Zcu49uUw6Hz6oPnusQwQUYyQ\nNi5m8c/iLo6dxgxmTfI2sVUcT8dtwe3RmJIThL6/ZtSbUQpIGJ67PzNgZyHi\nJqT0zhzbQwoTG1rMeQnORR6F4bzX5ruG1O9/5WvoSHJ2FYnv4xT5BBQ1mIJw\n+sfeBhu85ezI26ZzpboOg1BDRDDcYg4qUrI8+ea9qYV8Ev+E8qgewV/aGVkZ\nbNfT0IdCQLSomG8yM7Tpw99eQSTAyFG1FXoCU5H+bsl2h6lX8NZ1rgEAqs5g\ndn1YaOyMxZv/9hqELj8AcwgRQbHwsxzVrptnWihf2CJJY81bv1rX8gY3G37W\ntq2WqhwUsy+BfoepHNPXPWzRhg+4HTNHKwIuuQcbJMxvWkMeEVMHFvrksfdF\n7do3YplL+B0dsvCXoFBAS78iHpHAkmXMpJomi50BqMD8KIhuVxbq1udHz+JG\n0mF/d+qduIVLIgfsWPmkqz4vjfRoj8GfCPxvPHWtijBCYHvGDNCthp49Q74D\nt7neFNt3lVFGe6v1dbV6h1LzokdQun3v5btTAMCCmBM5u3bfW2ltpF4dVGy0\nzGho\r\n=vskE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDImc9Ju7FFH7L6qk1tp9K38RLkTz0quSXHGV35jQEJzgIgeIr32mbC8kiQQfo3vNWeKlO/zy13dZSHCR9WyIdf8fg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.dcb3b086_1544683730959_0.7110885394932633"},"_hasShrinkwrap":false},"0.15.0-alpha.2623884f":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.2623884f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.2623884f","dist":{"shasum":"c49c4fc4410da75920fb96e3fffc982188e4e451","integrity":"sha512-mYolHa/XpOtr6A6Ma0MJdwOibXxPHG0RHGlT4feh8fWmA/MUkOLQgNwF0Z1jX4eWq5/BwECzZpiQ7Kj3d9FXXw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.2623884f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEgp4CRA9TVsSAnZWagAAyZMQAJG1EuQ5cScalL+oT3BM\nOqiFLcYvjWHWgFvqG7BSnfBEEDjXy3foBh8MbrQ7taDzMkQCTxrkU1ZSYTw7\ngGC4cSqz7z7YsIli1nKlhLauVvTzQ0h5lLAB8Qo7Uvu34kMe9zf/lp4ne4n2\nk7zV64OJYuZuivvgVYe9PBQCROsfK+noqMGrEgGsImkcEZovqLq/p6gS7Clt\ndkDAWJG0xCSwn8P55YVe1ecXn6brk61+1pOSykAPVYuQY6fic2yH6paymlNQ\ns2Pt0MysVD+6GvXiiBBB64FEomx8BDvDyB3hKglSPpPH2XGEUrJO0DC+2/Xt\nCoDx6rHJHXZMXSu5MB8Ypqx8Bp8SOiRtZ8l45uB5darBJdsjqmCQDvJXCv7B\nAEvoW2HZnx5PuI6JXyKo2bNxxLkTNzdlaiEb081M7v9S4lKT9QyxdA8HQ0HW\nsM+yfDFMjTrsV0u0G93OGOx8wSmBEHFHSbIeekcoEpR8Ork1X3mZP6Mzndd8\nh3pZRBfMx48Xvcq5wt9EMxZjTgYWW00BN8AgblBliKSzSN/NKq9t+NV9P33m\nhqUCDF4ENege5vYAd80A46pfDze9BWqP5DoCGD17omOlhC2pp0nzu22TyAUq\nP9cHfQ2TQZFhQjcGNSn+iShiDJaHZtLI43JZJEIe2Dev6ZYndXQrthDeXN9O\n4DSQ\r\n=EFuI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1Tp4EuehtfWxAhyHlXr6+2RU9ZA5eJSOt8Kjz8XSW6AIhAO9uixnaie1NuQE17816/hvRFzNQpnzEJk+7MyXwoXm8"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.2623884f_1544686200249_0.9577752146051655"},"_hasShrinkwrap":false},"0.15.0-alpha.f6659475":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.f6659475","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.f6659475","dist":{"shasum":"656699518eebf641446d937d5c85472871d9e0e8","integrity":"sha512-cfyPcMg74OZEni/D8ZaxO8in5TcdAlvYCEynpMwR1mClPmT8PZRsaEawwK5QQuEVbh8CLzzYJ3Mhp+wasjY/kg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.f6659475.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEgqOCRA9TVsSAnZWagAAhskP/jBU6Z7K54s+YSZQ/kSn\nQo+moaGiumRGHjp+LkPr3a+6XNnLc7q092nkdJlWi2QnT/zSflW8+INcWGHG\nfWiMwT/Sf5F809iCtrUQ1DvLRjvHDOhL5D4Bh7/L8oNl69L7JucgEkCING+y\n71dGOuoU1j1bX10DrXoNAFBhncdViRS8MTPG0imLozfpwZWiGemRyxcQZ3X1\n/CoUw2DTXvHJSxvmwFvyoStrV4axLdjUHtdNowbDCjFvRQfT4+Xp7Xph1pld\ngZmrL75141YrbIv59skn/RgGx8VM57UiX63w4ceOgIrPMol6llutWS6TjVPk\niPxGDR4X9ZLLb+4Sd86HZKqC4gH4L1wBzBAmxQMCGf7cw5FUt+df5f0IBnJY\nVP63eQuRrcZ4OsPJQnx38rtp4iNMS4oE4bFDtXR/B7E07DAQ7c/LWlgr/Bd0\nwsweTLBP/Yj8lFCbdugFe96JiuytIACzgukaZzTORiZe5slXLLvyx53s+7qu\ncomdW/uZmMCt7AjTGPl192hrAt1drbheHMpHjRXyKsnSZRsVPrMONI826L+i\n+65xtDksrhQg19wbmvlZLSyjEaYIjm4ogOPgn0bTH+oCRKAb7iPY/1qljapY\nxs4kx+EixZ2qDUybJuUSee/q8PrfYmxV25tyG9o/vf1M/iFC9B8puN7Br7HH\nSPu2\r\n=YyhH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClosWWxYhdCklCLAVFi3S2+PR7wjNOzdEMx+MrjFExrAIgbCxMBTioHgt5deiVfxA2iG6ojB+EyGd9wHd0qx1cEvc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.f6659475_1544686222018_0.4955279774567136"},"_hasShrinkwrap":false},"0.15.0-alpha.ffebf0b7":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.ffebf0b7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.ffebf0b7","dist":{"shasum":"bd05ae25d2fa48daaf2bc6345790646fd6db5e82","integrity":"sha512-89FSdjDYf615tFUJeoyJKNpgC+XB8wf2ZGG9PyQjtnuSe2XlVJKSTCmym0NM2Pfe/wApL2DMjRJ0fnxJ5bh9Eg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.ffebf0b7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEg51CRA9TVsSAnZWagAAw2wP/1bCaRK/jm3WKrJIH7Rq\naZ1ksINHphfYd1U/lnFhEsRqn1GRTnTifHHEep8NMOKS1nF5TWu5RstxSPa7\nIshLJ1iAedYxcLsv/hplWsfZ/v66/n/C/n1Y02RC756FL+hENnvUREhErtgf\nE5+xsJMj7VbCnPt0ew7mjfp5RTIt4xzsqrFb1pCOPi6NeArqBcHmybuxVvRm\nlIYaO2qtTkzAg6qaNr0A+y5Urg17irkHSqf2OyOL+RO8wUOh+kVbeIwLlclK\nHHXndPiWdqg63nAv379ThUpTOeHRdE9+St9xOVpXdxAdmauiCYyGH2vPBWy3\nWay4gIMdrvsPOBZDryI8IEVl2B1dYLCy470I/Iiaqtt9wNVlstRtx9MuEll4\nmROs52rBUfcplVslel4yr92ZGR6TrsFqkubdxiNJLJLjEo58VHkQ3ITzJZPF\n98NuUoBLXCH67Br44jWvgEaxHnttszz9E5tTgwf1UwBwJtZdnnY2/2gFMlyg\nlxRDif/hyYOR2eJyykvAqyqwUOHqm+xTdUVomMQesT2RG58cIdEGh6Hg6qht\nxO90uf8b5VWhxLmDQ6/kyYDOYNJOWHIFbc7pOoVe7c0ezsi3WuZDrhfTggRV\n68MN2DV0FhtAoIYXFf+zuZjxCZ8rYr64p0E2lUlJWc2j+W4k++UgyN65V6q0\nNB23\r\n=5F4n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE/LQtVyq73PtwCteYhDtTppMaetB175u5zEN+QToF2AAiEA0HlE9iD8uZctkwXATyLF8UolsPOc+9/qjYFpaMivJXI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.ffebf0b7_1544687221181_0.011432834621513566"},"_hasShrinkwrap":false},"0.15.0-alpha.b6e2ab26":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.b6e2ab26","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.b6e2ab26","dist":{"shasum":"71ad550f68888f79ea0eeeb919ba5bb9a35eeb47","integrity":"sha512-7jlGPhzPsKZX4SIL6dgE8kOvGUcV6qqmyu52flturtqnQh4VeAb8F/WHq1bbFUcA+xDjFtsynkcOrNhB8XdaDA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.b6e2ab26.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEg+ICRA9TVsSAnZWagAAZY4P/2HKiEPs5IzMBCnKo6Ux\nSATlZmy9RV+9UjYnKF5w1mnwyjyyumEaAIPkw2S3SdA/S6yyGe43463z2fKv\n7WYzBx50J6G5MrUW4fgLOhpqBWFpRtbYes0Hn/9eFTn2BoZ6I6qRaw3wY5LY\nIiDqsnOSxF7jbjwq7w3wBwkIRm+W4xyamMjOOfjigiTOOtah8hQNB7Zo4eJz\n/KwOUJMF4tHTNry9PLywrTTiMPyI02v90epZoPPmFKRVynCKG6ap0Ahy3NWc\nEjg3hs/2zi4KLoRJjk+SyObw9bd64PmcMOIFj4bLY8U/qebUVUQpTAjDv5zy\n46RSorLgZnDmhZVoNWUplKzf1mxeiHYVMVxXkTDxD8guybf8smpOoeXsxc8f\njOhZkyUOVGlD3Ixye+ZfTleZ+FNmI0HmT1m80f2pXX1cyE2msRuJCb2D6oQZ\nq5cPIsTdVl62KmYwk9Yf7x2lnA/gXsVRoxtx33akc2x2LrDMwlSWlWAhslJ9\n5iXFgZ1oqlzl9JHNI6optBd02dvg/roVPnUhepnpAkGTI6pgHkPQbhiEZgeX\nnDvT/aaMaOTDXxGOgagwIjBvrgEBwD82XQ9pqWdDDkhG3meXen3xMkdxhGv4\nfRhTYk520uWCN/RnCKhUx+0dg2TiDla1y5btqGqEfKQvriIYiw+JGcydn4Nk\nV9YX\r\n=UsiY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG1hVwP2Otehg6XrnV7XAdFP9jO/Q/RhgqfMFA4VpbhGAiBr5moUVAvNmUmhadfHPRQVM2ESOtXmiEhSbzupD31xpg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.b6e2ab26_1544687495618_0.9943210827795743"},"_hasShrinkwrap":false},"0.15.0-alpha.72cb4967":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.72cb4967","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.72cb4967","dist":{"shasum":"c0617fea21abde66ac9c39a66635cfb4a7548bdf","integrity":"sha512-J48QxlfJlgFBfBmAPxHmqOP7tRb4JG6bhQC1Pi1uNVjDnF7GXCPeMc8OGtLyx8tMn6mmZk6z0rpSadlKSD/cnA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.72cb4967.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEg+lCRA9TVsSAnZWagAAoFQP/2dlSWvtNFJ50fGW4xRV\np/osGfKhrdv5B2l4MryyXH7NHcArDqa3dNkc8jUJZaNEFI+/5eF4YN9xIbRy\n3yECDKdcN+SsbZbryb31iEjWWoUO184+DjkNfmEFPGHqMERdYjTv/NvA684B\n4H2JaYZ0sFQ2m4QXdjbmK9FzQEdKzgUuQmrndepOeBT/0zdmgApQDwLOwgxc\nOICZ/wWBTEoL80+XaSstFWnTlM6IIygHAx02SqOcyslter7RfUmC7Hrepvmd\nINYtH2RA66MHAT3cX6yBlmcpfmiX0qoxhbr/RNIgtEzWuyn9gGcUhWnwJWo+\ng/SZz9mwwvy3d6E4itwHZ1sIq7Fk3sWyko+yoaBHNTfh8LfLeX8WxGcQlL4o\nEoTCrWHL31i1zc47XJFZyi34/85oOVAlR3VBxlZFsxmxmzUzVlx0a/BjH93p\nPwEZNULq/tlRBrU4coH5dlfXsPzhEQftImuWD4CT0EVf4T2RgWJ0EjW8ZwUH\n81on0nidGV3Jyi6vk/1/d80Cj3ioVJi55yXvt4V/r/SJZEl8KcEM4mo4L/RM\n8GppAV6k58lZogXfkE0tv0GJCbVR+Qqj3otcL8OTcYDixM5Vd8V9OoxOaTw/\n9RxzFZZbwtHvaY5KaYbD2HXTzTtBDw8LpWFoHLfbSV8YLNkaYH19i8M+rk8l\nXiYb\r\n=QJtg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA7vJwpKiAdSJEpJM2PxfO2woaRwHBWcC5crlHxeaPFGAiBIlwqq2//DIjShHM3RUP8LbOXVRe8AeyVh8boj+hDGuA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.72cb4967_1544687524709_0.45159256946855186"},"_hasShrinkwrap":false},"0.15.0-alpha.2055b637":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.2055b637","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.2055b637","dist":{"shasum":"61cf1976bee5c9cb77ac554c9dd4f1e19b8524f9","integrity":"sha512-i4x101n/+o8gmXjVvBlGcarPzMd1GOd7bLMYvbJoOXvgf76BZTxFX2fN2ef6c81TES0wmeaV9PzFye2C0cYY3Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.2055b637.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEg+3CRA9TVsSAnZWagAAaHAP/3r4oA56su7bYc55thQM\npWInSq32+dbgDpgUVeChYqySdGj/po2RmmLvY/DeXFe+Y4JWLbVt63SfAsR+\nJpkhQEye8DSWAjw1nXdDNq/NkRpQIlTonXfcaj9qSTA6B8dlVqlwGg6UgSmP\nj7AYZxVeZG4CTcfMHPcHebcV+jEbYcIZriIWAfYwgcuXrYKBtiXhqBZCzOc3\nRLQ5akCpYhYpJw5mUN6cFTXPSy0sAEjgMOvLjsdgueiPlEIMG+HOUOYmYRBG\nNVViqMdBK9eiB0xyC8yCQwdUAqbLvsP5WaN3AZMtlFcEhUIbnyyXcmDsmEDL\n5A5WYLopT0/5A37tuQHDyoPIuKwEqQ4MqlDY5aR04tGo//Eo4q/r0ttg1aQ/\njjFueSk0kh9aqeaSEiaWHc7Wf947ekTua6Z6XAX4eQaXxrYSoN/dNR1/8zrD\nFGhaZR+9HyOb+LtcZaAQFNccHP4oBPG3CjIHQXCcKn5ZEO2a8AY+mVSRE1Gf\n3DlgEFnikiyBEss+jRdTQSFRAxBPeWCW46UMRM+h7/cb6q7wIes4HQ7f7xkN\nMJp1LCj6Z+IyCGPhN681vj+WDUU4QB9lssKemEreGfVHqmtw+MczMCI2Iwbk\nMqWRyCAkL/oUqPuaBkKGRlICo2NsgJBhn6s5va6fwDGmXL60fxXhd0Lreoh3\nECx3\r\n=3w79\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkvmCw6CpK2CFEcbheFO93v60daUlJPGIuqLg/XX6KeAIhAM91CfSA/pdy/CJYfn5OxmfNUvWTv/VJXnpS7OliGYBN"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.2055b637_1544687543133_0.10995652215895291"},"_hasShrinkwrap":false},"0.15.0-alpha.d71330f1":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.d71330f1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.d71330f1","dist":{"shasum":"f38338803b774e11c8a8637fbba4c48fc8248dab","integrity":"sha512-AlhXZF+N1LwWCZzlcrCWqy8ObPmvAYKVKiphshXGGBCwu2awAqGneeQ7V10t40Jr1zIDu1MA54ErWhL9niOsFw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.d71330f1.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEhCJCRA9TVsSAnZWagAA7yQQAJBTFsOqLWD5ANAo6qH3\nVir4CfTPlD5GuyZd1uUPS2RG4KRs7iEnpKkGGIA2k/Ezrm+NtXwBG4h/GrQw\ngXiMPWKDe+y1yBXKLAZStOxN7PbkYhnSvG0nRoXhPoaK5XVve7jtg7NQiGFD\nC762TH9BoIze5a4GBLJ4i6VjqQ0pduLlym2g1I/ielry8vknowj1Hvg818AF\nt1Der4PRJN6TYVi5/Yh7josNcuDL3EB0cNOpI5EtxvWiUoct/Wl/ZxdZD3IR\n11dDFKtVa27P5Vw9rAmFJCZzjv9DsX85LvVSSGh1H2dQ2EDz4dsAq1cDzrex\nKfoWU5PP7F9qwV209WpyQMxUlFB1Wp02PxIUNWvkHNXrSQFOJLdq6Ghl8SL4\n/ZBGCUzIzt170eHyudveg/sDaEx4/UDq1xZJGmAybJpYGUXwNAfvnR079Tcj\nHH6ApABFF/+oiFoAnRowkA5B0xSktd6ibdeppEezkFx7V+2mwb4CIp6V/Sb6\n+Xk5qqCNgvmM6N0401ioe+H1PAOI2pNworIqqm68JlqrQpIPT3PEoUDB9r4Q\nohflXW+zMn8frKgFMZQos/sEYSltG4JuGfDNnxqmEPLC+/Q5vm+BYkb5z48r\neC/2QrD9LgEKBxF7T0wOT3dy0R5O1S866u/XvmuUgdAbb1mYZf/KLFP7Hhc7\nELsY\r\n=3ryy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID0LgSP+e9QPw932rhtPkqB21E5+G87yjR1dzJs1C2VgAiBIRULGS2w4vMuJ+adZpjVVxFN9mvRerC21/wuyQdR6fg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.d71330f1_1544687752633_0.5665027509507319"},"_hasShrinkwrap":false},"0.15.0-alpha.ae2fdd89":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.ae2fdd89","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.ae2fdd89","dist":{"shasum":"fc5775017347dcd2bc97b6f7674ffc6d476af393","integrity":"sha512-DyeAsx/AqOhJ5e8nGWh+ZQ/iXHKtvjRljxPH0ykkOHDW4XQa65Pmhjuls+bvxO+FqK6FUASF36H+Fsq2+toEgA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.ae2fdd89.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEhQKCRA9TVsSAnZWagAAueQQAJCPiCVLCQ8h8bTnUPAt\n9Eqshjtzs693pXu1fjpUiIsM4V/xZ9kTzpvAmxB7lOpwib3/uXkfJvuiQC8M\n3dYZdzjpVbOloosbvEO2q4uQlCZBVHHpIUbmweivjzWPn79QLxRPB9yBuX4b\nJxrqvabywCq+7f32YgiwTnYHpcJbWcMtLJUyiKa8RFpU0AMywH7aHzoN0aOr\naXAzbZjT3OiZFFFIVBDTTzQzNOhbOUF/C7Ofxn1pk0YzYmFqBo2Iy0V75CkQ\nGwODEoinjLVczUEQBt5S3KDuY+WjWcbTq3fGB4z7Ap8CHoRT+tmwQmZiSwCv\nEkluPssuyp4Pc3DinZZOk+iRR6aJSDOnJqnb8uO5GDwfCeUu9Vxr5b3iXcJ1\n9j5x/e0tNaF/Gekm7Iw0mZ+pcl+yxkO++YyfceU5Teqi5b8dsD9D/Of7fR0C\n4W4Bl/sfX9KHdOKeLp4HGRCuW0pfjwHAEeo+kFMxgaP9FmSrpZTxoVdkQQ7k\nIlyyozE+lMGbbLDZ6x5OsiTXk8EwLgUiY8IQOz7NQrqe6ogomCalF6yE06gC\nsIZnwxYO5Sb7gyyECuLECyoCbR9DuyHmFvXt4gR+hH4RZwJMujg3COy5WFDm\nWP72VbVOykoLLh5SZ/mQ9lPFqOc345ryH6Iguu+BDEXbEx1Zuvei+wSTHXKp\n4x8z\r\n=I+Wt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCL1ZhX/fcePUxpdn2eLmhvA9/doZ5ecEdJAyKTrbRRlwIhAKOYB6jsqlHllsNYsjrFgJIE8/Z3QWgskpcgYwSFye4E"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.ae2fdd89_1544688649721_0.6857155753804183"},"_hasShrinkwrap":false},"0.15.0":{"name":"codegen-templates-scripts","version":"0.15.0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0","dist":{"shasum":"d34ad7c6b8df3c298364828e8e61e2f60fb4b3ab","integrity":"sha512-+1Elf7H6vY3r1nHEMXQoWIdluYHlzUPawfbdYnm9Wnemd9yxlfqNPDukSvP9njdJUBJJji8cpQBTYWfxxCpbWg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0.tgz","fileCount":22,"unpackedSize":16711,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEhT2CRA9TVsSAnZWagAAq0sP/iove37jPjV6DP/Ifn0+\nBpKiEvAF4GKU4V8gVUV447u/gRJATM86ehjEY68l4wG+ajAGeJKaxAC/VLpL\ny9ZykIzttsz3I/0YQXYP/V2HKTJUecKQ5/FVmZD5kPZAW7A3imgjoM73DiLO\ne7G8WRqt9oGpsMK0JMEoT2v74NyQoqPVGUt5RW0kfDtii/ay/xB0UrZy41b/\nfECwGeYk0YSsR5/c0JwETdGgXYoGeJyKTWnrM2dC1ylPduMOSoMTkvJqk2N6\n0WwPAHKDeLXhR2/2Pz+GLaE7G3DuxA+HyImXonLfr9y/CwmbseMgcAbMF3V9\nguYyQHUb1COZ0iJ9MsXaZaBLgYG7W/Fuy4xbk7dy5okHrSKPTdqvjeukG/6u\n9qhxoQ3T0p/mAkC7CsE27ttSU+n8guNGZu5ifmN5WuQXWtGEa9AFQInuHwt3\n4c8WW4mBi/h5sofHlLflpFnEeTbBel7macVMwjsdLMCK8vmh8TIqarMt+HRb\nb0ztg7kD6iTj3LyPidTErd86zCNe2f4oX4IQAtZAxR8rVL0JJ3rWeStgVKVc\nIjSDFGjll5BRX38eskcjp/ePuSBzuBg0uqpTR/pgxLrhRIu4GFZ+jUIApcst\n41Pql70fFg8QHregnIoAbCDiYOukZ1CMnigJ7mCA3OmusZ2rvMwMMu/sJb5z\nRqbm\r\n=cRNt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEvUFplAe3BgVxYwoHR+xIcOAjOnohakuFxZ7rJ74RIYAiEA/VYK2r9Hk05fmBn1VWLVOlUJ73/LzqCYCZoufPB9Ceg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0_1544688885525_0.1261425760303556"},"_hasShrinkwrap":false},"0.15.0-alpha.c82ed938":{"name":"codegen-templates-scripts","version":"0.15.0-alpha.c82ed938","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.0-alpha.c82ed938","dist":{"shasum":"a5fe2d3e09e76bb45daafd42920d1f06ae61796d","integrity":"sha512-ST3IVaFy4bYkC12YDEquaV8i3+DpxAmE010uvsozx+c8CSjjrpqa94TnmrWLfmGdX1FU/LOsZWhOTle6i6ra1g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.0-alpha.c82ed938.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEhU5CRA9TVsSAnZWagAA/kkP/2oRqQ4Eu6xZH0jNT8PM\nXd0dC9kz62V4+P+A2gtDBYoExMs1RJWePSiCfPLnLeoE8RLCnPq2wfzZgto6\noh462HZIaONYpUGFAJUESeBJgmfMEur5DGxP3jfWqTsnAEZut+wFaEu4pqx0\nHMY3WuA0wSfGvg3EQcjdOcbCx1ljHKWiDzL0WMSJyetI20JgBXJ5cdQFrN0B\nYDM7vGgpfYgXgEJjAEfCmgecxozKpWK9IFJaeM6YjUGWyr49v+nGwF/VFTVu\n3V5w+g+D89sMQDXZCpSRhO2eVAwTk58Elesl6T6qIgKI2ApkZAutZCUbmMAw\nvN/KgeqL4PnJeHkkIpVQUQf7i5IWS1M+aPSJHxK0qpApZw6P4/ZJFB8XnAHV\nyK1j1t6NnW4Bt1cae2mFmdfRyBPQVkNvVK4Ers5DYLXeZgZEIb3nMd0EwC6j\nBd6i7CYhIDgEXgHQ3O2oi4mXCq26GlozUMDYTIe13NQv5pZ+7LBMF4x2wR8G\n5NSNMuyfVAf3jVJNYh0lgydEG90uUkYCkRh9sZ3IcMFBhpZD62xf2Vbl1tvu\nEJuydIS2j1PER+F6dVwsx+wuXaSIW3bkhheWyJfpOwo5AfGr0mIiiZgz7KYE\naSHnxj7QAor9DisXFiI+74Vz8IQyR3jcYZ+GUbcZFhiyfTS7rrepE+tL9XcS\nG7EJ\r\n=YCXi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtoaZeF/JAVR7554hRv6wtm2TBpUu+Ia6fii6fdIQ7NwIhAJzGn+WWrFMfCM/yP/iZQR73MP4ZVf/txOghSPQndbF3"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.0-alpha.c82ed938_1544688952601_0.6645363265521351"},"_hasShrinkwrap":false},"0.16.0-alpha.9ec75633":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.9ec75633","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.9ec75633","dist":{"shasum":"b88c46c46dbe334e14f1e9435a9b17ea1f817f91","integrity":"sha512-cRDT4ZTBMqqAniMVyfkEfKCMhYWt1fx3fl4T9WXfVIDK7I8tAdJPLnqAEq9sLhjo+6KDWIOw7aap2MDWrxEM7Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.9ec75633.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEhnLCRA9TVsSAnZWagAAh18P/3o1GaTSnwLoobW6/YLG\neRx9rS8WiYnzmtW06diZ2Lcebu0Wl404siD4N+Uvl4OewrsHRyBezwKsRkKE\nhodTM0VLrsEIuUocpd9VlQsAaF/k3Rd7IA9mmPerBuk8hKfGoFjsb6Bkc35t\nFclH/Q8FXqt0UXM7tLY+bMWK26XVzLfZr4hsRQyGctT+MpfnrPVyDnPbxk9U\nZxS7LIpwY6Ahcge1QsZ1pZygZXVTDdWdAtc7eoAwUnbnhaek5WrridpuxpF9\nkLLXl9uqu48khB30PLpmISPMgs6YZ0SPC3kxgYUd/Anmmh3mkBNA1l4MvKyM\nMddy25PwVNBCTji10b90e2U2Q72LVHFrvsAvD6r+Mxtbffof6kSNR5OG+odJ\n9SF6jkuZbnIUi6lW8ca9otAnJNk5mtJfdWawLlzWmgBTfZ6NAk9NJuRmeoAo\n8rL5zJpGH/VDfnY1/XDwDZsVFAIRRVyAOH9WUhsKtVQ8pnMpy6BpuGkBSA07\nLusLVSu3nb2IwUnbLsPs2HHIP3kB+M23NM2Hu28CHi7iaMWPdr4lADGSYdNf\nxdnviN7xa0x478Sm7a/wSQOi0K4xKKjbvE5m+xqoIvCaBdFfw3Qp34HbSpRi\nbyE/++foohtx7ms2Q1g6tMJJNeH8RT3qMQiyt/29ONfTKDNpxCp6/CSkQ7Ne\nGsOk\r\n=azoK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4ZyZ2xTSAbxbJezAlG2CgLnaUAqOZuFE6gOqgVk+JOgIhAOiRtzoLe+aYwCsw2toRj86jxHO/gEk4z2ZgBkEvqiYk"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.9ec75633_1544690122448_0.6283646004377916"},"_hasShrinkwrap":false},"0.16.0-alpha.59617a10":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.59617a10","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.59617a10","dist":{"shasum":"309d63baf6fe200729d144a1293be9ff62c3a797","integrity":"sha512-AYSu6in6qfBG89+SKpjI6W6gIaSfQNbRR2lveK3h6sBw1Vf3skE0N+5I6kD8b4/5oNyZflxV2P+SjfZo/BKc2Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.59617a10.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEjOrCRA9TVsSAnZWagAAitcP/RKOOcSJTOZ2ZfZZFWw4\ntm9Fo8U1coiySfPevncGd+Acr/tSI7/Nu47F3uNTwHRIwfuu60TC3CW1bOdC\nj7/iv7dRfGrL/TJUpbCb2OvYh1Sr+VQ/HA8EdrJYAsIdhy3ZdE5t2NzSSQDF\napYKgdE10ZuhsUFY2HGgNGlNyIgN4nEh327rWW9RpNCkJgmQcX+XNjw+wvV1\n1ax1+3abYqKK8C2zDdkG2LmwFJffg14SPB3dATgPMF6jRLeSsaOONnZbiQA6\nr4ZA/oamu93uvdlGlLRsN6DVDeSCWtGQMZSEunekJlY2NytjpZ3lkBBGhw1r\nnud2meB1EuB8MZs1Qns+oMb5a+KTV2AgXNJ7uismdlyTLZPK+WQ/m8ZzUiNs\nLUPvNwI6trHDipC6oo2nHfarpfkbT/0QZalJ31FVO8eTbmNhkRBfOYZCdMQe\n3lrzLQqUFJjLSpbp07pMu5wcUblmbJvctTEtIT+AC2K+QwjX6UY8dddq9jUM\nPHHNqHau2k3y/krZYxahASts4pu0tN2EYGn/jYrV6tka5zj6SvwoZwJ73IGI\np33TIIe7SYNJ5M9963QyOnrxs/nP9mhICQPCrD9LxBhtFDlcxdc78a/9+Nrz\npHPpXm2kxmuCgK9BGMoXfGIHExebH7EpbD9ssMA9eHCGrOMgCGZBolR/Dx9/\nUHzz\r\n=kkmc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDUuBfi11pisMXXZNTrFUoCzkXEJ2NKJnrkQhG56OYK7AiB3BkYm3enzgW2LmDJbyyZxAQm8nQhxo4d+edc8M+2EQg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.59617a10_1544696746904_0.9030354632703803"},"_hasShrinkwrap":false},"0.16.0-alpha.40d12f2f":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.40d12f2f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.40d12f2f","dist":{"shasum":"b3303ecc821efc76e742952cccf06a0adf1c56ba","integrity":"sha512-1noDzcivI48N9SAx6QK1SKvdXY2pipPu6Xv0pCmUH9q40v83kPFqVRDkt9SmwZ5pLtVUOeJphjYchMZuKGBxoA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.40d12f2f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEjTBCRA9TVsSAnZWagAAFMUP/13eurGogbcOylVCSOqY\n2BBWRnIWX5cr9c3JzEHai82hL4kET99TY87i8actsp09KWXehgSuDHS9cDIs\nV8G7KyWozLzdKkyEZgVfqiMWF+k7Y1DsWd+0ayu50RWnH4h1BK132u8GR85B\nLnpCxZg1n3wia4LX1glg9sxwCs4/5CX2AgSpmPf9EajfXejrjWdBTKesdnwu\n5wiIS+KvywxUgMmEhtGvKSDxkBe82rlgmU+Rje3/6bMfBIQzodH2s/0tjjc4\n5wPqa97TL/hVCg207q/saoGTKSmd4bG1mh+7CooZNVxjtDhM/o+mXAsBs7mZ\nJcJwcefzHo4NUPjBd2UzDr01qs1MRIK+iqSWjoLAygZVUvuNYAs2doDHdZJ9\nD3UleQ+qOo+kJXEpX6sdG1C/YrIXfSNCI4Tz6cTeVNVlilHgS1TYMnw3jaI6\ntISIA6nviGtVORZgh6isyZjIvpbEgfqQZ52zF1kTPSP4ZR9RVq18xfBFeNQh\nNaZEJp885N8CPhCIWCQTckmBxK8RDdj40R4Sir3poVzDTPDNwWdhp9mv8eKD\n5DgEq69ttQyfIULKvrfb2ZlEXWrsUq8YHt40tBV5S9lfaII0hgrH3+AGtq+Q\ndx734Ccewqj3W2beJq36t92lRMLp4b95wlxHQGajYcva1/72RdXjtT1Ov3+t\nkNdF\r\n=PJV8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHRFjxFt+cVu4mkYok5umpRwwDW9RL+o/qhp709xrC9sAiAW7aAcEvc8Ts1q+afh86K+22rua+xnN1rRwsLl2EOx1A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.40d12f2f_1544697025060_0.6806733388768975"},"_hasShrinkwrap":false},"0.16.0-alpha.4b7574b0":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.4b7574b0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.4b7574b0","dist":{"shasum":"0beeb6fef552485b6f6a89a82d6bf92282c93187","integrity":"sha512-v6NLM4CUiey41TF1HeciCy8hAnNV24XMabFjQLlEkz0nCssJzS28oXMi7pM/s0FMiQHg03lr1tt291EfF0W1AQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.4b7574b0.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEjaMCRA9TVsSAnZWagAAW9kP/RtnAdJsve12+sdmJRNX\nqxwakx+OQjkE2tQI77ukUB/uuGRpH1gljiFbgWSE2S/xqUBUOP1+cekmYO1h\nAhBB+4iZYN1BAFWWLnDsPis0G/isN5Ogkn67nzjO637YNPA+SztVrxQa1DpT\nXudwh0SiTX6Lwhqj8QpgL6Z8sr6Ls7OXuAyCl7UAgrKT2JU3mpIf5Y/u+euB\ni87m9OUlRRMOUZbm8+UD1gZo6iZL08WUqaqq5f2R64KYJa+uW7IVEG3Q4l7U\nFy5EXxppXAhWa0H1dCkooPnSRvIaYPNPLp2mqgx6e4DLfELdT3QoBhpArk/6\n/VQE/61JhbVcWwvg8DdlR/2nV/M0aEW7wQGzS2VpHOj51km/OkKcQ02+ponu\nS5SXi8k8Sq4n9sbO8/YlNdFnajSPfXPf6dRQJ/7oNz8hcIWUDkr6SRoFA6ip\naOnD4veiS8481V4vhCNa8dUoBIZWG8QkBNT324C5wpWxQD4Jov4+/meRmZil\nzkvGpYgmKPmT59h1CSBEgHtQGkdQaGZFfVVrTuQiR5ZUxzJmPWABGE+fJUaw\nThF+JlVJgwH9zng0HAFMUhFLMPmtfdqIXaW6XK0LTQWQ2+joUA+BY0YQlOPE\nZTKDZ+zWzxQNkApU75niyXgU6vXDnDYQFWIj1yWyNMChG3bXgNKUvk+it71D\nnTfI\r\n=xeDI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA5C8OqPvDCLgJtK5eI6WydeXLZmM4YDO3hfF2Aib+o/AiAxnMIvhqTmeoIMK2yhHy1n/nY9/r6RdcVO4549A2b2LQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.4b7574b0_1544697484268_0.865047267116174"},"_hasShrinkwrap":false},"0.16.0-alpha.af0870a1":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.af0870a1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.af0870a1","dist":{"shasum":"220a1e6e4d472e37c6be6a88462e4ed6a241dc99","integrity":"sha512-SsR/n9aDT7n5sDY2zHAcEFxbGcP/zXeDSJk4ndqvbmS8lftwlMR8tjHEQ2VKdM7cD26JhrKN5llugAT/8MyJSA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.af0870a1.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEjeKCRA9TVsSAnZWagAAC6AP/0vuL7vuAd3aTptmyRFe\nWP+JW9ESpoVxTkzckoVwLWDWDGt8/LdIpilWvNCXfIOnXskSG2+eTtwUc/+1\nG+o4z5h7CgL/juuzMEBOK0Pta0TyJMkFTkVegtxkeUjZS6IdoZoE8WM0LeIY\nBwsHR9jFwQFUaaqV6UBjAJDAoXViDZJCDaaBt/bBE7acvbcCIR1xsoQB46aH\nLjwk8GKXTgyysPW9rleouX2QugNxVKwtWHvBKGXGoNMG1HKPZPm3sj7QRzyE\nL4wR44/itu5gEWCcp4xrP5Tud3qB57jHMfXWCu/KskG0u2c80OsqLi50XbYC\npGs/vPP5UHLNYV9c90C8ryTkcSv1R73Gf8ESaSzCsGIAz9kdlKVQQ9GIaRLC\nlNhwU8Uvlx3Rpry+DieSlbQV2YQCjqRKhdV0iWKri9/NxFXhxIM81xm1k2MV\nvTfIUJaBV8I8nLkT4P7rPnuJBPrm5ptt/IOp6suZDjYiPcpAMl5m9WgpwCI/\njfYusY0Iu0DAey/DP9Mwemx3MAGbfd2LptJRb4eSwhdF3CHvUDHY7xPKYP5T\ns6yHloSUn2gu2H4JoWOb98AEzMVPay6tfqw4iXHYp+Kw02VO9zzY/MheLTV4\neyP19VpjB3E4TiETWVGYH84kDfa+v797FLVaxsEhYOkvpf+NFXNkPCs9p1lC\nR0TF\r\n=u9WF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcAfCydo0NWlXBklWFPGQ/EIOJHphqUZaccYJAz963TAIhAOh438M1FVzTKv4aCdbDgQkfEmCLqPdC5WfNwuox7Tql"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.af0870a1_1544697738219_0.0057191445556705744"},"_hasShrinkwrap":false},"0.16.0-alpha.6c5b17d7":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.6c5b17d7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.6c5b17d7","dist":{"shasum":"949264541b54e84ec16c06ec49f34926976b9797","integrity":"sha512-JgdxBANiMJR2XfMN6Q/fSqvqwFDBP8+rlRN2RdjwIWDsZ2UDEIdSePhN7LAJp7RZNVGvLpyY/aOsAq8Assw3aA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.6c5b17d7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEjfFCRA9TVsSAnZWagAAp5AP/iwKdIpiVPp4AIoB73Vm\nGdkaO/oI9VZc3wIvkhxazd66J5ruoPi6fJVIw4qyIcoI8v/AaNRn9TbbxtWb\nZU3HrmKdeNs5WpjL2+Ybe/vEeWTfjLDH1/8TohnZjFARcBrZIZJHQtlRdZW3\nShzDiJZxjQaPeSFLPAmP4WYDi/DBK4+O2im1IgLawZAdmlCjGYysOKE2Gk1q\nxvTwg+hO81XCZhxu40+l7dt8jVOscMqqOXmt3/CXbWr1o1BnbbO1UIsAjOFf\n8tsRx4dGITT7tejJ3rao+Il3eORJ8yDXdogfhf2gSwY8TCKhffDsTkEu2khr\nqyfFzP2hSiPHWNnyAKbdyphWQr4+xg/eTXKVhOpokogD++qHE9yJ0JdccQNG\nvHBM38GvLH3lEgLi46FmrO7XUx5NkCCRvSMPX/XeLAIK3dr+4ZaK6DBIiA6D\nEhvO2LGjay892h09vkyIdB1xv2lPsBqbGstHPcuJIS/i4JZZYXin6XU/GkLE\ndBNveGkDiVXTC/ASbVQeWszQU0yAEJ3Oqwy2zMwCeCphhLU2wfMqFxgPoOPe\nQLO2TtjdMoBMJ2u73cuyw6V0ftECxVSDiaciN2AjY/CyeBJ2L0v5FEMRd1Sz\nOQpQx/BjotTEa9nHlfxlM7oRIO2ywl5wRLUTVTChJDo+hgMDJB0aLX9aJzdk\n9Oy0\r\n=mBLK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGYwbWh3iC7AYowKN9MpAyJG5RhPomoXglSgebRXanYJAiEAskglAS5fH1rB4zEnkAmMcq8iHH20qYeYdyJ1MqC8U10="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.6c5b17d7_1544697797283_0.9830611522764379"},"_hasShrinkwrap":false},"0.16.0-alpha.d577a1d9":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.d577a1d9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.d577a1d9","dist":{"shasum":"6c01fd8f9e459a02b2a801a334f84a2f5dd0bf23","integrity":"sha512-24EUTM/puDk+eHiv3bOLSj9SktJZY6Ki0xuo4lSosOPDjjUEGt45RyvfisGEM7nnfFh5vHSDvD96iZ+31P8qeg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.d577a1d9.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEj/8CRA9TVsSAnZWagAA0WkQAI0wsqSjbwdVt8LxSizd\ncv32PGCp5CdiB00kWekaLKGi7NvoJ1jYJAJyAPI7Hvh1wA63a1WNse8NYmYC\nSdeHow39uOiQ/uehxOxTnBaZ/Xqmi/X3XBv4M3t/SPJcxiB7TDG/sF1roUMO\nyBwUK1jv7aesVn+dcpc8rOVC94e7ZCnL6WTCreuUt/kSxLbmtbFuiSMymYdv\n/YR/4Emz0FxWKsI49Ininb6RAtiCGTUSHr2DKZ8XdX0XDqcYLx18K5ON9e/r\nIDJdmchIl+UdsenQlWzVbuM2LqP67SRBoH8/WTDfxxHHqa/VU3nwyPp3nsfb\nPo/g3z0LulvcJ0Ek69CB+hxIas3EmYyMxkET5akHshdyOMETnlpjAtbOusrD\n/dbJMgcWUloDml6wxR3eLL2LKIEReGZ/Cweazq6NFEc/X3tBPN6JXeU544pP\npAgQS64uvM1+f8GNTfjdaeJn9YU/4IUO2X2EHs2hH3NH5CCweaXe5lkCTKhL\n2pGbUxHNUl/zrFj3nO2B4eBjsvEIIjaFxumIcOesdTz6yXxX3ZC0YziEMR5S\n3nCjweNA6oaJ9ZqPpuE9fg2dbD8agPUvITeeuiev9FucPfbItubKZ6FLtt7R\nAqneJMu6pmPP5AcTBb5gRXx0qDghkwdKCYypS60p7iPwAJ7wYzDHVFRfC2FI\nIz7O\r\n=3M9x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICU0fh1TB4QPcn3CVmX+VQz2Wd6Zv+xUqTjvPINTRc/gAiBgIcaRZ5UzQt4oEJk641kNC4QDgrLy1MWJBN/h3PRdeQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.d577a1d9_1544699900298_0.9383344562301226"},"_hasShrinkwrap":false},"0.16.0-alpha.99aec14b":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.99aec14b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.99aec14b","dist":{"shasum":"eb0adcc545c00c885cacfbcc4ebb66ff07953d17","integrity":"sha512-UH4aIS6A0vRDltzJtiMQYE6CSrj65R098531TBWAlqxSxjkDwBBQZ3vUGIyHe2SvZoX/uOaFKw4/Rf8wN7w1jA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.99aec14b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEkAGCRA9TVsSAnZWagAA3fQP/iO0Qv3L4hzVcA/PRmjA\nx2plQk/ZQcZJri7WI/MPLSeqUQtIu8yqi+hAk9BwqVcsIum8fRU1lKf1eLXr\nHzK42RSB2OcPGLgaw6+dtO4nPRy5NwxQWivrVU9Aac1bndgx619XUzsdZOAc\nPszXjwKxSdjynnZXSzjoi4bjjWIhz3cTPeg/iUSTRHa2mnTWjBQiyB796Nhk\nZoRvK43nnIYqJBS01v6Gd1wRePoPV5qqf9rNcfz+SE7mzGEMDhK/cpgvbq9W\n02QwhXEquUNbD8WW/hZ8mCOrgHeq5mwPJmiRnu8TsNqMvLTZLPfxW+4B0jps\n9v0CyHmtAO3c/G6NW8ck1nQev9K+iXKFcn5bnokHDCeihgFNhFg6F7vyOt32\n8dHjlhH0S1yWxsjPL0ESzgn152cYIC+9rP/sbWFmGMD4GN2yywDjocwNlDoR\nZKu1sgU2XsV0sEpBszuD0ow/XpBv7qvV7XiXyek66N5sf/21rpDJFdbDrlDH\nORRuMU5PCR+DvoVkbZ7QNA4n0X2BQoBZP8EpQ6aJAVgJ928Z5zcivcped/DO\nqhWyUCRHWS0T46p3tBxPvTjbwcq549AhYCiBLPcd30kpIa3o6S274fR2Yqa1\nzN3fbbq1/4WCeykqPFSlZ6QRAJAyXVG3HYaHAmVUPzj/s8grxpyLwz+/NTQF\n7GZ6\r\n=mTTF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC7LCNFqup+slo6w/PVm8Yxttv4dqWOa7e3K/BVD8aH0AiBsicYQ2XBG69TXxIRYztuCVf68GM+XALpZPvCpUempzg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.99aec14b_1544699909673_0.6419200053453125"},"_hasShrinkwrap":false},"0.16.0-alpha.5402419e":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.5402419e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.5402419e","dist":{"shasum":"902a0e3ba93293c2d4591a430cde4d2ae41300d9","integrity":"sha512-tHnlGeO2OKAVKGzK0MmzK7Lra9y8ppJ7tOF1hctM46Er+UK5M+4A2roOFY1fk/Bm9Ao167FgZKB6KEwhjTFBXQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.5402419e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEkHGCRA9TVsSAnZWagAAxu0QAJpP6xYGXMOX8yLwh8Vq\n6mX/F8kWIGx900TxGmRwEcSNYb6RZdg7fLT4MF3poIb1KILTEobpXkJ2wUag\n/iI1jtscdlv1OX/pooUAzz1jHi+QmVYJ5xJYuArwodDBNlMLu3iLCV1R9fYt\nYv0iAR6fYl4ZkKmAaMTEHupZzvFoL/nmYG6nrKNc0qE2KbcNscEgYt0cLGrb\nkS2z32GJi/3h1OFTCdNj1mwmjYu+gpXYvw9sKFDp9MeMBisFBK2CmejN6uVj\n/kHoJq6u1po5zn1JtNBdcELzAKLUFx05W8BvUhIVwS7cC0YM54xZ1bq4PU9p\na7ye77nMbckxcLjoXvnA4nwYvi5Bo9VVTI6Ib/Y2V/KscgX7TBg7TD6SC047\ne1Wik3S0lotRP86MdGpLRWoAliorxWKJPy7EKzo94qVjZc4Nt2PLEbUczpPQ\nHxijrZEaOksYd3J/+RQhI3/KdlLZAq5AdT7BSucrXym61MN5LUZDW80Ec2jR\nyJv+wvQm7rhKw7EReWw7Y8SKrPQ1YxumXm9y2tD6nTd82YsTmb+zRnQCWH0s\n895+aBso6QMJtzvuPCHnL+/AUc2vnobFCJIYbxNddYEJh5Pjh6nncvUtHQ19\nR70pTOTPWkS+Uk5eKVob+D5KT0MsIinEVvPGKVceswpwkGHsH3zKkWTr9uDc\ngjgp\r\n=qMHy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOVYz07nYZ6lIGX+Hpgpv8XCgP1M6t9Cvr4tDc0btRvgIhAPtxTirfnszmSlXtzNRmDBYiqusCPm62L+uWsFkRhal2"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.5402419e_1544700357942_0.8656899241390246"},"_hasShrinkwrap":false},"0.16.0-alpha.91191375":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.91191375","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.91191375","dist":{"shasum":"0e4f57c8caef66a77c14d412a84cc5b0394acf31","integrity":"sha512-5YZL9PBmNtFtOiyIhpyO/PFHZnu0bdHfHyQXNTIi+7/TNlDjoPQ0lw5YQ15GPAKkpRiKMLESL+jJqn/LyUsE6w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.91191375.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEkMhCRA9TVsSAnZWagAAGY4QAI5m9ANQ1EY8+X1L3xkY\nqYgBUTANkQZ9KMRWbO2kRRqrzXjujEf6f68nEpeMkydBN7WtIcP0TdCeIwrv\npUcu5exeVC9l3ujjD5mWhKM3WB/4jmkhms8+p+nF+15Qu7dY0e1pAELIyFrj\npb/IeHfvlli5D7bCvZy7BR1Dfb2xaa4goHs7AeCwEY7M64PvsmMXA0INhDLY\nY7n1hoxFcSYoM7jY5tak3OIAsX3USaRaydWc9aeHD7RY+GORL5oNgS9t1Vsg\nlOPvlNBas2rEaLf5m6AQgArC/HcbZ/shjpMvEVAVArydAdO+ZtpCYQsDoQRf\ne5NFtur5PQDObVkRiw3stNyVzxMU88jTK1zCZ2ukRLkoM0bUciSrD+l4uJX/\nOxcm5eJxssaxgH3Up5MGPPbMo1C0DT+Se91/2W8HZw0grMMWtSnWmrJiZW02\ntIyF7cSEkrWjOpYZLJPtsvhcP1MLnEZpRRpNFyhFTNGEr7IudkGChcZzywJr\nHf4kU+IcdB7i+NNtEOfUt7wmnZdoPKf9KRuz21QbaF7FjAAXxYm5uDArakrj\nh074hBB3hdrBfp6lKT7NgfyvQ79vaLdfPG+LWIi0rQHJp6iZ7xLrkHkl+vgH\nOV8vbUjO2Uq8JiKX39DUTYADuYktsULRpH6+BEnE4dfFm1qCax8cq2Bod0bE\nRwzT\r\n=XqgM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZz4lAtYUaGft9FD9dAXxJcvhXcjJ5vwAmn7gPnKl32gIgKyB1UzMnHu0O47GWLgJaXmGB84J0j9a1CpwOUL9zgdA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.91191375_1544700705166_0.47291496365250896"},"_hasShrinkwrap":false},"0.16.0-alpha.15824665":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.15824665","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.15824665","dist":{"shasum":"cc32aa9fcd10add61360cacae738d1035ca4e774","integrity":"sha512-krFkqxUL8PeJTrJMH7OGb9luzNRA2SteYdBZ1lxf/HuUrS+MQTFwMJbFJ3iMQ4zKBw5cpAe8IjzSQcQJCMetog==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.15824665.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcElQnCRA9TVsSAnZWagAAk3QQAJdTlu7UJy6HiGaFdOMS\n4/6tUVpNW5MSbm4hdsONtd8uQa8etpNmYZObzLNyRIcfntNkK2HiRyDIjXii\naW099JFDA5JEgQSSPacDDtB5WNe6N3/mhegxYyENaS7WuXcx1ScHIIu25tB9\nd4ehmbgSzmmSixWAPk40GguSVmnQitlYEaJ89nIbefaTln8PowS7QHDt1XAL\np0xX+LI1EnLFUxlipPMAtXZQDOC90Sga6WoBC+B2ohHbWhYmnSUXMNy+Sr+m\nPjkPltcR9dN8Nr3oh8u0hxUTaZRetgsN1pL3Lb635+cQh7ayxXzpWOv7Yltg\nBsSk9z0lJn+UU8fbs8PMciapOnWpKRWVMtLCcSpsddWUJ+zcxVfrVw7ohc/T\nT3sPpSHvlfY1qugMLE1TkxyYLdqYDFX8mIbqbG0uykZ+mnUgShrdcxN4zlQb\neTFnIsHkpzD9uPxVYuIKr+5eNZrrt4ajpMJjK1cRMQTFe9hzRssYcRa1zu3H\nsYvraVmb1boTS/u0vzD1VxTPp+JGscN3efZw0cZ2Rr730+Cfl1LiPswth/2U\nTVckRPMPL02YKAo2lDUq6paYVvp272rrbAKauQxatQBoBqjGbk/gIrV27kWF\nI7hIZJ00Pgrl4gsRl0O3nk4nEce/DMLflkEbjojP2SRhqit2V5k/fncz+hdl\nSN1J\r\n=ws2z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHcxPFY4Y0IRnhMjRfFVY/UTEt7xjjlFvEzu64ZYcYKVAiEAy82pFSChRT0gNx4e82K8ZrSIHVtXPcZJPo132paW+1A="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.15824665_1544705063066_0.1934615848899115"},"_hasShrinkwrap":false},"0.16.0-alpha.776309d5":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.776309d5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.776309d5","dist":{"shasum":"f8ae65aa05cb4b67b515f754cf9f2c277a5dff68","integrity":"sha512-nBWBDfwC9wsAEalJC9BRVFgpyp1B6KWrdBzety3LgqN0Gqr93e2w8kzikvw59ZImOcYUmQUJrwb44mwprEI31w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.776309d5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEliuCRA9TVsSAnZWagAAVQcQAIMicogIlsbe1bFGtj/c\nxdAZyVyse9opg9s+YF7DIqBv0yT6cLnYU+BRB9v9BQ7UGKW9LBi59m02cON4\nydl7g7GF6mW+ff80b5/BxvY/3gyffYHW4PRz8f+qL0xPrSKB3yRP0fHkd2hK\nQaXZJ1isXnBwOdDFwDAGnawdd692fJjUlapICxa/5p+AjMObWbap9awx1gO1\nxRuO7kz5oF2+csVb0Iji1kt2iDdpKk2FTT2gQWFte1ZjDk5EgKv80T2x14IF\nlmAqGD4eH9BC2kOlV6Snz6snC/8v6tyLqOQuV/0szlP6dV0Az2dvVdu0LjkK\nmiYzATEADwpYdhNWePWk+eg4M8IY4DSgMvNxGXb+u7LqlfSMiexzvndNXd8J\n7tB44fSkhyG6MLGhp4TvrW+12qFIhrDlB9bplukIWYSp5KjccLWB0Oz9p7TG\nKiJx0IuhY1RWE3IXBPFZXfhIM1/Szyb8n2FTmXLOBD4kyWhOSMOAZRF3w/5/\noyf1xMGmfRumuEnGpVqmApNSqmiVMaf5BPMqrqTbvAe+mgxyJpPdYaBlaMJl\nSD2CuUd1NEKiLjF7eLwYF/xORMq/GcHIt9su8mNVM0sToaBP6zntssjIlTdM\nRbNoL4SjF1hko3VC3e2kJTfEZZijTxTWWHZa8MMl21IwVbkQlPEel8W78Ixh\nlSss\r\n=RprK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEKfyedV1TPu5nXzQg2IGOWyfVA8NmysWZ8x2qbDZWvwIgINUo2psrm0q4SiQxaTTy0owKNsjW8xxuiQ1zCjME18w="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.776309d5_1544706222318_0.945865567276065"},"_hasShrinkwrap":false},"0.16.0-alpha.207cae5d":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.207cae5d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.207cae5d","dist":{"shasum":"0b2225605488f26c02e2fd4ede53c8a1f32814cb","integrity":"sha512-m33ctsRvjHo4xZaz2r4py8A9yVtZ043mi9HE5S52B3vfoKlOmyQhEdn5eBzZ6d5xhAJlaxsCvasowuyJdZQV5A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.207cae5d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEmauCRA9TVsSAnZWagAAgpIP/0ErR5mTlcQJtwxo1nRZ\n3nrpkVjdgM1zhlTimfumtveNR7IA4Q0A9Ua6q8vV1xw/Lkr7TDu49qnRmHpg\nZgutg1hyKzdyNkuUj68+x0lf81d5hGnZt29jl3ahxW6UmzVwHchYCwUpDY0z\nF8fS9OGgUG06yhyjQhtoqLmQKLFWlme5ZNaD0pXp7tbYc7bC25WUy7lsJTfo\nCq7DGTrUZbD+fLN6zUB80M/qcX7wSNMqjK/tt9TXa436fHHFx9Em5pAJWeDs\nAYRQ5jSD5SQba1QnPW01YIG8Cbr2dG2tHjVvgtuD3abzH+cMnZFKbvXbVHGJ\n/bqh7L6dbz07uGH7Ii9IbAw0Zkrm7V57KknyXuHmXMa3P9ZxUtwr8/sB6pHh\nNkxC1Tt7koaom9v1fO7eet4cB+7xFKMmJjuFzSazuhd0jz/fBFWl7ThXbRWp\nBNnwbv2qr83/g9FRQ49l13ooRfVFPJOt83RQ7uQiBl9ILya9XPwXscELPEoN\nRcboujXvLNqyNaUy1hTqQhOMnuKoZ2HSfBBk/lqSpX7XgXzr6WunDQyhbUdr\nHDughNMIZiwj0dfLOLcViObk+PezCcKMDW3bwx9+gnCkkUwUdPpXbt4PcDEW\nAEz0/m4wcR1udYo4cGP/zTOJlVsfilDa7Xp81BERqOjC2TYyWvGiNO5+inhY\nufkl\r\n=MSJa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3jZS+PikJrjSgTbOSKwQn2K5vErF/tuZsVeUrG1fkdAIgWDmnQvM3jbbIqGX5cOZLEy2hUIypzFPFuLCF9egElcE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.207cae5d_1544709805875_0.8851056172431275"},"_hasShrinkwrap":false},"0.16.0-alpha.e7a1fe7e":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.e7a1fe7e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.e7a1fe7e","dist":{"shasum":"97c675c4609860026df754bb3426bd509d973263","integrity":"sha512-KAJXvE7JHF9bnHyxZreDVQus1wJG0JdLpBuwnqqyw5Yxm5oFMWaGCoF4In5/U3KE4dFnZfS/Uek0O6jX2PFbug==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.e7a1fe7e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEneDCRA9TVsSAnZWagAA6xgP/2BrAWyXs8cJK2d0TsMH\nxALWwBP3OAOuqXTa8iCtbrno6PWHfdslorf0d5eCwvi0m3qXVadKjp+qncC1\nzU7mW/5wLYAOJhmdf1h6fMNBU4xqTntddUG7jFposlo8LoZeRdlrfHgYuYuc\nJKQDgpzB0hb9Etvf98d2srZhx8DzyJejtqTzb5wqLtoTh6T+k3S5+O5E00tQ\nd4MFCqxEeNnblWUzvsbyXlf5zxQ1sQvO9hPhAE4Bx76SoZL7p3oHjBkaY14K\n5NmHjd0FysQNeGMZ3/neJ/RwAloGYfIZYLbHx61wACXmAmtEXV3JQ1Rnemse\nM1ZqXXiIo5ZMqxHeFpHFUyxo7JFUuUbEHzZgIBt5eozQ6x3sLaMpCChZ2DY9\nzK8WA2RAZQUfkIChGNSC1NzYCRjZBb1xhAgyvXfWLEjDPz4nrwJERs99TZow\nP2Zzl7SQTQtMyJLY8l0w4Yz1epiD0DrYhoZRxaNwByE3uqWD0DEZQ2bPIDMW\nQ/9irGe3KqRvMH9xIiZpcU4RNr+WBOmKIdPwRePBDgCeNnkWRTFgiXAyPz8U\nmTNd1cU/zHSR4nm28a17Z62MP46iG1VNU2OzHgHB2buu3UaprhlJWHxc13XU\n9y2KVAnpv/6jsS2P18vH/JeEtwF1GKWRjE1H7YWUkVrUOrE2RxfR+aJZwYwc\n+ZIr\r\n=Qphe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHm05ZO8ATnZY/vvaWFgL4uyp1dUW6aJFrBDinqmymHbAiEAzyxfPhk3cs+FFKXi8GT4XbiSLAFAHsE/O56hoUnyG1U="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.e7a1fe7e_1544714114455_0.4535415483245442"},"_hasShrinkwrap":false},"0.16.0-alpha.12a886d5":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.12a886d5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.12a886d5","dist":{"shasum":"4bc90c4e6b4b9e9a6679e0cdc6a5f33360c83f2f","integrity":"sha512-aHweRhA4Jy6U9K9Hv0dfqtIzTDNCBWexZWhyBTmSqoZSFt1fdnV9n6HbNcYp7XGRncGZ1c6AX3Q7b0FnGYiwnA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.12a886d5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEnwSCRA9TVsSAnZWagAA3SAP+wRMnLww+qut1oU9vPWP\nUS7N8mwf0D1xcYU97k4Lz6sVuZ3uPSSGG3jaOUnFFlpWTOSGqvkClOKTAEjr\nvNzN50r0nd1Rz/7Yjy8Rr0JrvRR91JG4XpartI6j8yPIOEYan7ZiRwJ3C4uI\n+wSJpKSVRilBHoKVc4m61V2LnvfxHpfhLEVnxCkYKl/2dsLsqoHBUZevw/S6\n3ASdjNJGFda41zK43SEXlOFvKr258VyI4KvHAIzCt/odi4CMQhDc2k1Wr4wy\nt+LCpE2ELzCnM8XwU7g806EAm9b8CL3EQ958bfe3JU288U5imb7YspJmeicg\nPdCdFejjD7zJ4AowEkpSotURaNEla3nBEJzMkoHUsEwD0HRZgxWZBTizMX14\nHrQqm3r4CCAlerYEHqNH95cQCAml5BahuGFja10Cn8P/hA4aJsyJdPXlN7zZ\nFbK6qm10uc2GC9aYY5t2VZV6lQRpmUqGxolKBS9VHBze+TcD0kvnqpj2UlXZ\npEK76qQazLB1PWPwgBvrpjxwFehbtj9DhkaSqtKaAoI3/06RoZwsm94foHDi\nW9j0SgyPRtJIHkakIxOcODSPrXVbdTK5JdDxW01vWiayqIFH/a2BNC/hky6J\naDJXK60Ol36Rond8R0WlqfCxhTM5HDXCZXcJaJoAX8Z6hppr4x+immsIoKEI\nr0x1\r\n=9PGt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFCOKuRBaWIurfLbvfpDrMuNciPuA2aEQu8quTBDKkCmAiB6HEGTUrJT8/r53VjFCDLkgwKJEuCCQWWe/qxVuRGK/A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.12a886d5_1544715282253_0.03285195125801588"},"_hasShrinkwrap":false},"0.16.0-alpha.d7173d74":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.d7173d74","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.d7173d74","dist":{"shasum":"bbe3ef8d6616cfcebb5e77a2648ad0af18490a58","integrity":"sha512-4bLYAsvGxsB0Gtk64iUbhvsgNYgWzYJtEiR1c4xjZyZvsmaDcy5NiFkYWQKtNJPOImKEp88FScqXg1EVuGP+Zg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.d7173d74.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEoMwCRA9TVsSAnZWagAAmyoP/AnkhU36nLMzZ0CmSjLD\nN0mIAyVWd+cMLFUiIama3rzA0gEI9qjqTMlJ7wHqj9dbdItoBnTKyN7+HzZt\npaEtbTNcXCZqr41c9YpxBpKgHkYZtSugo1QIEDTQMpzgHhXQuBJSYpb7ItZp\n3BevemTzX5q6WkY+wmc7Vm1sousUrAKDAv8OlC/hn/g6FFiNbrxZvY7QShBr\nXRoRHCwsbzGRUweM9aAxHMaqDc4E9GLxuteaS8ZgPecuCBL88+o2LuPtjqQn\nwH/gRgu7Xkw/5e7SM2dJCoQaL0tSq9POPU1yHraaeYZQlbiDcggokVehlPfK\nC5DEsdNtBtFN7MiQIn1LyXuLLvOZgMCKzU91Igj5Rq936v61262SvM4BCAwd\nqMwv//HKyO7OjG5qo7OIHfm45RcmdhhpAXVJGCXxj8WmfzxxiiIdtEpnQ39Z\nD291BRZnQg7yZGkw+zcVzuHuSDWfsYUBo+m11566CnFaDA4SuB1b6GHTIMnQ\nn8R/xlc/i+PuFwv7oOtgEkGERdHRmeJEo2jYE6DDrjeWBNu3ewFIdHSPr4hT\n1yOqWEgDZmgGI1Yeh2s147tRflzu7NttPxMBUmvKcfr8gl4xTfmRx83MdsnW\nQirwCTgIGW2ea50hfKiVlnM/WbiAqTKBRiwfN7VeDsEn3h525UaNiGGWPXQI\nxV+i\r\n=OjVe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/VNcMjx/xj0SdKtgbYmK1JTE25blmTa3nCEcgVtj5sAIhAM4gasQP87zOSgs/AH+owWw52CPCUM1rGBo7YSX9keR9"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.d7173d74_1544717103404_0.11636652640391065"},"_hasShrinkwrap":false},"0.16.0-alpha.3e591cf4":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.3e591cf4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.3e591cf4","dist":{"shasum":"04bf681b0fae2a9e173ed0ecbda48e678d0ac235","integrity":"sha512-nMoZQLSuPxiwumq0loQrN+GdK18bnOCHL8S6NLjRNpq6rUwakNaBa/DNq/TRSwBNVVDP2Oe0dc6FhpXKIhtRbw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.3e591cf4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcErbfCRA9TVsSAnZWagAABTQP/iT9FlXUwgwQrGn8btNa\nF/fZp0gJqetjWpX6HecsnGEvtFLfjoa6lDSpNHFKQkPEDdMZGQJ7DSjciIaz\netitwLBIvaAJW63wl28mFu9O/+3T8OT3tef26rE39xjI4eLvjZWjTiyNDJ67\nscT5jLqXx7sT2xv70mZRSo65rK9Ow007Z105taKkn47WCk+l2ZSJlBoU3R3e\niLhwMUk1lUifY1rRA6P8iklYHCo4rul3JnpwoL1jfkZg3SqJPRSneKi3i8Bo\n8KGR3z6Z0Ge2lB+nqDf7O3CIzVLCsJXfCZt5fBJmp3FiLpHgAg1XqwbMFON9\nEivNPbuZ0tO6lrKCSlGpKC5jq3h/O214bL8bLTVv3Xc8V9U6DGQgzCWgN6JY\nKgBUNgWMs2e9/WfzB9fwGm1R1BiqDmEfxhlNeT3FvV16KSgglFLF3vgs92z3\nFdV/IlcLThxELKdCjMcMV/ydQ7oLKbTTeAD50JWvxb1jf6LuLriKZG9GIXXf\nIhec+YWfOoidrFxmujgSaE07ft6l1HTc6QGPwDmW5ghWhna/0r6fQQb6tPQE\n+09jpUlYRqE8QcfnSLs2pgoevwIZrqjqP4jPuqesYZ0sr2bdhckcvM3Q/FYH\nKCLKCri8NKxXyX0pVu83XI7PqdGtAD0XLqoy3n3JTijsokiP6m5Yfo55z3Vy\nH9nJ\r\n=q2wL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+cvBGk5oEiEE1p620ysHjcyFHkQFSgWXfhOdthJj4+QIgAi1S7FH8VP6gVoE+Wo/8ds3cXT406Q8ggmdsQUTV+Oc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.3e591cf4_1544730335225_0.2087373179999934"},"_hasShrinkwrap":false},"0.16.0-alpha.5454866b":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.5454866b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.5454866b","dist":{"shasum":"fe03db7686ebe3894e82a76654c84435b0c63f21","integrity":"sha512-+s3x4G8lHdQanvFTFBfgLjBJMZ1H5N3Eu2Th43WCRZefCsAMZAV9DlZFWu8v8N731+9dZR7RXILiBfY4C7YMvQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.5454866b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcErbpCRA9TVsSAnZWagAAGBcP/A6DXNxm/xR0O8Xod+dZ\n64rmSkL+U2Kkbgov54JSbjxV+fAMi92k5RvPi54doXdVREPrwfwa7x31peqM\nXLVK72tD+uIK/j5AdW/yetEVL9tc00iD+QU4GrS3G5NyqcqQv+0FsxUS6aAo\nuixbnwibelN5lmPj1wWsgwDFt1ZJxkxW31/mEtqW2+maRIgoXisWT0rMPrUI\n3ewLmzO/v4cUfBfWCLLcya5FcioUmEzxnk6i/ACMSeSZc/TO/OTKO5CiOTSK\nIJIBQEXmXTH7XQh/nhRakpwQSDIEcZzrLp8P55JBx2h8+9N9rbBKWO+YLfvA\ncQbbmwxGWpJ2uLsHLxo/CqKG29KcQJGmZlrNsjNdDobCOspyMvxrZMQ285S4\na7W0KciPm+6ltujE1D5tp/JCnGSBlhjz5fh+N7veSiE8R69qdrG/VE5QzIF1\nj2vbwSl/rVtXwUMrRLu8ACqDOcDUi/rVRSb1SFq/Dz0c+vUxtaY5uzBwPhen\nTrjvYLqp6p5yLzJO7p33WpzxAzWUeHBlLJoC6W98x+5iR2FNBXIcrSNGqY6e\nw9cEk11Quyh5hdD8Mu5ashiE7Qw9NgIFBypBchmbGtA/MkIvqW5Kdi0NucN6\nIUtwO5vcUWoU90t8DBVCsdjpaMzMlQazZ/t7IdS9VOYQytMHO0qyrpHcu24F\njpCo\r\n=qyA/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICY2Lg/o5Y8h0QjLogQ2l6IfGq2yiPaHFjBeMtjpl+sMAiEAjNlhefTbwklV5mbH5ol4d4uD4Ewg5TcKIBl7iuIoj1E="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.5454866b_1544730344106_0.5542799248332335"},"_hasShrinkwrap":false},"0.16.0-alpha.944adc8b":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.944adc8b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.944adc8b","dist":{"shasum":"a3c406407c9ccfcffea67d6a635d31a27a26f38a","integrity":"sha512-ApYrrZyq1qNBc3pKLILyPc4KiimhLAV0Yaub4tlcMEPepqXul/vsEibZ1zLPFg8PxY9pVqJ69t79nWXVKDBzmg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.944adc8b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEuGsCRA9TVsSAnZWagAAsJwP/0krOt0X65DuEgoaoLrm\nbovVEZxrR5EPEXGOSrmLknJRYC4+zDVWvgowFNjCCXdPX6DQmv2ZQ8ql3yY5\nQ7xXsrGTk48YfdPxyQ/GCYjw+5Mm2xqhZrP1htAYa6612zsG9S+LiltYZbaZ\nIVHbZcmw641nzg1mQ5I/4HTGdMuftelB6gw1V9my6WQqXcNgSIFepHXyhqg8\n5rKwp0O3UfyhvrOzztt+MHtHRvvKbPfTI/pXL6/GQBLMmTWukSkkCMYp1yT8\neO3W1PupDGkx9Lf4QG2PplkYaAsdIKrwUl8xbcYMpa1kioOd2ztWLNlErzM9\nsmIwu5flqRawUoBkzhIgYCExmXz8XQunu8mzzyCKIZQISVctytJmSMkDmJuz\nkKqRUHmuphDxTiwKfYeP9ZEqOqB3IL1bM0520dOX8oe3HvO/l4TAXSdec8BU\nes7VZkjsShISrjdY8JmX6RA/ZduJl2XKaaS//hm8svPC+s95f1hAg21yRLpI\nhW1LJZhnSL8cAd3g1ODWZSKkfRm+JnzJAqWy2Kkf50W7gRJ05OGO8xrTr0G3\n7VJv70/sF4n8ycu4/09byPMadL1EczEWit6z0p9+pqlNlE4eyTcTQY0nUZPI\ncz1Oh5HV/BqcCaEDgK+42Fcx2NCuZ2uy5ThoKIgr9fsNRizs5Co9OzOHglSg\nbclo\r\n=yaXS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDnp9cJIWiO6GbWEdgrDMaHtncyDmyy0vzkxXPfVSGnFAiBbQ3kmYzGH4o9LcJ0+1ID5Ou16faAWkc1E072Qsq3dhA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.944adc8b_1544741291831_0.23996198239898314"},"_hasShrinkwrap":false},"0.16.0-alpha.e74560c0":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.e74560c0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.e74560c0","dist":{"shasum":"6a0ac1ce3d1bf7d94f64a8d6f5aad0425a89ef33","integrity":"sha512-aBFsbYmBAchFOArDuHlTHjw1XcSq9a4Cln2XbkuOJbN5kf/z0jx9rWCKwlyjS6XMivbMGZCNPCTk/n46NLtZXw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.e74560c0.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEuHeCRA9TVsSAnZWagAA8akP/RqCGNXCJG7aUXhMZ9t+\n+p9wZqSCEPcqiYPnHS7Ba8oDEeHMbcMjnCg+5un9clBuqNIqjaSDxh5Ie7RM\nzm6XJ4V8OQMMrVmtHxyF+6V7Rb6ZDEmWc5g09JhQ4flKtSHQPGku3fkS0kwW\nliKCQWnGMY3RKsHXo6H/bhgqglPnchqMrO3YOadq6LBnmNwfxY3wBdtIDevr\nz1GPEqVXwmS6BOwURyYvU/NhwM+jr35cpIzSfMSMUaiwMgStFt93T9vq09Z7\nd3h267clZcibacOmFT2/n7B5KspVte0oU0yF+dFAwjcT76Rhp+LUnwm/cY35\nsebZB8pzRREyR1wWwAUPXDSd71GEkMUxdOR+/HdZdOrNN1Ihh7xkQZ9osWoy\nHzjmv/WHLjk+e0Iovmy3v5u5V72VoNpdbdZYPB9Zb1dPn667qbZyZsjP89nS\nyRIE4zIN/KywMJ1FpCVJquiT6S5o1FpUbhhmo9v+U/TYeZKBo39onom9aO6G\nEshv8+knPRKDuQJLXOvyDnUGam9LD4XQjsXuN4k0GePf7840+u+MjlCHrc2b\nekM9baIuBaVbNXcKtn9IC1DwX4+u2tl2pe2Am5Sun/GLyh2HQl4NU2JaXImk\npqgcEY07snlcs/e+vzW0E7EZl2ajkSTdhHlx+/JxnTAjZ3su0kkDRrGKcs24\nT9hd\r\n=yQLD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxkGTdEQVkBeXf0OgPyvDma1heAeXia6vEtbGP4awHRQIhAM1Sl9WhzW5mjws87jgn9nAmSlPRqG1oESQTAFpeDATE"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.e74560c0_1544741341850_0.8282000470272282"},"_hasShrinkwrap":false},"0.16.0-alpha.f90b9fc8":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.f90b9fc8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.f90b9fc8","dist":{"shasum":"516954fd1232cad09d7f882b68dc9973ccfd7c4a","integrity":"sha512-UPjLGHoPVtsiXdLJGj/yFvuitj9ocSmbHWJOoWxVZu73fxsqSBzt84cauYfuzdpep+hGwas2OHGhlFlJE1H4Tw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.f90b9fc8.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcE1ssCRA9TVsSAnZWagAAQIoP+gOWiRebW6laUfRl5i8F\ntoe9Vr6aeTi2hk0haFpYNWYufbRqLetlbhQ/ZYbODMz/xfv4a8ft1DeSqiCp\nILP+Msl+S/hs+66/YER7CCT6T7+MjdVE39MudZf0PfcjWuD+4JxySiTzgt6c\nBQLRlqrzd2yJBid3XTnspJKqPOJQVnnpOLD/jLe7+m5qNyOCoaN/81hp+2gH\nVjRIglNbV1hBfIUasp6gxp+oj8SGHhRgfRH8aadQv7HxbfYQ/nlQ38rLF3np\nThbhgL53y5zMia+DYelqqgEK/mDiCLXlCdzZS347+VNIzw/Nd6wB9IW8aKgl\n/aVGGynW4vGempSIcZIoq/S8010NMP6bgSO5TcZlyJl6fbUs000GJ++vZszG\nst4Xe3xpfC960GuJcZvFzclDg87iiAyVMvTFmijQXqnJsfbo90MBY7G/5YCc\n6L1iDjnI+5mfeME7mWdPbPBhkMKI98EiumFdnN9tAshpAawUd9cdIXIGRc63\nY7Lel0KjLlVTnwACwTvOrw7nySdhYz99KHc3de8yhUsUeN/coyTKpEka4+k4\nZIeeMUug5k6Ynj2RQW4Mhu8rrsE9J+JOClEA2yfW1DEDWWOB3+5hEdmTOkDU\ntD8vZd6jZS6XtRqGKIGN7Ef3zAlt/NxwBlUWSE7aNcM+8qTsDlsf2Anp31N3\n3gex\r\n=qCK2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9NVpqNwtw3B8M9FQv8EXfQJqnQp1vwkeqaMcB2Cs7GAIhAIvcfdKVVxZHQVU4F6Jpiwid6y6Z6q6rXD2YH5dbuHya"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.f90b9fc8_1544772395513_0.6046111451365235"},"_hasShrinkwrap":false},"0.16.0-alpha.9afc4c93":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.9afc4c93","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.9afc4c93","dist":{"shasum":"0327791a0ffb0a29fc928f01835d9df8ffde8149","integrity":"sha512-+tuf+RigM5jhGIXGCinjrNN+TJw5Plf/7JyUsRMNOw1OzqZTnYorZgNhhnJCKfkVv/jyeUPL+wJN+jDeqIFcDA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.9afc4c93.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcE2kKCRA9TVsSAnZWagAA7OgP+QEzfP38TENvUze/JzOS\nRI/ity9oq1NoVUj9AWvC9gXYCRLgU0FcZxA/bNujI54K2Phl+ahjeUgLsags\n626AUKFNYWhgPJl3lc2gJp6wVB4IS2TKKMiTycFURQ8/PKPEN80rCAK4Fgko\nn5P348YAPtP1EACEWeBWMhYtf7vtddk5GhKNm/vdU3TehsvDUvpuVgdqCqzy\nrym81Am7pTFYDwKk1HdRB41GeANB8jNoemkjs8rF4PhdxaErGKW5naAqXV9U\neEsT+wA9tqk3TUdtwNcWRQWPVsho+NrnRU1GKL6cZX5MmLgDXlO/x6tZnF2J\nBFObhqboiT8qj5jAhVQS60v3NQ/OTkaFrK6a9D4zIxLQHwEjEz+LkQyRBm6U\ndqOQ9rc/Dt2Jal499FP0XKe6lpfiYXuUij3W3IEoPTs44naZiiTmUARiba6+\n+a0wnnrNxwFiTO8892qJ0iqUkFXkZuepQKRTq6xS/ORcpOjfBnSAEDqxfRfe\nNiGCG/AbeyCslBUz3PnbLjpI/SshRJ51ZYCEFgo8fqU0iaTpvLJ1EoLBixPS\nw8jVwts6eTB1dh4/pddufDkzzthWAWQioWw4LbSugpW88OoA7HbRMmFb2S6U\nxgqLaFk1ILVknq4nx+BM/FYxfrW3XkODNAg/dwoXVCiq7A268cVFM2FAYJDx\nJYJh\r\n=B0QD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDf11WSCtKpkrPmsgbbv3hSaej70nKn9TRMUY/+d3OJFAiEAgX3WWdJ6CCvloK4hjJDyWL/lW1+NNE3w/F7cMCd/Z3A="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.9afc4c93_1544775945817_0.5554529228203435"},"_hasShrinkwrap":false},"0.16.0-alpha.31e7bef6":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.31e7bef6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.31e7bef6","dist":{"shasum":"a7a9ca1a7461a5995d1a55560b60b2cbd283ac84","integrity":"sha512-BcfG0wbZ/p7iuIq6wFfGnTp3Iw80W7Wf/U7oO5/rJKeNHGv4/Cs6JThx4kiVVTmgSNbr520WeJPC1wHb0WCLtg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.31e7bef6.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcE2kVCRA9TVsSAnZWagAAaCIP/1mtIfrTQlMKdYLItfPo\nmlu8YYveq+vOSRHLh3NpZOupnDdQgiTdwQG2pfMzy6FwMArlh4UDwm7Yuljy\nn2Jy9qrWsC8z+SZcTR8ui+35x4YeUSENCu1WFoMIcQob6cWb+mpo2oyPDI6j\nbaZGy5TEIc5NMvtedXEZxGl69Pnxvn/gEBy+p0abhAAnPfdCaiRaLpIXtyHQ\nVvVIjB5aA85/ojiyPv7cI+mVzN55/TdyyxLFH8QpOPZWffZV8/WfyDfWlrAv\njzt7v/nvfLUahiKCBbHHubLDdYx07EP+dj/pOfujlRQzAoGPxJzveWD0WWFc\n59KwyZOCqWy4opbsk8dHtPs+LoK8rNqWaU8+Y3cVkTz2dCrbALbuuGA0zOAe\nnxroU6OmtMg1SzNBKiAvIEjFQK6QRvJ8CNTk5Yx8CTLJa0UnbaU+7VXYn3AF\naSAskGMsN2nOHn3BUcmtykOCxAZNsyvoOxWUH6vA40DMncTGx9woKjcoHwyM\nL1e7X5BwCZrE7Bkrk4gltFClW7nKKvpYnDoRyka3nqo7wYft9vkE31v5nqjP\nt9CLzk35Qd+iaXqXY49SD5cZ7tmdV7TFFNmnOCViyOvVGelj54Tzrj5SWUQM\nAAs1bwyWZFEmx0AJSAZ4gFauRuwLQfBolnLnSI90chXyvv9P3DegOscin4ux\nUmFm\r\n=mFhC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkg2GnF6V7PzhPQgC+Y6+d4f5uHYz2YwQ4vbxH/rPzIQIgXR72aSPI0G1Y4+c1LPeKR4sT4itsOudcW9Uq+PZetNs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.31e7bef6_1544775956919_0.7756538841915022"},"_hasShrinkwrap":false},"0.16.0-alpha.68d60628":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.68d60628","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.68d60628","dist":{"shasum":"ad272048545a041541a5fc26995362b25309ffcb","integrity":"sha512-T9J+cWxwI0EN5HhNT/w3OWYBoFmRIT6Gu9FM81FWDGdJ94g5VBdathXVquR/5X2161Hy+C7Y4f9CrEgdwdlzvw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.68d60628.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcE2kkCRA9TVsSAnZWagAAOdEQAJM39E3NSFZaUWK+T/5R\ndOese2qiLkE91ZJNBAjian4kTCqWtbwt0q0ZZrFFtAt55jElNZ84YroF8Ccu\ndhOR0+xt2CeUAc1FmefY1DlLnKdtf6TnxYkLylVv/74pq0IdJP0/hdYwtRpE\nTKnPFLQvZZzhZu2oVw/ix3tnWnZc8IXw3aZ8is5nN6/MS+OFLcW1VGBkGm8E\niNgqDdHNOEK0jxafV2wqdW3srJvsJmP5GJNvOuRKQWi218vXmsfBcIAZl7+s\nSmf8SuPL4h/pWz1AN+uPzRw+wwPI8l+kzbWFMLK3eorFfOAGpzak16tbL4tz\n+pXh2r3WiwtHsFXINQgbQ0P/Z9Qt9QMDggHiFBgJ6hmgqbsPrhbvaW6+zXVn\n+V7pVbx/T1duB0F0uFtKpfIuYjrGfBX7g1HzDZjIDwUhayqywRr5sYyu4qlH\nRL2mo6Z8XQ6pt7tt5LMXxVxD7SpVZz+fUoxgOV/e/WjzQgdyYjocQXzqLLev\nGlGVLcfdQQdIpRd7ZvCSuz+m/E+ZeWFyKN842W0tLh9Bhd+EIXZzuWBH4sJ7\nUpuXROSELvz6Sju7wVVMvyqdFYq2KArnDkhm2lEjAXyMdrWqM5622lklyC/t\nHgDdnpoduUil+avRvm+J525wGI8Rs2VvyMPifeYwAOruxK0vb7MsBhrSrXQB\nErWB\r\n=6c90\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlMrBJeoV7AL6w7pBQNZ/b3mS+H1S48jg6PxJ09YJH0wIhAPyGIE+OaAETapzkSeoFLFilpYAy5D0F2sygcIr0Zcxm"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.68d60628_1544775971553_0.14412779871112646"},"_hasShrinkwrap":false},"0.16.0-alpha.419a3469":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.419a3469","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.419a3469","dist":{"shasum":"524d0b2bbc200f44fc1fab327f70820fd21569b7","integrity":"sha512-oX9vALqlgb7Uum/nSSs2eAmkgKI8W0QbGSnqkpSNO2jyhbVNuVEB3UomBszxbHwdRx384fhtoyyJZotijNbs5A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.419a3469.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcE2lBCRA9TVsSAnZWagAA4oEQAKR5QY7R+mT/hjBN7vx0\nnICiicVX3uI7FyPN5udXne2oplVkTSVhVuER8GeO62Cme7XxtPLW91W15gyr\nZFBWRGkr5ZnrTHLle0a+Ka8pvy/K3txXLu/+8I9bpgzEMuvnT4K+Ek+q4a7w\n8jceuUiUjwXyr+VZCVzsFwuUCNEZt4xDZHfxsO5BWoSng/5EYmvMWNPilJIA\n1EHQIJ4pv6kZFL4mhSMFN+JSNb1KGWxAeRP0anSKvbilhcQ+6Pm6nksFcLUk\nepAL/q5hQF4/5MkOnootIAvw76z887fzO5mGXOfzOuDVqU8aYxbY47UjAsOt\nsYcxFA/EB5O2/+ulVvCNbYsRgJX0D4VfLGYPCbYCT3cgV0jbg07vRDAZrCyj\npK8fy7jO7OR5CeZyLajM/BnYz0pWOiJNiobs/bINlxN+Lg3+iVfBtjm7cAh5\njdEhJRUNzwi1Io1Q6AQk+b5zl4AfOBlllFqbcyUDP99V5j/kLZwziSC39o0/\nKaFe9YXI+EP0r8IMQpXXztW0gQ9aCyF1fjvzfuYD4IYtOBAqUv/ZFgGItZ5O\nZvViIrn3ADNf/7NojFzG3UXmGt9MM+aaLGerEWjVXZewwXKkD2XbGCAYbDfq\nMoQV96rUy2EWlBA+QJfV6yWWY0tuG70kItFvAEqhLRt6TWmijawG4MmUW5PA\nnBhS\r\n=OC3S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFVWWP4eToVx4LAfmKCzINXM/YqxP1M3zW0u2bvhiL2RAiAJanR7uctlB6m/t2K1Xu9PGpdfeVB/Jy+AwdA3qRgypg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.419a3469_1544776001180_0.581631931126301"},"_hasShrinkwrap":false},"0.16.0-alpha.b6d91d1e":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.b6d91d1e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.b6d91d1e","dist":{"shasum":"26ff4be2fab9666f992828f51000f4f0741c8b65","integrity":"sha512-IK4Ijxir51d3vRMQmBZrnGLsYP4cLqP89EzlX1cpZ/E3HefMUVuIEJssN+geOz0+PwBCny/oaEuCFFB7EfyVYg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.b6d91d1e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcE2oRCRA9TVsSAnZWagAAEDsP/je6V77D2cTkk1grnQlk\nGhJoCio3GDiAQGAf6d6jtN511kLRohh9MoyIMrc0NMDs54pnB2CybLnew5KL\nq6b07EY1k9M16fV4gavC1dQQ3RgxNTK1QlTZrYlmTDj4xhWOMy3wZ6mrC/Ch\ncaL0pYOo+Txth3sXlegRnaHXgfZtq614xBCXV8Dy4De2nLGQKbZrlPtGn8bh\n/sSsjGHGjS2A5L2CGfAiFRCKSynZujy3dU+acTZmSyPTQUnLi7I6MnvAlnIq\nXBMhr8qu+KIVRonaAwXqUSPuh8Odt2DWroUUpkdbGmwJAw4Y4ZtNn2oMHNvo\nMoa6hHk5dJ1Uu6Trjm/kpWTq0XSor8sKq/1Q5T8dftvAnDIvowCUiac64Xlu\nkEnvoUidsAk4Ww/p+D+1y9KIg32wJOSIgUC1uyNS6cwxGrNk+N2Qezsm790L\nnVCOQ9t6JrAnzfGlKG0LWmAtiGlukFzUq5PPKDjckabWtmXmzWWCLkePL5gx\nxFNHevZoRwlFlN5okqbtBzJC+ngbP/AdjZrx+gKab3Bf9R1Ar67Q2pY/lilq\nF13gq2UE19XscolGXMadX/uO9p/fmwSqNac2OZn7F//2Jgvl7BV6Qqm8kPpO\nZT5su3jImDS7M2KIfQcGQ2BLCLn0luqPdsUYsdYnH4T9/AGPeqRR1QlYDbTZ\nsjdF\r\n=6klb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC/OXoANYW28SJe9VCHPKQcZ7nknmcZhHVeKxWM7J5n2AiA2R3pDJ2tJZlR0Hc+QPMlovpjSeymoZRvpqgkgivzabQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.b6d91d1e_1544776208579_0.013126267652401546"},"_hasShrinkwrap":false},"0.16.0-alpha.19141979":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.19141979","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.19141979","dist":{"shasum":"a537d28448308076b76ae4879005369fa395b3ea","integrity":"sha512-T/BQa1FwY+z5moPvWHaJoJYfDN8+h+g9HCVkmJ0SKD8+faJ4xmHLGuJYKQjaSlmS+Zd2uuZp5VNBT3ntxPT4fQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.19141979.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcE2o1CRA9TVsSAnZWagAABkIP/1sxiljL5PPhZLPRIQvI\nicfKhuEtjNUxHeHNTI8410cotfc0eWkZW81Ntzi3gmyPpgOtcNAQ8v998o+j\n8cE6s/ASLUdIXIZqBbCVl6W7+xDYvuHqdM/pwooYJqaaEmhEW5jdYVhAX728\nYvGPQq21uIlUajO4V9axV+cNoIUpHB/2ppQX4+mzkV7eCysS93FptRJT6WUG\niq2acZwiTgEV8FsPTByGOXCAKZZII9G+MVu0IuC/vZTsLDJExvShnIYt+rzQ\npuZBIAZXs4cTgFF5yYaIws6ZikqhAimHV6oevt1s6F49jclIugvsVfpWpg0Y\nyr7AE3lGCP6hoJVjT6tSArm+lwlN3WAfj3yfiQy6b312FwdwpnCfSpHwDxXw\nDf2St3+syKNhQ9I5Ak5nQ/YNRtA41id+MOJpfIHc/1lBDsdXUldYmWp829T5\nK5NQjtTdJVYUjuzrf5OXg3CrqKG0aDi2//BmFpndv8Dv98IXzecJVM3VUCuV\n7zR3mdCvLqL48y3uYkRhlNOqJw5rYR7jMdkBAt9QeBTbtGSDXttTwmrnd4+/\nmxBx7gHR5iuSWSxOTP5BY6bPnCjdPmbdAs85vF9/NPO5FEYLjXNxG7kfcoO+\nb4GgB3dLVewOz8mmWo3WKT/kTZJYl8UYtNoeE7+JFr35Qv9o6GOtP16TCziR\nDETk\r\n=2GFu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqfvfpHDOF2kCl8u92Ogxiac04U9RrHPF0x+Pr+0oiswIhAKSvpjfy9eujcrOv4Cvdg7FZkMwbiAtvSFluP9BS49HK"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.19141979_1544776244633_0.4009496695914647"},"_hasShrinkwrap":false},"0.16.0-alpha.547b4f44":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.547b4f44","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.547b4f44","dist":{"shasum":"404a6bd4cefc94999f1316a1b09066bb6a5e72bd","integrity":"sha512-ZeZ8Wgq9nViVhQLkXUDLE6yrhf7e7bXAEAcZ2kXIZD+AXh6U+sLzcutJFamkcEBxIi94UIyYydtfwLgGieG2Wg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.547b4f44.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcE2o9CRA9TVsSAnZWagAA3SUP/39tHv9fIrSYJABDb9vf\nVI3FLNGLJPtUhC5VKuoj5q2BNxNLKCcxnxZn6CIRNcgk8EeTzIY/Z7BaX/ta\nRE8t4d6FDIrG64zTciL95LdqYC3t9DZdL8RlQyKrSkUC8+S/UQZDuvZQGohv\nACJyqt4CbvmVEQeDdTR8nZDhRkeNRkoBPYNd0UJqaRW0yPMPAqxgc5p7J7a8\nRB10M0f6x19EJ9Bn9bWzqN6LmWxQNhmtNUAv1qjvki6KM78V0VV1SX4qyZIQ\nCoa4H0a0Hv2t49HE0cU5jAAkCi++PUttHge3o7O2P6NteXtWq4dDTrEiX3gq\nohwMneWKa3mMtfVhQNBP2sBt3aYItqeDBR1gDT4Buex1oCj2TDqOZNXN1dSo\nckyH0NfKpj61eCCRui6Jb8r9640K5qISAtfoSOHXpKkBl06zp7RideHEe24a\nMisUta7fjsVw5jBvmJ3fjckWrGf3aKpGthsAIprOudcBOV022YZ1HLfp9mC6\nEiHQWSYpOScGLgU97+XSMJL5mOIGOCEUPmpYBc8wPHLI5F+vszjOhHa/UaAc\n/uMZVRGqg5c/b+nwprhkpO8IOilSg/u1qIqT5Xmav73taoYjrWl5jSy4bDjg\nWI2n8AAL0rYVrRHSrLbj2zwLnzmFGr/a9mlJz4f4mefYs4rLoH3G41K4EJCG\n254q\r\n=XbVC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIErQBLRfeZMeqNpPbrJCXE6ZVAg1Xg0/7SdbejX97epvAiB0J8LXJACKl7CTaerR7LLm5zVIPPS/ncBA5yE8AT/RlQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.547b4f44_1544776252532_0.760957267755106"},"_hasShrinkwrap":false},"0.16.0-alpha.9a830c8d":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.9a830c8d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.9a830c8d","dist":{"shasum":"7039d7308bfebd82c616fb5220c73bc97a213aab","integrity":"sha512-D8RcWtZ+CRljeV51aHMQyFL+iFBr9UshGWr6NDjHvxXwWjL0NLu7yMJ2kR+AmTQVqHiyJJUbp1t5cWdT73cJmw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.9a830c8d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcE3E3CRA9TVsSAnZWagAAAFMP/j/gfXyOBhgaaUQ+UdaN\nfNg4IJi2nYnfcD+vLY5yffqpDvG2czhHEEGPefXFBesrX2Vm+NhMV5rOLPSh\nx07uz9g5O3V1BcoxfCPiQccby7lfXS9R/IcQtxEcXIwEmOMjHY82jFBbRqLn\nCJ6+19ftikNg1UsrCBV4DkAdW30w6SUIlE0XBx+Av7fLaJHuchVz2j8Kg/Ww\n138SDaZLMyu8RC2BoH4RuwFs1PKCOgQj0TLpP9G8WtvcenRZmtF5ZtH7mhyA\nCYde8DMfrA/bt3CA6J/qdbZWDM8T9Mdvje0em/sd4t6cTSnwMFicmuA9gtBW\npcue0JN3KtmANjXf7ZVLZb3JqEtouMjOKGLyN2t+P59YEepGa2m3rDmREh+R\nm+w1TtA/Z0dglXPeXvTsZ8mptFGMp4TEIq7NLioWxHTKcu0e4sC/4gFPWHBR\nwuS6eV7mrSZpLb1UMowE1sMmQbTZSdGvu9yNLVInabJk9YaLz+6Z5EFfMD00\ng3Bo04iGXcNUYBWqjJJrXLDqexpixeiwT0oIIW1HGWia3+nx2PBFcrTeBJvZ\n7n/nThu6v6X9ddKj20Iw36GLtOeUj1LvGCSMlnqIljpLl50cCNMlPU/9HAzc\n6SDrz3hglVnVYVCK4O00DSpTugTiuL8RK1am/9W+QE2lKtm8EUJaEMO5ABmT\n+5M/\r\n=4VB8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE29QdwDs6F6iXQJDKDI6+LQ6sK4vuT33FQ+THeqrE/2AiAUEDbpU8PFkmcSfEH6bNYtX95K4YXV2hsV+FWC5DtjhA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.9a830c8d_1544778039038_0.9345087115125899"},"_hasShrinkwrap":false},"0.16.0-alpha.a3c4ba15":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.a3c4ba15","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.a3c4ba15","dist":{"shasum":"05ae8d5d0bc7167f0240920d80f6d6a22f85ed14","integrity":"sha512-Kn1FR+V5Ek7f+a+sYl+G/3uKMQ8vFBmRJG0uyxrpwhi6b5eodDymopEhDNBcc1SqUz7ImBbenFiykG4zitGXlw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.a3c4ba15.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFN5ECRA9TVsSAnZWagAAKYQP/jDpi3Hm/Wyd3xOPERaG\nlujhO0iwC1L7Z0sJ7kXLSMhSdzAUWfRPgtVr4SBELEgXZhhD04DgCi0VPe84\nXAeuppvD5EHYyEWzPY27Erhm2YkYi+m4Cl47rkobmQBfBojywQ6ElszutNrf\njDOOxH6W2Tk3WhAcqYsJRWkeiANuzFin76DF6XTpKdjVaP0jF9TOS6OOBePn\nzOHgg2DoNcUULWSUY3z3RuSYq7tGV1AlBpqMLYrgUO4VmrQ1AIjW5QoMNc8T\ns2G9QhgUpUDWmmwRpVLTaGirisRGDCcAMZCPSTQnLxV5riKAG61SeoX8/2eC\n2W2EVnN8K2n8iQHDusXrHssGEq4n2viJBz4Z01nAXmz/dMnHJrultNgqKjGB\n9AyCsd4sN7IiFO+wAtbiXjnVf+FnzoZpWDEWIX63z9XxOEui3zWOpDVtd5Xc\nut/KMyB8ZS3oeUppmswMcvRppDPNZiueQrGp/nTzUUIG5letSHLT+/A0cNUW\nX+sWL7NoBocHkKS65IcTWPORZK/6eQpuqjutHMl+uoYyjroB663NqzqLxXjZ\nNdIvTScQ71bU467kkMvcMT7PHb4XiU6jrM4kaYDWmfqFEgiFdCSi7HzbAAh4\nITv+BsW+B2mngw3ZwGRumCNW6fZxzTokf01lf2WcbYPiUKHizAThS3DcCT6k\nf49V\r\n=PPAs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvVjydb888znH8ao856+Hb8J8rnPIT95aurYJ5oFoBCwIgA7AYuNEkdHu++Jd90X/kc7g6Z3CQjGUq1lnfXNHsiIo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.a3c4ba15_1544871491616_0.1161210599765734"},"_hasShrinkwrap":false},"0.16.0-alpha.36922869":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.36922869","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.36922869","dist":{"shasum":"d2a521a864331d67da49c157b230c41a1bab7bb2","integrity":"sha512-I+tqI8JAatGrHudWzZ4aMIsxYND9yugdiNNXGknG1MmunVOO5MadfYIktAeE1vEqR/7vOFmq9pUVYViHY0jthg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.36922869.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFOFvCRA9TVsSAnZWagAAbOIP/2PvaT2yopc71EayzZEN\nWPoHd/u+6Fir6f11DWSLRxqTDtev3Ga1SMQ8cLIyEznUqlxI5+a0Y3icigH3\n2xyV79TkiCAEaxH/ERYzK2tRjOtZX6+7KLIpKqwONHrA0CLkIg8L4FbdWXiv\nRrAxwYlInJmISFvN1lajwdwhpNniIogqhggNnk4nmK6Gqgiw/bf7zTebpNpz\nu7Wbp7XvlIael5+LCala//Pf+CjLpXMoDRmJkY1RJJupzglR8jdlUObKVB5l\niMczLHL5PFmO2grtB59Gkkdvqc2UO77AQy1gZlp0ZB1KmBHIU91ULLc9ozBF\nhVdvby6dDjIdkIPcxzDEjkc4hTsOKA9S/+StUNXQPXvnNIr80JJVlsEIk4/n\nqo34TzrN3cQl7UwDbkDlXsqk+TX3ShiWBXBCPzDxVOJQ+3rLQy/W6zlJtuxU\nGn7IRwJQIWHL43eDCP4qdVmRdFDnsVYPI/HYs+WpwnR912SgqfNPEcco/wIw\nMZscyHqfIgWj5eaBsUC+8tx/38KRdscy+TdwEN++x92LQ3crUR892tIJPl9S\nbfbg1Z9iBd43uatXRBX/cd/1LsP9wzjIbXqpFnq9PgsZBsxMbmJ0ZtYPIQG2\nVwpGRW2Pw6q/h0lMnHQ+slta53KFZ4bQ9gP5WypygYRTiWGTtJ4iQqxM44qY\n5/rB\r\n=0I8v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZKkuHVYETrOqT/XDYj0boabBZXURXk8+sIMBdTXerLgIgAKhN/GbPZa8kFN3d87kIjFowuCJDIFyuuwTG7CC/yFM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.36922869_1544872303141_0.042633193184063556"},"_hasShrinkwrap":false},"0.16.0-alpha.c123516c":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.c123516c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.c123516c","dist":{"shasum":"1fec6312656693c353e5f20c2b1f4ceda7194980","integrity":"sha512-bLZejkPY3hvDV42IJaRJ4L1E8HG8MNIEf19gX8VM/OG9uu88ZzSjw4cy0g2qZp45gRScFvbLjqOSpTA/3ckKog==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.c123516c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFOGECRA9TVsSAnZWagAAxKUP/1PpQVRLOmRqWjFWINa4\ns1REWJZ9RmCRKZFbHqHGrjrHqIrA4H3qU1eZFEa37iLbvQpKcymO2UzOmUne\n0G9WcV6CNSDPXQJAzDcRtmHtfSiHK7Tvk3QGeOj5N3zmnACqJ9TZL7UnSvEg\nngaXBGpfuabs8gcJ2A51Pg10fYPOTpA3+q6QHIbEdYKUeGJJFQ4AM2lXoVOB\nb1J4d4N4o0MwVBc0R/JRWKi+q6OaYjbxmwmUF5rgXAtvk3P8axXb40Tu7uGu\nB6Y6NfbEk98lRJQdx9RPs518GOUCYins+c9IkTDiTNidfJvRhs0icIEvlDGe\neHMKn15jr9OYAKeocScwOKuiJkMKs2IFPOp/4Hrby8qOC87mkJxOPcZRveLm\n/X/T71zWaeEAcroxOt79bimYexm+e3ubOJMgmDNr2R6Ueb8CYe7kIzOHetop\nPUqjndk+uEpYFwy2GpmMSu3uolRAKHRx6WbuDwQ4+t52JDlnBzXRi5UapxOz\nKU3ZNdvhsRGvU91ZIlQvgPbBJgFKT8n14HAFoV+NwbgLcuC21G6LoSdwGP+U\nkot8ofir6KVqBq7k2ozEYN1HfIKMacYVlXGcUL5+ti0aQxXPHaFLm2JPj56m\nOQzymXzg0js7QR9KasG7F5H1Om7leI/tg0Ui7girC/hREbHETRhS7tNGLsYI\n+1DE\r\n=bLN7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiUEDyJKPJkrF736cadG+1+feBc060AoGCrI8YBYuQtgIgAh9x3a1BbvmJ9TgnKb7dXOAFn/e0GlwiPbRN7WKiQF8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.c123516c_1544872324212_0.1190577338433374"},"_hasShrinkwrap":false},"0.16.0-alpha.8a62c766":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.8a62c766","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.8a62c766","dist":{"shasum":"f0df6da9ef22b81e23fe21b4558e5d6985d8ef3e","integrity":"sha512-YAYrxjIMyxnUCTdDvFAab9StfQfZ83l6ZJ6MXayB+UbQgQePbKMJfszrEAIYw/1HDu85aOWuDQ4RDgtdmUbSKQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.8a62c766.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFOGPCRA9TVsSAnZWagAA5twP/2hVBZIxI96HoXxUe28M\nrYcDVnvIBh7R6+P+RP0eMou/hTrZnpNkN/5kudytpsffxu4xM9VyfwE/BXP9\nXglEc2/KkX9VXtb8+664UbgX8rbBc1lw3dg+8nefm6k1YtEUvvCTeMhSujri\na9IDHhDFm7seF8lcd3w2uxfdl8xo0jCtWSINkZdUIjuOLO5Xsd0H6rnD2RNX\nVt2IvQK9wSvfz1TKjLwdsDB+7HzS+/jb9b0OEtX6bhRfTrfvWuRKQZw5nfoq\nZSe4Enpw5BuRlNA1rAC4JnON4AUBageaLv/MP9LFtsXITrP71FL0+HG/9yT0\nUJJ0DFiF0UBkH1G+bUyI5G+SZ4VtynbiRsrNhe4YhWoNCMtlrXxfaIb1oY4w\nKudF75TmZ6u50/qkpu3FUj5z2oqyeK4+nv8os6IDgy+fw97VMU8JYTufr+w9\n6lly/3rQGWJe8oZPpLsxFm7oZZaKPlvmvrepo0bKIzORxbffs4U/9l6fEj4R\np4lyTOWkGpAjCKTaCJ+zgZ/19MalaSNVSMynGkJG9VGnGDj6OytFQTZyCVpB\nBc1uq6V/dWLTP5efZVHQJ6vLK03fqJSNkAd2ERjZ96L9gDQenFLVEfK7pc/m\njExqERf+c20hOrIhxb4udDGBESH7i+77dfLcPIbog1Iz2/QReroNHz0K2GZe\nQCh/\r\n=9fFL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCz2wZ8cH2DL20uJ9xNVfGGQ29cwvu9G3uXlFut7wstRQIhALnqEF6xWkUacImP3AjMChG/nIl3TtPAXlXcrgfZ1OQ9"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.8a62c766_1544872334744_0.7989715068746774"},"_hasShrinkwrap":false},"0.16.0-alpha.8f018002":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.8f018002","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.8f018002","dist":{"shasum":"3f3f42c897bd716e7d340c1c74725e9aecd8ac9d","integrity":"sha512-sh+QnU3sDn+X+T5KpBRz1vFO/J10BnxzxDsYchITLRvsPJusf2Zx6XGNWce3pYwVn9qOXpYkNwkv5YG3CEWemA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.8f018002.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFONrCRA9TVsSAnZWagAAXkcP/3k7c9X5mFiqrxJyg8CO\n/BAWr1uN2pZT+bzLYyqyqnxPTzGPLR1q8dxzH60lo4THzmsEVwpQylFi6MZ0\nY4BzfZtgbT3RdfcLUqe2HgW4R8wmEIb6F1VHbGl4oSSXgkfqvOkr2TFlLJWZ\nMiJuVdpoH+yNwxDOgEdRFMoQUuCZH/BYcPXu1sVfR/X1Sdf7yjuqT31hB+S6\nyBXhNqz589+JMjgmiS5YApaUoSpoKZUF+BrBhznjrWNgUmVFPG8XOhehePYZ\ndwjiRhI3s1tSq5S4hd7Z8QLNuJpvkUYi8VkSMWJ4Q0m25VKzzv3m3rSTe30b\nKZrSWcD2t5gPEvChRFHMOSdlPI5CEwvou3rSx8amRL2p8uhkylBbHjgCvvXF\nl5Cc4hRdH4UoDiU64TT3zv+17aTtxJq/KK4LacBqYSkLXd6JuR5xbUFSaD/o\n08bqrR8apJ0x3V/nK9FMMIaXayAcK83l6gUay2Zhy/0ot6bdwB0vVsag9ZsO\nBXLELN2kuaO/2eJuMpJPdmzsf5lbxNv/+z8ZvKwhNBc+La7m/V1KcxCzYgig\nDJxV7djrS1g3dstH8e+fO9/mgXPiJlG8QG6YCxEhDSUXOCKzPcAM8cV4OYPU\nxqqN/ImdU5WwadnfCBV2VmebjN/kJwpfu/Ho6xrqa28KTffQ2C4kVPrRoR5D\nvT4o\r\n=4Nfd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICcmQcFaclzXqe2Y4otrB2Kv6WNKlhnY0/XoGr4IFKGAAiEAouXqbprNtPQUY/udT+uQR/2853LujDfd55DJbtBBtvk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.8f018002_1544872810399_0.34885846588755"},"_hasShrinkwrap":false},"0.16.0-alpha.d5369d38":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.d5369d38","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.d5369d38","dist":{"shasum":"49640f9d6954fb264bf5543e08a7a3335eaf4240","integrity":"sha512-SJAenOarg7YjR5IrCydBQdUdNvvdybqDW2iTiEGIOnWweGjR6n2tydJrOKv+KRqIR7K1GdVExwgXQf7Fptczlw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.d5369d38.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFON1CRA9TVsSAnZWagAAEKgP+gOxDxwTwf1s10CLSsl7\n+GfWytbW7LjCPsmK7IFGbltsxYHICVUaF+/wnzbihhhSbqtXSxKIsGIC+ADh\nD74ptqSegbQQu5LscrjssIo9AhB/u77w9tXog/Dme+axYbJQa9KyKGZWkRwn\nkhl/MeesmlkhaqELaBGsLAmpLDBDtJntMGzlFi8JYdFSZ1VGDBePjPGPYB30\niNiKpKX6npWcevoIqneImSsycE4JbdwcL+//qv3UHhf0gz31YAUbsSbZQJfx\nboUK4i9Zl3zDxGdDwt/HBz2jrIf0QVmzFOFfNMJwUY+er0JalZSQMrjdd9nT\n+mZe+U++PXu+QJXSOsd6XAfbFa+bREGgFaz8FDqBYi05nscjKKg/Si70wrWd\nDqh4wcVOz1qgXj+nRJQsasVwccYHGL0u6YVOKiBUJassGTOBpcJT6z85gv7x\nA1c6ZW9ZP/dXsmJGWNPhHGGjKSO25IF86Hq2iSRZUf7dg6ZinoP7uNUoO5MD\nTcJfjWv2FQqFKvMDXvGH64o4xRedXsP6gKO+t4piHjRATm3aOWCMPJy1/xcs\naG0evDW5Z9uLybLExW0JhXCV8lHaDpZICzdbcZYmyKmp+n/48Y5jUlbc4Zt6\n0Kco+TtFSA/CODaw6xMlJxGtV37hPBXTz/4oaurlBMAGY9bcNot8sbjk8LaC\nqd4Z\r\n=WPGI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDH3iMlRBZ4gKMZ+w7OSctq7TI9oAeAm/DWDarLBLp8qwIgadUDIhu+mhVadTn85dK1h2tZD51pkkMGpjWegrePAC0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.d5369d38_1544872820706_0.6009037728565927"},"_hasShrinkwrap":false},"0.16.0-alpha.6445d9ea":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.6445d9ea","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.6445d9ea","dist":{"shasum":"8a0d6f42b8b8a12b998f02765044bf16a3311414","integrity":"sha512-HhAisgMYxB8xGpipde9TU0RSKAVlFx7jkTwmtrfXuBvQRwZ0I3KIUzytohI8wSNVcAMYZ+FlclYvZJgskDGnhQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.6445d9ea.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFOOBCRA9TVsSAnZWagAA+oEP/RImsJK1hpqqrRcb16cY\nUHAY9Mr5/jozt6XhdTrvFHSGVC0uxA0kI9FCcM3LiBKMf+INBK+hV8YWPV/e\nRsVGmg8BdJzjR9tffYng0JHx7DapLhToX2krnrd/nECT+2rabCbz6mAHTBnt\n6dK1jbxQgzilL73vyOpMb0a1u7hkfRqnrIs3AD3HFH600eEhzWwrWBEuW7RN\nfc6hl/5x5FtOgR9BZBduNFK3jfygdhxuamtqnVU/oiAebaYimyqSEPPaWMeb\nRFYjpMzb6EzB/k1/WKOW5KWjALDfoCn4Zw+jIV9txDTz0mnRa/jm+ZW+SLg6\nxyMgEbpMzLfckUQ4OSsxK4xC729Mdw4Lf1DH6L/IhzWGIHboOPJusk1OTHXS\nDPup5mkbu999BxqCq+KsB2nhJzLLvZZXydecFpaCMShiE/E55KLduKUTUpDj\n7ytThlxjgrdc3yFOBAKlEmKFTUmxoAf04WY6yJiGVJOIDSj2AxREQ0u4DFU2\nwQaEbp93HkeqwjYcR1NaF4q/F9tWT7WMa1AP2sE451XfHR5FFui2X2MBp2kC\nfxRlJhFL7hjqkAfRnu04tAQGU1EjEdk1JVYGCMAuV7JnM95zymdl++H9Wu0Y\nEDZMunodjDZlPs0HFfL5eiWmvk0prF+GwgpdsHmv8IVtaqEaIZ1UpCGlfDVy\necan\r\n=73Tw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID+0Zj6uSuFjr1S4F23G7TmZtqE1+u017G2hwAXts24dAiEAqm+j3LKA6zrMfjL56lkHgNmN7dTVVpeik6j6GOrmXK8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.6445d9ea_1544872832981_0.6523028404864519"},"_hasShrinkwrap":false},"0.16.0-alpha.de9e59b8":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.de9e59b8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.de9e59b8","dist":{"shasum":"3a0926a5bf8400a7999e1996aafb04b2b60f4f49","integrity":"sha512-YDjue3kTrRO8xKq5xOrlEronZmuTAmyHJiWdsLcHRd0m88bxEiGubHan3MuBHZ6qOr/1vgUx5QXogYMen6Mqdw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.de9e59b8.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFe2nCRA9TVsSAnZWagAAQUEP/2lHu0RfUxsRAHa+7/0h\nSc8qnqBQAS9q5QgJI/y7eJL7vhJINmqRFhNXIjgDAqc4esb5ynUycZJQE5A6\nKSnsk9rwx87ziQUhmxt/WErkEleDjFQM/78/ALWGmIJ5hgUV1/YgdlnHDPaj\n8f5Py5IsvIDeIdhvIwIa6rqvlSBTwRNM6WgN9m41WFIdc4JLMX8W5L9pf5HY\nQxXNHu9dyBmrkTbN01iQuF1VosKE4lFqZyy7kukvQv8Phxur/Wn3GcYqHp5D\nYa6Xb7ZDgz1694oAgL403Dqu7aucksCr7H5Soa2Q0cg5MIYAVYtvHBUwirvx\ncfK3nLEN+ZMWp4jYDi/WORSoM+SoEDlmsZAVfTHnBlFZ7xCq2zTiaGdBMyCY\nN0B1fnwroxP/OgQ1XMJJJDapXycD2BubxeR/zyCUF1FGXYcBiqsEUaNUlD2d\nRa+IpBJSbrTgoTER0zfVb69dMP3EDmZw7r1VBttbvmqUykXt02NFu6LcsVua\nHpElF8vYDWi08z1p5jn0/KeO51HmYG4GQAdrwzt0m6Kur59JFrzOPlFO4Cg0\nV2PSL6YMpbjCfLDIpwc7dTYU71P7bhfpYIW+IiUTza64RFChz3YrLkKMfKlC\nYcow7h/G/RT/5e4/o1dXbEFNTy/QunhlbXv8+5+fP7LSxKZCLQ+22a/bjDl+\ng2FD\r\n=coqW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMIiHCeCRWc4tiBFz14Ld0Zk53TcIHWomxAQnc5rCUPAIgVGTLDpLhLn/MRNPN6C6+hQSS4cQYzr0kv7jLC/Zs2Ds="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.de9e59b8_1544940966840_0.17494318899430183"},"_hasShrinkwrap":false},"0.16.0-alpha.25725964":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.25725964","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.25725964","dist":{"shasum":"2b42cedf5e9c11965d42dbd0816f63a29dd71cc3","integrity":"sha512-0Tsp4KIFRUo091EbZFSNwzhxLV2V9T5AAKynE300oYg8Kbsf1a+2jLNGeFYO8A3tTBLKeuItfcg4INyI7iHuvQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.25725964.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFfPcCRA9TVsSAnZWagAADxEQAItzbeDnB9/Kn1w+RsoF\ndx0mbkjLMNRh3ujM+05+qK5W6UCn9SmTgKR6C2fD9Ee40HKBswCEB9+vj3zp\nd1FkcEOfr4vcbw6abdL4nEQqTbVfY9gk7Z5Ae4ZGoLAA7kdSNL6FvoHyCFLf\nyOB9Vo0tFFYSt9eYPuMvlD4NRCx3ryNYXp4o5QFkbdfIh9mxwqekaPqfOgiK\nZ8zr1lsexdcqwbuXnGxZTMevl4YorOBpqZU5Btow5k3n9UK/o5lBNAUqlF42\nWzrJBm0KI0XoJTx6kLDt9WWskxFYXfD0u82kg26jZdUhTBRBo+Qp+yiRYLNP\nGd4WwBbCjEMkI/OsV6lgKKSp+2EC2Mnoyzo7jrmnGTlPpSxOMTlsn5wysxFi\nYERzMS6n0QFSOnn7iGrWEZmOE4Z9aJ7MAYPafcOWwcoOHZZKWXQpIs9Mrwrl\nkzdm0DKr6Mm+PEFL5wHO/32ZJ4mJCgSlb2ssDqNEc67wxHcUuLyIetmOZSzg\ndzU4+A3s+Q3TueZTxLoA85w5MVgbh1sGOSnDxJl/7kPDe+o10Um+Jhigvngt\nYY5lNDBUuSTCihomftA3ZZWIpQp6yke9B3NiiSviHs4CL4ZMnciEJu08FWHF\negiYuYSytuTyJ3/mG/xUp3SijrQUW5RJJTNDaztue8158ryEEfGrRf40yz9Q\nnj1w\r\n=QGqm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHXWTo9Q0w/1A1NVl6XdxEnavrEG7JQKg+vGmpCh8W2UAiEAt7pvG0j6KQxc/QrvSb4yehFtMjVPWQ5WXylAr6rxDpY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.25725964_1544942556288_0.7362535789399371"},"_hasShrinkwrap":false},"0.16.0-alpha.7ca01db7":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.7ca01db7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.7ca01db7","dist":{"shasum":"3f9f4ccef229b47a053e3050280af17118c7e27b","integrity":"sha512-/3St/3guopM0XaYAjP7LY73Qt4NQFZYirROGZB1PsW5VlnIvLQohSCRCNUAS9TkYAYulNGmXBvced27Myq35zA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.7ca01db7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcF+ofCRA9TVsSAnZWagAAq7YP/2aNjFBdLz2u/gw3NXXx\nNbC96JMLpqjkE1QUvo0Exq5mJonPX5DdWY06ftjk9NxPem1HJNIbjEI1i8Fe\nwqf1/BJYt/rQhHzMZrtGR3Z2CbLPYWHanaKpiacJ9KEEACBAlqJ+xAtEkM2Z\nilKl7k03Y4y8d+pYPGHBsCe/TOyvRWMjRzXuKcMmVXWAWkZi8SjLolpchjMP\nCaD0I3OD0Y+9LLGyRiTkU2shgRTCO5kr+ptCajf8IOKJ7NOTWL+ZE0JK8aty\nMJRzTZIOiO4tE/9x2F54WRlMyDIQ93dUuf3amoKz05kK55RUjpEvF68AY5mZ\nxL/MDawqCU6ieBEWKua2Z4J+xBLcyg1LqIgrDs1/ii+pQjW757IXtvRkqxk0\nRkpB74uVQcOtBEBSoSZJJWotFOhOtYUsoMZj2TiSM7O4LAh9RQusw9N7oqxO\nOPZZflJALez9y2hA3ARp+VBJkgbBZVg2NNFvI7fZJ09tQuzoro5S1pejP7cP\nUr1Hueel40jfipwgeRrJNrydf6OhBV75afeXh99DGU9PutHuEo1Rar0PQvUF\nUnkCHMAKEBrSYgM4DBYuR5goM/09ptTeFkI88npFWztB58L7hye/8XPOanx1\nTh6dm4EE/DGhuxmJQ20r7n47ZnxYHVzdbSATGK7IzjsaHAshe9IoVQG4rJdA\nBDCu\r\n=ZgJi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFzXt4nSycur1B2A0Jm52/jmapYPHMEx64+Himi9/C2KAiEAjpQjY9lq/29i8hE5yiVF/cnEm5FS+hw8EKI5gMQ9ewU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.7ca01db7_1545071134574_0.4728082625972716"},"_hasShrinkwrap":false},"0.16.0-alpha.39949785":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.39949785","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.39949785","dist":{"shasum":"817a9c595da9e7c732a1877492afc16637f95d6b","integrity":"sha512-Vcohd7HmcW5Y4+tpJ1kOgmCpsNreRWx6ZQnrBaTkJIwqJQWbWbA31zXqkKBxaJZ/8NXtE6+H/FvO0bIKJZLUfw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.39949785.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcF/PqCRA9TVsSAnZWagAAThQP/29zfpPr2IM1p4i8HrzQ\n0LpXnFsot/JO52AsykmTMb8KtvuEQLpAjrFuB6vc3mflSBMuuAU1OmeQuJCT\nrj4SB0ziB3NkJTb7QJnIkZtpLKuJrZMjup2dxzed99hVvQyVLeSK5SRzhWaL\n3oPRTP4Kop7LtKPrrjnAug7avbbn76K6BXpfPs2dc26dYxbxwSBadKnM7jdf\njChiMpcl6PvYUJtuPCaoUAgJLLosSoajjYYhBV5XC2e9+euKjZw/y6iuIiaB\niehZWZYwlL5qYOZdyGm8s6EXp5fZ6lRJN4JpKrjMuXYrUuTwr+5FAhrSXyoI\n3aKHW/1d3j8yzV25ZGZRVnE4JNKQiUvBlBW+Yd1ZTTx3xC10eTJrNl9f5qlg\nJFvgTbpqS0oDGNi9pzfOOHYSeh7WfAIyIaMRL7hbHVdGikVNh5Oh0Tm0EIAi\nllV69jt889hf9rla/s/js2hHXYPw0aTnkC/FbX6tmAZ9O7my9wwiljavyy5V\nRQBkeWiQ/cCzuuqEfsUIuQYamcxoSKw+L6+xfupAyqheIC24kYwBVMyCYt9N\n5USkWIdBCnBQ11OpVXfBEO4c1311/EPlzjAi9RWn7M5zL7fnAgSzmnGnGxLf\ncVNzYUdF6yb+6hDGGOKl1Cq3wbCyswHEje5Tt9SusfWNNyfANlGDPArr5pGk\nYd3U\r\n=g5us\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDesX4Mt4u7vz1L57L684CithZHGmxS5sVhqcRAu8tCpQIgH9Sa0LqAfCg8Wz2/Mrnbbju1pS9U+D4nxNChbknOgvQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.39949785_1545073641902_0.011595258371594586"},"_hasShrinkwrap":false},"0.16.0-alpha.1a27151c":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.1a27151c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.1a27151c","dist":{"shasum":"c79f424fa9be90f74914c9ef75cdfd021e9e65bf","integrity":"sha512-3Nwgm/TQowEn5GgcI5XDpWLgF2S7Z0DsJJd1gdQ4qi9Ozg0CAi92Eg6Ptpm/+MAB3srEQMqizcRhfS/sq5Yrpg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.1a27151c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGA5jCRA9TVsSAnZWagAAiAwP/jICNBQOUGnPrACAGg2i\n9Rxiv6At5vcK2Gfh4FEOickf0ENQvwsqv32sirRZIB0lsaNOGWC++YKusDAl\n8bjN5PPParvq0srEeRMUrRJkA+2BCjzGKbFFVbOPNok32R9/8h9TvGDB/clX\n8+HXg1/94jPQyWbJ8mLBG8W90ZuyVC6fiL2jDf8Ibk7VqrSWWpGQqkdhIe16\nYuHRqNIjA6rtPDAxqVJx2pbj+v/YJ2HO5r4NH05paZ0fkzHiTzhq5uxAP74s\ncKUXx0RZa6LNgA1sRjFgMUMfJsPPnWxYiIZIiQia9feChMKtyRpEc0v9JZqX\ng4dQHwAAU4kuHOiFE0JOb1vzpmS3AImy7x9Fr8e9KzI7BlYHACVCwYL2rTIE\n9jL5E04WyGifJhG3cGXBZqtkdYfnbb1e1dF5IrE2b1ILChkKUDi8E+9KlfBP\nvTulkQw2Z4qPr1VbubQNRJGj6eTKUWHHyvf/dCi6D2/8KtJfM0ZkUuKUI6Jo\n4upK8VUXfou4FlBmjhudYN2zIaI4xTfrkuTdObVJh8XQ2xNHCICZwcVrMdUp\nVhG8QkDixUr9K0/LrSkDSnw765H80LPHYW6+E50i8+Zmc/kZyoE/IUZ0utdd\nj5SeqaQ7AKz7CiKavzmE1EGDsLU3oGNd1z0tLawLzM5Veg0qEzgXjE9GOgnl\ntRIJ\r\n=NhtK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyGg5ybHsiWnqtURCqcZes+rh0RxCUy7XoiDZmliFp7AIhAOPLGg9vqikEPn2zgtNlGHb8rkQr81IdqZddLhPM5i2O"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.1a27151c_1545080419189_0.7381406486691091"},"_hasShrinkwrap":false},"0.16.0-alpha.1080302b":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.1080302b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.1080302b","dist":{"shasum":"104716db22bdbdf6675513495effe1232e3ab06b","integrity":"sha512-G1eNNIMmIAm1aBrA4TP2E5CfEc8HIGpg55VXprjrFMVHKTinEEvX5RupRosLzriWHfVGfdFId2W4zqWl+ARJkA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.1080302b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGDSpCRA9TVsSAnZWagAAnHUP/0QT9IRWKq5Mxk6SU9je\nZhZ5o8KdWU2gKtSB3izdrW2DAxNYdulokc5Prag7kfEC51Nnkm9bcXx3a4kl\nMtbGcsJuDuwrRy0SOv/NauKt7bl4S/0qdn4L5jGbDckg//rW0HFOcdgbRvTp\nRDOr/baf3xHVuaTDOJDGjWbe47xwJ0tK3PJ3mskJRiGZdbJ1YIDUUKkRQfMI\nfAaxby75oVlYcBsoo0JZXE2c/66frWMIm8YhCxjJYGrKysiZRvE4dCpUwNob\nP5nEndrxxL3Zt/BuEWHscv2cGQ14lFq2UkIhrd75nDmbgUX0ERamOPFCKdiy\n2dddtDSC+wMcZhcWM7bSHUzIP9uO6Yk1xQssst2HGDMdtMsUHDuDcYuEIw+L\nl7pR8qpab4V6aiv8sb1gljQFPX8VdzXkLunyyDD6QeDB1ywBVJT5M0WPrB2k\nobC+cHIJThK/cvcZZsRnBCGGMa/TdTrANTLdSoCkCkCDOgbZXfEZaec7MlWq\nstBN9HakOIsz8XzU1CwEsLYIR7etIiJJuDPNEOPc3HemuQu1BZm/0iY+GkGs\nmuCoYxwnbp02lRFifT4F8PgOAAfB8jHS7w+2P9p8ikZvc4ekAT7JjTc4M+GC\nQs465JIw6424RsCXuadwDSlog8UCMBTqjy61E4UJ1BBsuNHRBHbRH7KrstI0\nechF\r\n=ILVm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCE1M/YOKYSdg5H9FtZTvNP8PZlU91Ujc1mPtZOqPAxCQIhAN2SNqwDYEn+q/TzbJMIRhtuaS46zZPCop2VkoN5aDQQ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.1080302b_1545090217182_0.4729313321046116"},"_hasShrinkwrap":false},"0.16.0-alpha.0e47a44e":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.0e47a44e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.0e47a44e","dist":{"shasum":"398478936d6f4e78bc62ed3b6876dcc03c341223","integrity":"sha512-VS9d020v6SwyIiCEqXhyo8vAa7aarV3Z9nguYek6/lsTiQM9NmkE6BivzsrEwvWSUIQVyN8+X3mPYkqCM0XBRg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.0e47a44e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGDS2CRA9TVsSAnZWagAA7TQP/2m9gVCkZy4WBIVLBroI\nPjSQaYDHC6sEzZ83/ktQHVVGror3reYvrq2cgw1KRujB8gYzA1Bh+sNVjHzd\nO7uIscxp6edPoGE0iohcc/A0gIBf+Q7hIzvHcoqxUOU2AD7wviZUbFAh3Wtr\nz1ol4ab8CkRttyyGoqDQZQrh9/2q3hoR4f5EdrBJDNklcrNPizIdEidZtwiY\njjxD0fXM46wCT56Fj+g6SbCHu0Q/rnCA4wX2U36Q4YwCE+VvuIntDcnAatyC\nQRHe59WHXsMQNbnxijTeZUgKBKqmc3W3FMP6d8zGpSR8rzba/Ke7Qrpo3eiB\nPUw9eC8ZG1C2g+9tgIdfWFYjCp0xDELjL19+WrwL3Vn6ema4tjgQeel1FTRD\nrMg1EEIDIX5FoISv3lXeBhqhS0US7xPjOrgMrRtGiU6C6IiyZU7BewUOdmFb\nJwdTrCa75PlZ1Wq33QaXKmOkF+7PFXnenFYTL+e/2yAukavkMDeroIKvE1Gq\nrBIcZZ/4UDRai4HT/8vL6AzVsXNvLCt/kNLwHBwJJ5wdQWg1MoE0jNz+1B1m\nPWCcqZUjGGuGc7raD7YeMfpiWQ9vV2L/JurSTKuQ4LygpwhzKZKflODw/QFV\nJctbKTyIWdykTV6URbqi+8lhzLk5v4F/d5Q6lRpwbgFMP22q3PJqT+RtGcll\n9OsA\r\n=LSAB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDso6lUmN3aZ4XEz56dVOoRkiRvH+m8Mknq/3Z63PZdGQIhAKK/R8AyFwhRhjSDJlXNHis005XvE8Cyze0vBgWyibrn"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.0e47a44e_1545090230022_0.9253119167755859"},"_hasShrinkwrap":false},"0.16.0-alpha.13948bb2":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.13948bb2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.13948bb2","dist":{"shasum":"d437ad3a6e490c5f07102b759bc155e0829be108","integrity":"sha512-8NXswdZ2bp3TeJJOwzdvmO3maidG6/8fRIJ0mB9VYhvWMVwFZ/gOBeXFMOT/n4KnJdFzCgKrowtc8YUSHE5bZA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.13948bb2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGEcoCRA9TVsSAnZWagAApUoP/1oyxiSiOkd3xrCWjNCp\nC/h+i3wqnPxYC/3DPxOF2Ax7yF3r4/NfrQ3DM0hptDvd+EJmIFW0ybcIb+PS\n1oaVnIRdBpZ6gvt0R/4zU5IKtMJ1J4wI5EWCf5yerM+LWPp06lQPZPCfVUNn\nh1a6oWuqB4jQGHjMxZpl9i80iV3wrTHKffrCTIoICxk64hA7JMXNsV9Gy3OX\neKJRRnFYlketpYPylp/ZvqbedqzjzhksplViXhcdG0F7w75pplwYQ1jUr/Me\nLb+OTE9lHf9DhIDbwZcxxpu59oI18CNvhnkcCXFsz86cUmZpYDgRoyq7zcNl\na6C28aeKZWhH5gkwHUWKD2kbBsAeaZkGZuh2Pb68Vd37Uopzgc/1p336oKX1\nu1gzBatdvAtZJ3UhA3csoiJEomijYfTJbMOOR29+MoKaGeMaL8gtEdK+9kgo\ngLlxZ40EeIm53bBKj1pSE9pyLxa5QaPb0NMPkETdjyjRwB1NXyXofIP2+DGR\nT/ggobjils9xZHu88MT95OjGh3VV/8e7UXCvhtzujpE+/9YMGQXl4IubcqoJ\nO5SS0TcjjB4S/5WoHqo0gUOIXVd8eS7zxb73WsTMcQ11DWDhIwjpqPIGhRWK\n4IGO3ofGWFUTo2y6p/ZG3WhKFyMfga+gY8q2TUCPbNAYnVK70Sg1l2XYFobU\nB7Qy\r\n=6wq8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAEwzlLWJlAVfPqHbOWSscK+4n93x0GavpMJd5tsvwMcAiEAx+kuWEw3TBv3v/NvIb4Ln7FRJStr8qyA385Kez5fVmo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.13948bb2_1545094951284_0.19037537936872595"},"_hasShrinkwrap":false},"0.16.0-alpha.913ceb32":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.913ceb32","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.913ceb32","dist":{"shasum":"2ecef30c792b6c75237c7949be0858d6fc937b09","integrity":"sha512-Js/FIlW7PK/iWStgIVEUE4DVyZHmlaO2Gy8Kl4wo4+nz4L95g3QoRkbjYZ6f/tuuqx/HPtJp/SyY+TPp8c2tyA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.913ceb32.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGNubCRA9TVsSAnZWagAAwKsP/1JY1wBNN998/K/5eQGj\nF6iluO/VuCi17rqOptnnGhikcjTOmlS2uMLIy7mZOtSVJVF7K8/wNyplHBLT\nw02Ob+kdL3Mg6JHoEOSEFSn6ffBdKeW4npXbamOg0bmpDZV9fWjrS2j8rXMr\nbeMHZ5T6U+1/MDj/ZZ8LnSAbJQf3ObUcMjyfq5rf5oe1oeMiAqM4B84BTXPx\nCruWXLY78USXCMnLGJZY2BdXf++HrUNRIwj0Fpo4O/nC7LSTEV42Hvc0RUyf\ndU5JJFPTMNtbHZDuUGRJYYljaSH7clmkWuAxmaaLRCNCrCOYDy4aqwzs2O/x\naYyC/XivgAsksOvBTeFP8jXARseJ117/2r+PVOA1EfGJAM2kijQROistpqu8\n5F5SCnhHxGZmVnWUKUliC6/+FrjW+aarvgmRkk/ulR5NtmUTOu8Akc01mvQI\nckUVSZjwCs8RtKmkhNmLtCMm21fMRa71IKyrn3jSWFPDEn5rm0phDazRQ0Ey\nzEwp8A8QTIFmAnRbnWa0laEPqEbCajt1qvVd+gWtOh3Nzp5VUmvOCbKR96Xg\n8q/M2Ze6tZqEY6O/7tIRQ7423MbBRkTbye67NMnOWt25Vvj6b+JU1pRSn/Nq\nmYS4Gpk4Eo8ifAv30ntGSjDUA52Uxb+ZrRNmRondoAwLTPD8yneFrnxHa6Mv\nsR1B\r\n=jvxT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDm7OAkm8WDuNYvT+LYR2S6VSfNHkP6Y1zGKO+l9vXdUwIhAKj0QnoQs/RO+dbhx/m79gBejFQ0jfq/9luIjr+YlJbo"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.913ceb32_1545132954684_0.4523568140079923"},"_hasShrinkwrap":false},"0.16.0-alpha.a0347a65":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.a0347a65","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.a0347a65","dist":{"shasum":"7399a6eec1e8ab700edd8b1c2c1c1e7dd4756ef2","integrity":"sha512-RtLUAMmTzl+kl9U38yh2h5C+IrclmfvyeYNbHdS2CC0DgCx6DfNVhbO4Mpc+XYIhXme1cjQlvTWxm7mN4wC5jw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.a0347a65.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGN5UCRA9TVsSAnZWagAAzOwP+wcnMtf9UQ99OpsylwVN\npZSf1R+HhkTu4dbGgw9VMjtyTqmP8n/wY73RlTot6V26JgM9t/wAHj7Wlv5Z\nYg1mMIsSFvCzk+jkJ3MAX2m7VxdpjDyb5RGDX2OGdc2bWE/MRaypFRY1cYZz\nS3Htpc8UB/0LeEfFGMSszdltPD7j6BG5mZe7Q52wqc8RpvZH670OoyVizlKb\nbE/+i+iGUrfsWHY0E8luNb4p4vhfnLxZyIGwVIrui7280IOALVP02uzD83wl\n27tTAaef5qsGW4XQULRAtWUTdpIBCujUF4iYHcAlT4//p+WpD68j8uEsR+zz\nLDeTjexc4RV3fYrb3Us0T/8biAno4a8SAa+B3aEAihWtpFysrdSaICc6ITlW\n9uPWaBkuNeLLNw9VZdK6eqcovn6jyug1uxQz9Ndkhix2Y/lSoy0Z53mBl5Xo\nlG9d+M3TPHTImlAfAHSmvol61nw1e8irl62OQVgoYNtr/JLs4xNJhYQ0QMf8\nwEdUtjrVBK3AcEHav1qnviykD8icLX3B7jj48UoUgTtrEtTdsMfA9l0g20Sc\ngqtHcyCrZV2YqQglC+liTesV6UVH2z0aHVNEpJqaZrK95ssxAoN/8yaPQ0Sh\nNlYwbrdUVZDBPuyYo1p235bJtrQWUWnnoveu1X8Rx+q7Olg9Qqmec7aWAzTv\nlxRl\r\n=HF0v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoB8O40tORuLlZcCgyNLWudPnt2oEFQxXLKmyEpmdMTwIgH0iLL81BoaXPEO3EzYLXyejUFAipbOroHIrQ6cwXOm4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.a0347a65_1545133651728_0.61059340655945"},"_hasShrinkwrap":false},"0.16.0-alpha.10764d50":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.10764d50","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.10764d50","dist":{"shasum":"7f8827c4776ae897722348c073ebff93f79375c7","integrity":"sha512-Ll51SdF9x/52FcCFOjc1xVseDPOd7GQQ0/qY/neIZZ1iuazJ66gpJRbjr05BWbJkH07HfQ6utNbz59UufeE6Fg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.10764d50.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGO5QCRA9TVsSAnZWagAAFkkP/0gXHMj156OGRUJKpSwv\nY23Z7JvliyqKGWUkVoRqCpFehu0gmt8vbZ0hRjKVMOX1FnyqhrF4TWJ7neL/\nd6sRzuiTWcJfnfk1bbird97D+pCGRLsmuizaAKKPbTiuuQ7ywDiDBqjZk609\nwV2npXRjOqBc2IFHxrMJzr3ETdJY6UDXFlDkb86kt4loYjJorgs4rQhZm3Ym\npGpCpGC29PFY4Vn9L1dVx49Uf7Wet0731dmW0whAZernIjLN0AOh4Me52mWO\nf0xOHRakbk1MBj61Nzn4NHPL0rUqmdjBQTFvCn+mkRO8F1pB+NhkNTfDaJE1\nyJE+1LMzRYZAXvFw3wlnyuLCce9eoppkCTNWaAvU0Y3DegJSD/lU0zBYd5bR\nY3IU/7bjhtJfdS/IWZX9WNl8BtMuGHnDg8wA5T3Y6GhwsEAYqfKypvHaXtXV\neggzv9ClRT/9EYLYmYZ5Z1k7iAHB7aqhbBUdjjMrwSWmbBWvuefHXslCczxD\nnrYlpne6VhQ/5xvnnQnyaiqE/KwBVT+2u0Xp66z/COad27rsRkFcxCyuquqt\ntmfVfa227rXP8KW8fdVW/4wkKa7jKUVQXI6YybSkzDvVSQjgpTKZ290eCM7t\nBZl4XWLECpCs2mbrjo20GNsG5tfkcXaU+5VEqney821v03R57nn6cHOd2iRr\nUxPe\r\n=/rPk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1YqiiIWIEc2ZbGNd0gng1ec2kaUyHr6V4JLCvY9szZgIhANo4LTWfnuVVsvtYQFiIFURN06teJJQXpVmMhPKunDYA"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.10764d50_1545137743842_0.49112035787696273"},"_hasShrinkwrap":false},"0.16.0-alpha.4da7f92d":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.4da7f92d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.4da7f92d","dist":{"shasum":"ff81db199bcf88a9d081623f5d9101f8b20d2ce8","integrity":"sha512-auD1+fkYEI4PksPqRttP8oKyaF4VFZciSb/gNnrEl31o0o1MZSTnvxoV9ZEs8EqiyhLyHtzjFb2G9Iz71XUNZQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.4da7f92d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGO5eCRA9TVsSAnZWagAAgoQP/0lZRkGbRwwY3H4FNwkW\nHsNhnB/0cXIJUWm5Ek67IBIV/qtCeJFfya3M/mKqfSGu4Lc8NM96F0QCbMRT\nGlDYtoI7xdY7F0+VPPsH1u42csKzqBQ9MZXbF4w5C0O8PKarBhxHYeTRyMFH\nFbADn4ry+qwt6+wLHGAmaPP0bNcjpvUt5qJt/AUdVvtRLs2TQNi1kbzsjdxT\nIg8ksnVlx2EAFSjFeDO2qTY+WSmQON2WRfDZuSTaJht36yTFEFTfn8ghWCGW\n12B2lD2I4WqbhTzFGf67RTNNhtTaIAGjWJcBBAaMEOUTR4DfVdheLjXHIb7T\nQ6wnxPi5GP1JKzNYDFwTIu819vFAGwUKlIsMU8KZC736xNfXz+wm8WXvcK24\ncs8P2cnRtouRUNHUbashhMId7s+UIT5XyB+wlZQKeBtojBxqeGi/GsxR8XkJ\ncJ73H8kY+6EWoiVDVV/qhXK3h8LQlj+awKKsI3tj0sRxFCIqLBTo89muoGEu\n7fgxfG19daGcwae9T2iMVtbmoaTOWYUCQbnJOrowvz6MBxikEvAylJJbqZEW\n35bQAaNEPmXkcjLj0hivjrREFqu6kE3ajlg7/5LUK8GZlSWRCvGonKR2VROQ\nlAwOB7OEM1sM+JkIIDbSMwhaqMk92adT1+1glQ4mCs4+VqLFsVZFbzOiosRO\nwa1f\r\n=paYl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBUaSHkM82pg7nTWaqojMKJFZyfVTavXIqrzR1lra53AIhAK0N8RGi227izcy49BP1BQLUkHxr8RE4x4XgY9CgoYcp"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.4da7f92d_1545137758240_0.755551173091352"},"_hasShrinkwrap":false},"0.16.0-alpha.78089b13":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.78089b13","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.78089b13","dist":{"shasum":"4aacddce64b4d519c56bc3c4e734d3e5e141ecda","integrity":"sha512-zgG8YnCWAodPi8R32m6FIrKdgqHgIDugEI+juDlK19uvs623kwhYuVZJKWQgB4II2P+hf7Fml3CTXwThpY/PcQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.78089b13.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGO5yCRA9TVsSAnZWagAAOoYP/3PROSwgLEVE09ZiMVcY\n7lr18GDNH4DcC4zjaNYwRB4qZ+5t6wRkdEYHilNipDgldeYu9FlzsPkYBx+S\nNRM9h+5NqNrabkEPtLw53s3tj7o7a/AFbyN4GNdxJkSo+t21EMMd38UVVY3G\n90Az7SSiHQOUylrmaQAYzJgcGFBlz2YdWTWRlNszpwpJREQFvRflibalqBf2\nADQbOns+f/XDjYcQcuWMZyM2aCHA6ExRDfvdqzdfaJhuXKj4F0HK7Z4UsNTP\n7OecGEuLhGc23eMnQnpIjndG5cMf5Vu39xIhpgE7y3sq14/MhdpTWfj9edqN\n4vBEpocKVdZVq93ekBOKc8UWQXYm8oWaN5Q3IRyF69VXtEWniBPG4hoymTym\nj55s9BghrRMbl516sf1v4yARsx6ejeo4MgOZX9jyKkTnLTCFiu6no1VnIh1Q\nokrM7TocPZ5w3Ils/s4TNExzoUoPFaY2EQWZnKVal92+6YN/3VE9jG2Od09S\neC5d6mtfzvoPBcAdepDwAWagRvwn1xg9xB57/zfbiyIDnibefU7suL9+d59i\nnzTx3DwzjDUQG1l4QhFByejhE3UQo8DzEh2+6WSejICrO8xWC+bPfmJjOuHc\nSKi9jQciUoUk5QU41f0vq0B1H/WvHDD71mCBubVZIy0QLdL9gcaEm2Kr/PZl\nKiQG\r\n=6ruD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBg1GTEyc7Ri+tRy+D/WcIIwQ7CfKkcLK+y8vwE4caPwIgBr6ZJFVmkbVKZm91eamSq5Dw4T9o0EyiIca1XXGYDPw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.78089b13_1545137777895_0.37935718190358614"},"_hasShrinkwrap":false},"0.16.0-alpha.0af064c0":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.0af064c0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.0af064c0","dist":{"shasum":"788738a574730313dfd538d6d307a2f9a82d80b1","integrity":"sha512-iFo9/wZI16gZ9nYNdvXRv76LPt6MvwuhEg5dWWZI1Jj+0eLxK2UYzUWusL/3GF6VOP9PFNJ49EIo03zBBwohxw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.0af064c0.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGO6GCRA9TVsSAnZWagAACPMQAKDOZxtDjErcP63ra62l\nyzGyg7GQk8JMOoHwqsEKiJ0hzg2rkaN7BJBVfIptZgN11F2xAkiPCF/2Sm+5\ntR+rKAf+vMvsfUbt9OGlCs5xE9rOt1Onn34utHXm6QYRzDWOMyw/DetlVaPb\nOBH/AmIB9Nf2A/NOjXkhlxTIjQjg7UOXxo3X86Qzow60D3uyie1oTfp0ZoDZ\noZeh4aogUurRiCCEHJUGE5DFG52oLBb1wXJNPvMefMheJOIhsX1SYJ9OBUA0\nqE4cDWmBssZusPMDAEfZ/RbOKLXKchZtOvTY6AklDZVOhzpo8tQ4OHps8gzJ\nHP4NHNqWqevK8PWgn/BqyEhxGcRCHWOGB+1LKD2siF4/LRRUbr+wVQjIZLYL\nXNLTs0R3Gy//r8/D2lloafonSSEIi2PUlmcC4DE1iwIuIodyxZ3P0T6XdeET\nMOAuSGjIwNKsvI8FiWOtll0n1T3WWyEB7fF541N1uU2KwhmhGlBUshDxGwJu\n/RR0zlq6iqfcipoT4uKUBZFrF6B56uh1B/Fs6MohGZR4Pyl/KsZfzpARETPp\nQ1s/n66DerodBrk02hyph0kRn47q6XU61eatiA36NyNwvQnusrTiLfguSdRC\nSNTQ3Xe52NbrzAD8i1SC9zgisBnqMMeJPjAhkmgZGsiJmh/DqKFPLMvntnRG\nSFrI\r\n=483n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEfdwltHEjqA3MGX13INYml7nal0AF+7xzcUQ2MUg389AiBQXncXe+LXQ6pBIR98k7YAlixDufXpZFylP/A95uP5ug=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.0af064c0_1545137798236_0.5220544506972666"},"_hasShrinkwrap":false},"0.16.0-alpha.eb62e94d":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.eb62e94d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.eb62e94d","dist":{"shasum":"92be5e93a4bc643bce3e07121ef0cefba58d060e","integrity":"sha512-V6re6TjZR5rX1r9SNIXpTFLd0AIVVuNoys4+TpJhpOSYcOGQ/LU2sPPSDYTIkHxdo5Xq4SjAmkIhPVOWh5bOVg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.eb62e94d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGPCACRA9TVsSAnZWagAAqm4P/1YXBNhbRQ/k6/YJQ0N6\nhcV7DG4sbOKUHABlIevwBpnE32lAWZxo5xK49uRoBlCDkCd2vo4L86cBtk6H\ngVNtPEGtQ6H7eqO5voTIL8wkEMc9b9nkogN51zhO1ZvEoNXMPGF3noZtE6To\n4k2SAJbT0x/5q1wDyv5SodoaPR4kL4J3hl+Txjtz51wcEeQuZ5Ky4mR6XPWd\neM5OHRmdHIxlZ9dZ4QuVSOjPRvDVFSmTButKKTWpf44aWvsw6HvP7Xs1MM1A\nUBdRnsQuRPeij2JyJlQZQxUvbXlRYGfiUwawI/M3XT00/MNjkzZ9vz9/4pK0\nHJvDR5XBsgEPZlIw60ogvlJejjP4CLSZ9mvCgtDfsNhHNTPjpaURoLhclLKy\nox3Pgzr1F20D8bgwg2dKCUQv2dBLLvsDvQeqw0T9XCmjujS1TEM2k2+F1M88\nE1aWSZPnaRxX6Ja9/L3AJCLEqt8ljcDnIYLNW/NGxKHKqKsLVw5wk8xN7opM\ndDENpFA+MrnYHRRI5mvunn4Euz/O9EqgKB7u6Z43YxX0v2QHIlPKsu4wLpAn\nvvpGNoYuPN+6PSWw2+Lp+1lTr9AhoONtq7K48clDJc9Ejwu9K1kXu8sZyxsd\neWWhojXIXPerBTTdgJ255JuCGWR69YvcPPDeB3jTVfLd8qMTFJrV/34RLhHd\n5un5\r\n=aiNr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfPn42lYIQuRmQpn5uBdNeZVgAssbts8RXSv95mtLIUAIhAMwIqhwg+qF5wCAuSrelFHbp/HyhqVKsjotDACm7KLJ8"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.eb62e94d_1545138303984_0.09719831971755122"},"_hasShrinkwrap":false},"0.15.1":{"name":"codegen-templates-scripts","version":"0.15.1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.1","dist":{"shasum":"4fc4dc72815cdebed804ec40ecb7d3a7417f3640","integrity":"sha512-NC27F6KjTsw7HnNRHrkGSwl5DQtbHY7hnnZmfZNdMHkFYo2WY8Ugn4YqaBW7YcfMZP/n6ofcxRypaTpwnDp4zg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.1.tgz","fileCount":22,"unpackedSize":16711,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGPSnCRA9TVsSAnZWagAAbWYP/35zjp6uZ/pXhRbpgEdF\npBkPh+MQ+xxbcd+fmzg/edoeFy04GOGc8E5OQ2kBtv52LI/1+WBxaJNN01N4\nAgME0wAS7CIeWn6jkmNuhGYfy5W47IKMqoa+4ZMjziYGtqNMXVOZtE60Z6WO\nD5y4NOW1zDICqbh5CKzaoBl+eTLoPQGJ4JvDSkNxY2u9r5Rvv/dVsrri1YSs\ncpNueQ2apN7jBQac/UJ5TBESS24mILvwNRTrdhUJuOvNxswtxN7vRY4cHVaL\n4NgLamKGi6n023CuyX+Si8wIMNKYH9WOuieRS+JQl47YV9qVP2e2kvP2hWaC\n+YCB43jnk3/Y+L+epPA0wTEbBSJu2YGBvXdYCTy4dM1rI3afGgKsoCGjhmHr\n7Nsv9X6EgOi5qOfG2wn139FVqSXXsCkl6uPIpXldiZpJ47hP6JKF5UucVdUs\nbVgfU6uJmdcRiYT22+P5pm3RBL7podS7gKxxLrmcHthdszgo0BvzOdvKnNPh\nX79SY1Fpk2pWZeVFNDYULEY0FeCBWFOv2mu+NHr5BszngF0RDzjSEe/BP6UF\nXTWV86QoHRVnnFdzRmkwsqEytVved9kWzxSOVBtIe4XfsjPIljFHBfiUmGyw\npf6TE+wmIPtf8B7xpkY/nOzt4/sIz31a6s8a68d+Bg9Hv+2sZL6Dagm0ipOf\nESRT\r\n=3Yf7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDY7gVlgepywYhhO39D/ccoK5qF4EG7NsrU5X6y6Zd8RAiALpe+IErW/FJAJqfeA2GQ6AV5KdjkxtBIwjhXFvpY2PA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.1_1545139367209_0.6135399671394541"},"_hasShrinkwrap":false},"0.16.0-alpha.574fafef":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.574fafef","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.574fafef","dist":{"shasum":"ec3b0c2d726a64ca4b62aa6b0dfbb7394ef4a66d","integrity":"sha512-WZdewqafEtvjdPejJoqWAO8byQWNgMZ7VZd972dxWPwmjhdEd9MkWRmPTc/Z+dCN8bQIxvWq5MIJgh4ryMfj8A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.574fafef.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGPXPCRA9TVsSAnZWagAACqIQAKAfbw5mO8Cj/boVhkfz\n4Y6Oa3QxW6LRgOM1k6V6JwwCQ7TfUuqIIcGMe0sTtVzRHHO3YNMAaGjNkbuW\nSKmeorjfvuWGIPVVul5/m2uAj5KnhMBxxRHfl8+eTZnh4LKxIRBRyfsybtzN\naTQfYopS73dnExIUyn36cGbe3xdXjmLdp7Au/ap2pBxqQnLXAcjZNO+owSrX\nTfpbu+ciA7+ngE5AH9qJUsJd60XlHy6Lj+x6bborrT6JSckr+2cbCeE8SnN3\nN45mfMzENDaA40EPma5GD6PKISh419Zfq8LUnPnoLJXQY6SEYk5WtOem0gdJ\nLIV7agV1g4CIwg9QTmJYtPpXMRWJGejN7NYd6TkNYZJjKPaHavCK+N9UHCiO\nqrRsqcyDm0ZINWi73zSF/Twto66FKSQ64s/u1X/85TcN3YAYRx1JYsVOG+VZ\nojY/x4xwlVRJUpnMAQWhkVMVtXHF/ELC2ZQcYfFe7acXW7TsoHriaxE0qbud\nT0sBg8E+kJfxCclo6pee5JcQmaCEECrRqKIzHvMBmNxRJmG1HkBMizBTKICN\nZ6geKOtzMkF6P1h46/EPvjYxJi+EaBW5sKGZqt5+DgemvC3vF+QpaSCyTZdo\nOPUoMfaw9wbM31YiaGlMinwYuRrHPO3tsG6YuAv19SfMNWYfzFWJ7fah3kWo\n4yL3\r\n=lEfn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6OuTG3ZVEXfVkTuEuzzL2ilZ8OlHlLXeew3aj0OKRyQIhAPcFwXp48ZRrM4tcaKfBhS76E9FZ8pB870hhRgsqjvb4"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.574fafef_1545139662648_0.32376691060297147"},"_hasShrinkwrap":false},"0.16.0-alpha.551eb3fa":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.551eb3fa","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.551eb3fa","dist":{"shasum":"b206ea87206d84a33cc0842ea316c2148c1288bc","integrity":"sha512-H/ftgJaNk5TXJaeMhF2Ayxgbn+bSpz4j3L14Ee2TWEEwHM9BGAxTAMEnntrBaklZd9pwMqIeAaZjNkcpbd2jYA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.551eb3fa.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGRcwCRA9TVsSAnZWagAA0KYP/jXQEi9EAsuAbgSGCecM\n5e7T90zMKdRqCAywDP5M1wu9D29L1+7gt7Je5pnFJ2p4CtBbUQWPW0MLtbYf\nNDByhoOFnDU8MzUBXjdnUNFV3b9kzGXB8nqcNXOaw2mpCBPpPuflXQeu8ut8\nS+bEr6qWh5mPc2UqruDkT9r+i2s6A8ne6/LouBerL0bbH3KSfEl3DDICrZ+U\nNnvfpPQL6PhroaFXyhvciC9C2orTGU8wdRa6+m5KXscntB7ZlmUrAOgnWmDO\noByHlq7aTiSuTalwLSLYMb81hjL/3d93dvsuyPTgEokS6M5tNMjyStsHB2O1\n08LMcgR8pAQQsiGorcS8rouTbQOIl87huk7i/i9LZlOiqQIYOUQN/Rb84PUQ\nPuVZpspz2GpYBL99zKU+QYembRfCr/X/52pU0o359LIcsujfqrEYRiJFfhiQ\nnUa4/VCMVbhBWiLNW4P5ZeHaTpp9T032i9n1V98S1V3iyh2E0v6rSkdvZheD\nuHJmW65bu3V9ioi23OCsccn6ezUKJ0VzmkJ7nXbJQ848Qm2ea9N44GvkZ3yw\nuwFGIlmcdrjWO5rx5xaX1PbIg87KqET2x1nfwZFtA/Qx0PWICOdsO4lRCNKJ\n6u+ECZ2nWODnTDPop9ITr5BFpUkgFAQkiB97oLyMU0rnFiI3+EidBdoZoAcH\ntWVG\r\n=7aOx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAurBGUnALkLffMSsqNaNd2xAJjG/2iA7ozeq8OhQn++AiAXudvwoMCdSMrH1Z6nAot8CxjVlefcdrB6UjEW1yp8Uw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.551eb3fa_1545148207591_0.6144499210230387"},"_hasShrinkwrap":false},"0.16.0-alpha.0b3d142d":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.0b3d142d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.0b3d142d","dist":{"shasum":"80381874e8c7b366e44dd49e9d113bd642451599","integrity":"sha512-B1o64UEbtlNimXSmGmPmAyQygTW+JiW3QIn5InM+iCELpka+2x2GQPc1zN8UpayKftoEC/Jje0aEVJTbgtFtXA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.0b3d142d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGVF/CRA9TVsSAnZWagAAC9kQAKBKmvJj597Avul0qrA9\nIWhUBeMARD8y6+j4NFbYwein+VG23LYEVg3gEtobyRMUwyNyx37EEDGr2qB2\nM/1Enb4sYzPGI6/t7HMqPbDrvHHAB7HmGKHeDecfzno4c8bMEQdTNI5cCA0J\n/5msygBeeJ79aw+eMqKzA38NyzpYsQ1pwthibAj75x04ObdPykzfGLWvatXd\njQzDjcutX27nvtoXshGnzWDiwsuv2+CmeMsjxIGCw33DBmHGJK4YlhIvsTZA\npm9L59CtWCEBLLuUoDIbmF9fEmm229n47I7K9fh4gEVNu6vbM/8em/CYJYsj\nM5P3dt6b+54MRob8KK11LDPrz7z03DuOHR1FPcwCwhI/9BWpMAohEcjZJJm3\nVKXGdw+AzTRQL/Rpgi9K3lfcUCzSHrc+tU+o4g2Uae/PZMIKMNv9XWfsKjCi\nJkKMPjeIDtLFoJWp9RyOQXtEnyfciTpsib3F1pronPze37sYiq94RPu/aLSq\nD0iCMN59MQmSiS4o6meqjjNyBDhtEsK2VI/9X92wZV8yuRL3dE38k0SLXFx+\nexr1ha83xq5MQN384kI0aHP5fkE3VM497aZAshP3JxxZOMGD9apexCsFh95s\n+PR8wI34odRh/Noz7fL2CYPu+MAvyp35bg5J5KNttzR1aqlcvzKsapKK2yoV\nhbeR\r\n=HW4h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqCb5PSb9khoP+4aMnE1Eu3ZPo96eDxK2cUQT1xwWm8QIgBHkg5O5P9Ka3pP07yzYcvLcEREBoanwT9X5qrpT+EZY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.0b3d142d_1545163134657_0.6522077363907621"},"_hasShrinkwrap":false},"0.16.0-alpha.67231f96":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.67231f96","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.67231f96","dist":{"shasum":"83ec04f82e6ed4637c75adcfe58062cc510e777a","integrity":"sha512-lBEpXncTIb6UelwM/f98UbJ8pAGKqj7MLfme7U4GywMoGPWAAMjGKOZ0V9Lsj1/Xc8NTNwt1IO36AyrxsAlugg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.67231f96.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGVKvCRA9TVsSAnZWagAAMLYP/A5DGZHGvv1thD/xILzv\n2RJDUjpPkSWFqo7I354Cuiv9CP+KuYKlPzjJ1R4xsX7Jjj8KiyigQ+mjbEBD\ncHbefQOvOiQd0bgtJRK48dx0J2nfvv8qX723p5x2FenDMy9UUhwbWjQarmG+\nDvsOmdK4ECy5wvMQgRjEw3lrVGgGfMbnmK3C2OjjWEi+zy5NOGqqV74LUMN6\n+oLRT9UBfdXCfDpCJ/QCWaYa3gKykiCUJoTsV0DYj0uZryGicpGm3kGXck+C\nH93ZLQ3HoejJQw2ogxVRZ4XGSsWzL3BtTw0zz6hB7Xkn0Hi+qbhHh7nnJhiu\nD1d7DVbFfXfwzgXywivNdmTH+dBZo+TgcRPd7Bfc+3qdIbSbjjc3ecuO6WDe\nvPQ6bHTZR+3Fm5JgRY89Msthmx9rBh1U4dmGtS4ygxzgO5xO738gpoxEF9+u\nQCZ61fjnYuApVP6VP/HpkGyisCyf7j/STFFyWuezOwATPSdaV3AgntcHXBoC\nDgI3WEtv206IdtRWrtKgma3AWnp7LpI7SebH7SojHhNPcRnxomOXr6oxtb0M\nEc6hgDkQPia2zJ9tcmexfZNQLuFoFEatcNMR/y5m3fNQqbw95KDDw50sypTp\ne6nmtr61tEG1li2EdDS3CLmwRGBCuwZFwWMwcCc6UfrERZ/Q+OntJziCLZN+\n5rxu\r\n=ujaB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQVokLMaVp6dd2dFLt/oAQz+iVMKBZf7V9+Hf9NkmEYQIhAMif/u+6XmuAQFI23mwY3yeGXGXfjJhS1amSSA3V0SNS"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.67231f96_1545163438806_0.4735298267907906"},"_hasShrinkwrap":false},"0.16.0-alpha.5882a539":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.5882a539","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.5882a539","dist":{"shasum":"47abc4f4f3684cd492839a6ad313e03322e58091","integrity":"sha512-UVFSb+PIAjrQ6+e7/6M2LwDEJFbqOeCRPGwlY1zfkyBoKs2ega/gioZWzH/JN3Sn+5QX+uUL/Z9nx3Jxz1ZPKw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.5882a539.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGVMJCRA9TVsSAnZWagAAN9kP/iIvA1TSfSL663bcODT1\nkv9XKg6sATNIZOLXnMZem/kV2UJEDtY2lzvwGI9B3iGX+kTqXKEfWVF3is1r\nOzGn7tQqx5zF1VZIMASPE8Qa2cYLMci/sYuJOdQEipXo2In/IaFh/9vPHoof\nIhiUoUeAx9fPGLI52v8AsY8xlDCoSv82wQhVh3Xxp20jO1cgCighrTGADuQH\nY+zoNWtbW9bH9XjNkv1ddjsivRkWZbTrpFG7rAIt6AUJqJtpW2ybI/BETT5d\nlGykHiyX6H/2+N8WHXAdqUhcR1mVgO+Z69y6LAAUS1xYDhZLBQtwT66ongou\nTbsPaXhKMMqPI9MK+HK+fEzNrdQelb4aZNqVbEUVwuiUdZNvjYqG7hezjTfo\nObKLa8a1hOya3lxNZp3qPtCWLLaSPLbaK67ndQDTOKyrA+dFy0H6E84CUKfw\nkvYfJJV4sW2Jfiqqb/AgWsPVwthRUso6eHa/MnAmQs3svytE2zj+RHmW/WBG\nlrqXvqstfJ4le2YpgMEae2SrLz94Ty4N5IOXLLmxZCBi8vCsqKfFJArc0aNT\njQjglEzpSIgny8yI9sZsF6pojYmKRLE+WTuTxM0hpc2wbA7Nta1BaltNYzl7\n1KiFn4x2278vgw//nqUZ2Y6jtEAIFGQVU2wdEMWkr3BNQcHUym9sD6On+5oq\n+FdD\r\n=lrLH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDcBqAwnZpSnIAMryxFEYkhUCiSEg0F+letGabV7vGb5AiAHOI16ehNEQu2BqixJxhr2B92Mu9YN4Y1S/29zj/WV1Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.5882a539_1545163528370_0.2594959881426129"},"_hasShrinkwrap":false},"0.16.0-alpha.6c2b99b1":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.6c2b99b1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.6c2b99b1","dist":{"shasum":"da81e166387fd6564a9d5bca524fcbc5e8a9cc18","integrity":"sha512-aR3AWXFX2CgeYw/NHF5mv2xOR639rAkQprPhXXsP6UTPqOBupB6tLrSo3eh6JVVJZvkiMmp3TitUF2YYA2paqg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.6c2b99b1.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGWUXCRA9TVsSAnZWagAAtFcP/jp18bfCOkz+X8WviOhF\nAeH3e+XD7E1ll/Kls1HrC2U7nVSzguny5vS3xhdA7YWHOuR97TtRX5N21oij\n8uOihq0q4yqQ8MOkPazo8IyudC84hDTKuto2k7C+dzLBieaF4g3VEtKdOZze\n17lC8jbL/i6d1U9n+A/ID36hcA3Vs2bqV5vsHf2JamdxP4X5sZR5xud6iUYV\n30OOieND+nsSJ4hFJoINN+UMDiVbKJa/usgB7N9v0Ab0va2GV/Cn38j9S4dH\nNzLcKWte/nPjPdITp4538B66d0DJgY2A1Z36GOyL5OH13WWkQo4bvPO1tSE3\nuNG3jwQ1nHVRhRgPQ4a+kxpLKQ1SvqHwNSY8rY4QAN4s0C9tYf8MK/RBbPrk\nUbAAr/u5S3F3vLONB5I/a/HiBAzbcgwDsF2c+Ql600XvFQMxfS1Yl7z+BvIC\nv0AoNXFecWZs8U8yWqnpeCzzVRRhHNcDogEfhJM1nfJGzNZY750zlkfSbdXr\ngNtkPSroewDrseu5RFFkJCu0RIWnJbckwAWIs4/pl9On5jyU7DaYy/H/YtO0\nHlMq0u0QHVhIxkgY+OgAI3Bp8qfLPuNxIJ9Zw3GQ75qCGCV3PaYfHuRZdFZA\nN+ubaZ+bcx4k9gZMvbyFmN1uxpcwbinFN16Om+h7WetFyHf872ol8+rtBu97\nNEOD\r\n=HBer\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCr7FpnoWsVqvZGnn+McsMI3wKmXXHQ3sBOylJhLxhUfwIhAISBi9fmeV6X8koQIXUHqxQmL7/nHBZAe0TjPsbYzBPu"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.6c2b99b1_1545168150500_0.7333501778837883"},"_hasShrinkwrap":false},"0.16.0-alpha.8552f134":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.8552f134","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.8552f134","dist":{"shasum":"080100c1a5daa0df931f1af1044cb2756dee8141","integrity":"sha512-r5psV/r+Vvau1NRPi0d9Fitj6EtRbWvoZbq0IFxjdwuMNZIPRGdotxWofS9A5w/fbn9dYBOB1ezwAOk4oS+AnA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.8552f134.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGW9KCRA9TVsSAnZWagAAH7oQAIQK01IHSXJBnEcjvvAR\nYZMNB4eqk9Iz5e+L4kqTG5RmkyUYbGrNtxCGt3yD3H3FDehZ9Y/rmcrRfISY\nIA7q0SOTqortudLzo7sfFMTWvD3dOAkphfdBc7poFxYfcOZFaIekoC4fod4W\ncRdKeIfSTBQHTA4stQx+tdN13vxiLxI2CAimipd6cCK6LE+gc/4vKT0ByLFy\nwLYj9CG9smJYcqkQ2D8pU5+z8lPBAIC13hIVksZ6FVqJW6oXGaTYwXjQddLl\ncQ0cRqqRAIZViy8ykNyaNX3bNJuiVxmv4nPCxNXg8RQBPjRdGbNpshXt0WIn\nKdDLCEjX712qEoWHJN6TRtW7W7XW5y1eYUv2SaP8+b5WPHrHoBrQu3kNByuj\nG4aqFUGEnsGXqJxptquKDDtmrXzLpCQ2sKno25Z99oO0BCRyF89Rc3CMbZ1/\nWzGvR9rEakJRglu8XcueZOlpxkr35Q80pb3+IHwvBaqBUBE7xrjIRM8gHwmb\n/uCfWoR1LuLv3GasFTbEjw2zv3/fs/8ICq20JwDP+AfPlld0jDZf28IxbjgQ\nxnUg0cTdFcvkMYKjTitlMdEeLNnBkf3aA2HDp9guS0aNGK1LT9Qq481kzDGE\n2Ed9+1kB1Zp1LVPlN/8keZ2thgMH0qMpCRe2BweAt398oc2hQlBXnB/sZbcb\nFHKG\r\n=l7ew\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHIjBytIoA7HAyUNAdQsLKkB7VhrBTH81nttTtltsWQ6AiAsfp+LQsNjpfXBYu1GuLNWYcob9aJYaUouzop+onx/EQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.8552f134_1545170761421_0.9836682268551828"},"_hasShrinkwrap":false},"0.16.0-alpha.538c1810":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.538c1810","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.538c1810","dist":{"shasum":"bf3b4b20f1c62f131c1516c6a51c26b97304a23c","integrity":"sha512-wVguFsvPUGdlbrs2vTVx9wmivaSOSJ8pMZIFDsg+DH9gNOF6Wovuu76/UgB96/NdE5uib38YCWrIBHoSklPxkA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.538c1810.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGXCVCRA9TVsSAnZWagAAkpcP/iLnjWQjwOgnqZaaroiX\ntyuZlLoagD84bNW+LA7BH5HK5wE1sbwPdjedKIZAZXZLAGlGGVDLG2dp5gE8\nhDwUS5gLvsy0+tW8pVCbPfnrhWl4/HkOX7qnKALpadfsA3hW3Hm7IWaxtpY/\nDSotvzWWTH91/KW2fzvrcYe1yFhuC21jPBFxmxSxYsJh3cAd2WTE76IJsEsd\nwubzYbX/h2dv+fQ+9emE3kHdo32iOYcw7Z47yiKMsol2QzLa0jfHwVAOthV1\nrloI2BVt5ZN3ONgLymZu26enFlVJQAtkpIyE0ebor2BMKyMJsO614lVx3k53\nH8lQdNxdZUnNWsfrVSTZf0usojLcgeiwL+LSsGDjAi8bFp3/wvY+HE+Gji72\n0mEQJtYFS/CvE9/mDhkYKgPWQJiysxCeG8kG3IeaNXpKdfYczF9Y8vwiSDX6\n9kBsjSoBF/GxjO5zUmXeqfuydt4j1rGRl+Z7aov3xcWtTcYq1t7x4aHpC+Ca\noJteP3cLl0NIchS8oUSI7t9BSxsoyxavgbZZ6ElcrugS3NL/BnC+RgZtdt+/\n5guwQXjv0moEO9OSN+6yK8qDQLgHV0Y5U1dklzl3B9g3K6OYWIWEiXd0NS6N\nBbYBZLu2dpZLez5E3w6TQEOTEaXQuEbMx/3UjaW9w3qMsNEGz8JodprEk+Eo\nIMyj\r\n=B6vz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHu2fM58SKFzY81q0dv9gRHCU7V58q3L8b1S6uZ9r/PuAiEA2yqtJXYA+fOi8SpdRY9F1N5xJ8dSybABqX0KR8qRibw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.538c1810_1545171092500_0.5362996572875502"},"_hasShrinkwrap":false},"0.16.0-alpha.51b2ca2f":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.51b2ca2f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.51b2ca2f","dist":{"shasum":"97a1edf502e9d4eaa5458e90d03123961b82ed80","integrity":"sha512-wIjI69ET9vPohW7jl1JE7dRFkS1g8C+6+5LeBCKN+BBqofHKmFQflby2hGbFnmK5Nnglc3tBRSE3jQH6stkOhg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.51b2ca2f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGYSBCRA9TVsSAnZWagAAFVcP/1F9ZXG0lHJjK42LHcCM\n9GKgV9VCCqYLnekfvAsH4KXCYmpenX0McvmQAGjTH+3XWzj9mcHfvJt+jglC\n7dpSgeyvl12WHUpZYbqgaBoixFXykh2la5S+35N0C25ozgw4so/zRXkaSRP3\nCWuBFuUWrCxdswfucHWD3EU9hpiC6K/gI4Vs54wIH7vCY96dKQ2SkuBZPDCH\nZU3m1qnb0vstbFHle78dLhBt504gsixvvVdychVbWkCmluFLb3vVDNs35oCX\nuljULP78FjVZ3GARsEFY0lGWfEBTvuyEQwUz+bcRvUX9sW1dvR8Sco3SxP3Z\nvJ1TlQbiEWCyFD+4Quo1dBYUNpdAQ7LxiWC/oFqQ5q61r6sc2fUKpDaofjKO\n7uMoDtxHzX+5Cjj/t4siTNTgUs0PS+tQDSq86UiIDDDFU9zwxFf2Lrvgfm6U\nlCAvMoyGrvQYQ1yrmGlxhaPlwIra4SbM2VTdg9IUMqhLHo+P/R7Ztj8rspNc\nw0lyZGYGH9P2/YAph5cK+7pykjGLJklCN+ZD9itXXqRbldQTtXyEAO/Jx/3Y\nyMYi27wXoTbP8eurp5JqaUWro+PIUicb/PEfl89hIiZ14Dd7Ne4AUa5e0Vpc\nAIWljiq+7BxMfrKoPvsJgzwGyyFdf1qBzIKQh2h0WoQwoE6jOkvmg9ETdQzR\nhKwl\r\n=LMQX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGFpBPLxLKZAPWHz3Kg2Cspar4XUNAMwDi1IMCXMUH5RAiEA46z8HvkIuVwAvfMmRdLm8pnNO4p/FhcJ56YPMgZsUYY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.51b2ca2f_1545176192773_0.7689841142692486"},"_hasShrinkwrap":false},"0.16.0-alpha.ab0f22e9":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.ab0f22e9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.ab0f22e9","dist":{"shasum":"1a653ed66c85b02578a2368c69a0831f567fac3c","integrity":"sha512-u/mSwVMgQVaW+AcEyiyIrPr5JR2WivcVXtaLwzdjTIHwlAi+3U5eylOpEKejx9nERK8WZd7mwRNpwAiAAwfQlA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.ab0f22e9.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGdsNCRA9TVsSAnZWagAAixEP/A7JrT3Q3NFfhp7jdD8K\nfsTjLJsj9hs8WcV40lF1PyZ3QpT9jWcU4lBjsbZ8Ckbu+JvBHvAI3sgMpDE5\njDcEZJHJ+LSUITel2R0bwLw8DfqdVCCO7FYLXvChbgMXojqpVtpuUhwVycSF\nm5B1W2RVndH+ngRlutrisQsFLYb1MTm9Y5I7i7Ff91zOIXkXXiHgI9Sn41Pd\nFzHRU7angFhwgnhKnKgd9yGenAxm6+Wum1C7DnzoaLBh90hGgz0XuOdCdvrZ\n5lC5rLQpdYhxwAtM35YPRfO36e5kVF3wLNyCHBOHVUe91BxSwBbT596NOa6w\nj+EN6JNQ2ZM+FmNPGmX19yRAzM+re4TQ0QHBWaipM7aZE3WgcyPZ8C94vPAR\nsOBoF2uo9RDfeNcieU7Zk59jPmAOvDxmvgyUszEokQFiwHvuCFcUDBl6You2\nY++Ykq2gzNbmnYtMmNan06JgIQIsfYi584w13n9dOsSYG1EFo+SHfKNpJtjB\ncLgGM1DBI/VTIGJEIhTRlfhot6lM75oNCr/PRaVDmV6He1ETRPfm0GdvNWUW\nc24qbyxMuhEUvRGIznOGHr2JsPYS7Kd3Fb//l9JUb3mCdc0AgD+s7D91oOGS\n5PpFzatcKhhtO4w/OlYGTw4fspPWmFWtWPbLj/P2u4/nf+a0rZHI8QM2QOb3\n6BAo\r\n=Cgea\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC91wLVq/k2jYD7pOryW0ifRSPm5U6+cx/lt73uKaFeZwIhALcv9CgxtuHZFHEMDPUoJn8lE1cai75XSyEJ8sltm7kq"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.ab0f22e9_1545198349100_0.7699848980989228"},"_hasShrinkwrap":false},"0.16.0-alpha.ad07eaff":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.ad07eaff","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.ad07eaff","dist":{"shasum":"044b32ae99d1097d0ed39089bb1305a1a89afe06","integrity":"sha512-0Nt6DyjaibFEtkjVPX34Sa95pCvZYjcjMAw2JmcaZqNpjhNU9QUGmhusHiZG3US4qwEgjgQjolHlka2xcU+9iA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.ad07eaff.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGd9QCRA9TVsSAnZWagAAjSkP/2EKsPSrS3XFQg5mAjNk\nhspGeA3bxXRVrfJBuNUiJ9YKQfqjHC7hZgt4NpZWQ975YDMbJO99QTRWb25Z\nfplCikbWLAtbeewHZxAJQd/Zz07WOfji7fCqkYIWpNcoX5Hlf6QfmST4Kz/L\nUmdXTLxBw9RSbx9Ed+xeb6VVubmGHctBuIstArMdOh6uQnVT8R7/tWR3KiBm\nezTfyj1Td22WCdZ+juGrVEjkcN3faVPLR8G44/rR8vFQ4ZNrQVYCet2lKuN8\n5T5cSkPgVj/yfYAsb40HYYDZnp9sDhcApGr11H8D7cdc0g0UX2i64KTR+5eh\nquPjprubHxvI19YCDMa+2BHnA3C+c3bDnHlgkmgQQZEiL2cZEvpwBk22OM0F\nToQOFasga7zJCHrzmb1aWUXB0DnAnzioqPjseDCyjgAPhX86adAQXWXXaZEb\nk1VME3ytBSz49JiYweOtrfPrxPV5aTn7pt3mbRLRToN2jWdCUtQ0DjDYXox2\nEgIOgIVfzoaKV35bNV+DLqQS3y4BxeVea9qbQ/+LUFR3/BEm4fgLGYuP3L5n\nDChEtEU4FlppvTi9ueRNFBTVc1xY75mO5VWYzuo3SmYGSgIZ28Kj86nfor8k\nVeo1yoh7yCTBiHYI6FhyrIy/MgVTCIqVVpyU3FPMPZkj3/hWqXylxTnJ22aF\nTQHc\r\n=Jdnz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPZg8buMzehBMxAnMsuuFtdt99tWDYzKLbLMKaUyucUgIhAJ7JrXBuabGjZXkqmHfOnb1jmMvEqL0pIFS60wJ1kMRC"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.ad07eaff_1545199439519_0.2427725205231821"},"_hasShrinkwrap":false},"0.16.0-alpha.ced38a7e":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.ced38a7e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.ced38a7e","dist":{"shasum":"7087a643b0078117605b6e20db79adba5bdcfe31","integrity":"sha512-bhBOECKSYur1USbwLOVIrtx9l/OroJRIfitGoeMUlPR6EwWt+S4qpPdV1zLiV1cRdWIlczq0tqiRRPLv2qSncQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.ced38a7e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGe3GCRA9TVsSAnZWagAAV64P/3jcMRFKV9uYJSbnbPBS\nqKm65HizSn7PmevdycYqY15llf3qiiGQcriYqcupiEZWn+21AjqhpjKGQHJm\nC1Oyw0igK4zGnnnPNITBs1JGup3/XO/mlzMGC9/vp/LCxqQbjx6RPi7XPkZQ\n2pcJFrjFoNw2QZ48gM/x8PiDqstqsvQHKy1lIUwLLNIhNKlEnlCljAFPcof4\nmDT8J1OSjejTgyJ3EGcbOPgekSM1MWwU+EvSU/LWIbE4AGgOyPYBzXft68oU\nxO3/wlupa0T6cPLLhA4cv1q3x7DhqQH7AeUziPtfjjn3kU843rIAdsLiSXP9\nR2BOGs0NxfWCxIr9rc5NGDr4D+WVNEAJ2vWAqBHIh2O9jRkkeQ3g7tibEr9Y\nQki8QtpicwxfJBUzJm5MWSeTNi+HIqDEkUqTFyRsF1ie5r5Sgf8P1nSQlHd9\nNmG/vpHP8FISw2Vi+BmcC47VpTNSg5Vwj7IM3I7nNo9N++VjxW/vD+93xwSf\nIoNGQgdK9TSZB2WVkeCVpfm125piaKuqldKkLJFZ4yvWP8T8Xbvk++G2COko\nM+m0hT16M9RVJYtRm1uWzAJEHAPo9DwjyuSMpSmuxR89NCL/O20UDa36vSnE\nWXuQGpTE7R7i1vODZR9gYIONORzqNYnIjTCoGXfmPbUdMyOHW46r+Pz2AD5d\n1aXm\r\n=iJpk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH5OJMCWsWe2EYdDI4D/xogWjQQF+hZm1WT+9Sby8X2iAiEA6ZtOXCUtdadHvLfTbEfxV2DOTAcegTauuYbF5ZbJmA8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.ced38a7e_1545203141455_0.19266055579830987"},"_hasShrinkwrap":false},"0.16.0-alpha.0248eb23":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.0248eb23","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.0248eb23","dist":{"shasum":"92821e907c85b6642e6c72ce39204264e3fd5239","integrity":"sha512-sRjOG1cV2fVLjUpvM0vOcjIbF6l0HrKsJ7abHwv9LJ92qkiS8gf6EyapAOeTuVnYJAwbotlFDxj8T+OReR4Tsw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.0248eb23.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGfWBCRA9TVsSAnZWagAAYX8P/j1I97uUotyGCc2WFbQI\nnVdfngFkSJRMegjQXFSFLWE6D3WQIbwIsQmCa6UY3QTLDdhoQ0gS7AjDHBBI\nlXsSoAgsZncxljOk34rwydF2fpHF1JxJKT4GhzOTCAMqjzpBpx5dbl6l1dsG\nZexST+RRh3+zfMdUZgSIPmqZtP3k1qw+JiZ1/1XWDs5khsyMjP5JmTb/WJEg\nMqJXqkhvsZRoi4MyXYTbvJweUiKp/KDQn3i/dGcNgZZpVWKs/MAiorTShhJH\nVddJ2GUoltCG9dqowNPmX9XrpapmzCN2GkMbt/Sr0KbSPDRe6bDg3TjBh+Hu\n75q8CpRSThvzWR0MyZoF6I4R+AEbEppeF1O7336bHkOAfisxsk1T4gzebWoV\nyGUbD+xtFg4gnul/QtAQ8+G6aK3jg8fa4xCM2J22PNO3cW2O08DMG8FqEZeW\nq3mHqYrrvgs302q8/I+I6StDRHRVmOXn/FYOeH+V+vWj80UDLRPbDou4PvlW\nf1pbAEy2PTFIyMmqH0nUpaJl01wX46m419mtrNn9S6XKHwOCJB1vyOmllzcI\nJW3tGjHvQ+rSwduIuFYF2hWHHfYL/zTv++Y4gxRnrfE2jVTYYZoenMlROTM9\ncRKIWRh0Zu6DDsl9zD0i1lFoWUBd+hlutGGDIV2Vlmmc36tLxiRuJpnHbNpS\nngUu\r\n=/wa3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAFxYw15kFw2yNHZCZuYVNAQx/yqjceLqtaga7KagDVRAiEA31bYcbfcGtnJqvppklMg434kMwktwg0BAFQLDsZa4Ko="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.0248eb23_1545205120683_0.563669222285021"},"_hasShrinkwrap":false},"0.16.0-alpha.5a024c86":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.5a024c86","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.5a024c86","dist":{"shasum":"bdfd5092d112c26606be5ab7afeac504d69ba36b","integrity":"sha512-/mcaQibrBueY+9XY3Vh2Si87I+1HMqSzDPM1xq9zMToHPW+nEUFr5iEKFMSMT4fXethk03mlIrBHIZaXHV9bBQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.5a024c86.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGggQCRA9TVsSAnZWagAA49IP/1XuMThEupl/gGTZ5tiB\nb41JPnCyVrDF3GmiDprONzW3h9hOSyRxeJI6dd4rJOljA1P4uDOFbPqkNJ7N\nSxrsfcglVpQ5d85tvvZEQtYGlv5Ivx2XixfULjg1nQnQeEYmIOSOyDlwlk1r\ns7ZxGfqVcmwOna3HYJmPR6xCyWkTaunfbQWq8aqjABHwH6TUM5qK3/5Pl0ca\ni3aU1vnQNefLkuNvfruh4JuVQ6zSM995mAhw0rPHEpHQ7G/vxx4APovL44mp\nSf5fkoXK3nudLMmu/3RZXpM5vWa5auVzRpQHIR2B/t7RDghYIfUPghjHfkA/\n7YhozplkIrQpZks2Znhra85qkkUZpieOiYGUDg9HYUlY4bfRAuDFkGilz1BI\nJm5jLkLAQj8tt9t4boZEF3tWQkit2sUxmTJm69nJCSrhIgqJ/bKuYC/sAiTx\nI7qbREL3YFr1A30a5sD15S0169pdAiGptldabq3Py9g+BRmT8Fm5/zeLrHki\nt+2FOBieXlOSJrcvut2cLtNgvuQ+qXKOZu4i0mDCO7PNKuf2kzsAnjhLfMEu\n9CpigCqUY0ibJ6d3dSY2+mymAH73iAzLunP9e2W9vn5sfwJ0KuES/z+hBjVJ\n4Ft2Emck0LSOjNB+BQvKZhZPraDOXolKc8fPEN2c4jX9VI7v0sihpKTSDlW9\n4rhk\r\n=ewzK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAS+SvHTNwjoe+wlvzcrnY9ijpb4bP+QOgMnsSu8XsLtAiA6s8WrBV5i4UY3adnP+fQjOdlBILG24eDk8yfoEOeubw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.5a024c86_1545209871355_0.45680670117663436"},"_hasShrinkwrap":false},"0.16.0-alpha.56609532":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.56609532","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.56609532","dist":{"shasum":"d3497c7f7bb5dbc7f2f6e36713c944c1ae1591c5","integrity":"sha512-vx+2levMboWPEmWbCHPfvlyKUTPVDg1jwywrJbBF61bWnFlFCALKAkpCbrMtABAlqWjwg68dRJGvXKuwhXCwqw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.56609532.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGjkpCRA9TVsSAnZWagAAl3EP/isB9ZSwpRcasq29Nt7y\nQg2JgN/bUaNbTnjism51kOASl5WybdqhMetkMj0ny4VNF/mpfukDMxipolzA\nYEVbOGHzir3hnBSln723HgY6aVIi1F3NgFHsor1Gz1UUMcB47O4WJMYCWENH\n9YnL6Hu5Vwgwn3J7gtr/S2NWvlpA7WbrEoGAFYRNRKbB/e0rlNPAFDROh1CV\ngKwzxaDQVlLl73EN+v7WS+5hvR27RSeSW6z5q5F6N/GeXfl8MztJqNZCa0H9\n4HlQcUetmwvUgRIIY6d7se2kSrySoy5cwTilvDB4s6RwJWMLpOIWS+TkUXXw\nXmjIKj3B3z/zK4nnzIDbCVeO9r3UZ6gbx0B9/y5RgoeV+PYnpnY/ryTVviQv\nS3UplZCNMsFIyBEZJouG2pZtvqu6vHaT4OqcBlp1U4oKUM6pQBWXLzKLKt0y\n7ZQXarTWASGlLJpNITrqILPF4NJgT1ateBy7Zc9SYk1M9MxbkDwOP6rjWRtj\n9zJR7fjH1IXzv4YgcwYQX0MZ4zz8N/w0Cvg24+tIqno9YVlymD6LxWPD/ESv\niqIvlpdUvHiZiy/VyINg6tJH76pVk72k2OEUQHmwUT5L9I+lfG5fGltcLZmt\naX915t5Gnm4p8FrsJ9UuNuN4EjLsUwGlStAEXuQP82UCkDibBzuGAlBSgIcM\nCPDL\r\n=kFW8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDv2w3pezuGpIwlNuEq3ytJKwghclpRyapUsSDNhms0OwIgbW0b/qNlakB77AzQyGoEPLoTjrnX6SMqBJWHlZA1LL8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.56609532_1545222441235_0.8847345256157229"},"_hasShrinkwrap":false},"0.16.0-alpha.a1adfe87":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.a1adfe87","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.a1adfe87","dist":{"shasum":"a596e74f8054fa1ecc2d940e83b5d11e7cb0e857","integrity":"sha512-SwNFQn6jWN5tJ4VrCd1x0uLmh7miWS7mRNgMTLNLl/zQQE1eCqrR5Z3oav5WWVEP1+6bbm0HWd8IxeTxyKbnww==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.a1adfe87.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGkpDCRA9TVsSAnZWagAA9r0QAIHjK+4yYUUbuFxpwtlW\nKmOLtm4wvFYuzpqtyqTtKziF1EVwqYb6jVVQPMpgyH2HS0Y6BjXqIfFQqABd\nJm0aEz/uCwYCzsWdwaQYf0dEgcw7p4QNCSWIjp0jgX4lR6BRz0QvPo6EDThT\nrqA/K7ucslVfBuOzRqoUKeTmcXaueWNmF9Il0fv+W7sSV69YCSU+zdVzrK3J\n+mYoZrj1WUNRGwcyYEYezMW0r6o50lhfGg5PqgyuSBjJf7Z021RNBVkwHZep\nxyWg0sXNkRqgusL8tWXNpIJXo2L56IOAeHNUk3iQM97epYwmdMV1ZFpU7fIW\nz2xfoBERe/sK85DGXNHqGnHszPLikOCzKOlO/7/ci1Z6QhqFIkUHtkW6MyKU\n/8nTrxu05E+8DSd2fNqONo34YJROEVWLq9KiGmvI/HPxxl4kpIWPJBuCktNa\nWGm2CTMFXwdXTazlvIy4wmmHBPCXdgH2tO7OsfScKxNb5FKFxd/fD2BcXuDW\nyC2HWzAvRpuqbIVfDBQ6Uy1w6yX+C7OfTjhj7YIHBsOftJfEde6QTcNs6nMK\n4i9X6AAN5xSpEI0HQPWkurzM1hcMx4cp1al4xQBfV1jFXIKo5tABYCNdOc2K\nhhtXjqsCUS8Y+FhouPDtamTfHyWF4CRLAEyE0mCrMTnE//FK1iS92q+H7ivs\n0VxW\r\n=d/DW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTjKTySDmLD4vQYczrisepU+sXipZ5USLU/sKXHvrOpAIgVUAJy1ofWwG4mHC4XSnicImD7o1NxiHbwOxyozvnK0s="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.a1adfe87_1545226818522_0.7341569494035984"},"_hasShrinkwrap":false},"0.16.0-alpha.7dab801c":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.7dab801c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.7dab801c","dist":{"shasum":"a74aa82959e3c5acb5745f10a24007e30d60cc1b","integrity":"sha512-H09gGoEeSZaSHE2ZcCa6X4zh27g3Mqa1EV9aMO4WGmIGjlorKJUXQ9CNHXH4pqqJRq7X6JKYdOx6vnrx0/0gAA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.7dab801c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGksKCRA9TVsSAnZWagAAJvsP/2W6ABPF3A08njWaOAqo\n1Gb6OyHKuNsl+vh3icuNxlMJ8SO5ekvMU52kiIboCXme7CNc7muiDpLBNwEb\n0rCl19EBjqAAP+AGGRxziqfh5SpXeHij7L8Rhb4DM4ZVcGK75nJP1i7Y7L5z\n4RVTeBPnH6HSsPbo+R9KPHP9mmZ97ChWN+y9f2XXHcEdXKVKVLQLjsp61PwW\nSAf7dtIz3KW2tzQq+t5PXXtJHPEKgGM4gCEBzpb9Cvveuz9LpG2bcktn31h1\n30GKtGo2/eKZVMnLuSfvgFmKLblmXZKLskAU8jaO7avGuYrOFcL2C77NIq7r\n26vUXm2EbKAh7cSvUytfBMok9Q7Narq7zKLZnqpLqe7RWGbCoVLao1yJkTZp\n0RXmv5QJcjFWjHcey1b+fs1rOY2kY7uVFx5L5+pQZ2/FF9x0UHfqmPb1YAEk\nUFvf8SC9YFLyrAhfbkaQ1BQ7lb+cBthpJMFniGLjqh4Z2ksvffLfnI9Fgwl8\n3C75T2toUHfwE/0oSq0nekOPeLn21HGlO14HnVtC7mD7D829GG9ZgmPr4BGK\n2MjfNGsPOdZKxC/QLzUdMMfLb5TFTOu2Q3ueLOie4KwQXhG1uk1EW1sxe7Vn\nWve143rzUTOy/Ty8PPrm1cCNrT66kwCF8HZ1A55jEn1t3fQYCRNhE213LudS\nCWAb\r\n=aDSs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCux0MsmJW6TRGrPsm9fX7qciQKjTWhXw9lMihYPlvG1wIgQud47GiCBGp/k7Pim0h3hsQVr0sH4NfXumdNyzvX/Qg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.7dab801c_1545227017623_0.3000252990556058"},"_hasShrinkwrap":false},"0.16.0-alpha.42ec6d29":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.42ec6d29","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.42ec6d29","dist":{"shasum":"2d0347b667214f5749262094102a7d018d081459","integrity":"sha512-oUZOZ0j1PUyyuoPaLXizAErR1l6sDNTI5kuaW6FX2mffmwR9sJV0Gq5uCibo3sVIVbRlZRfv8+MuvYUvOi7L5Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.42ec6d29.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGkshCRA9TVsSAnZWagAAAyQQAJgomxCpUdMEw1kcT+tf\nqaU6BRKng6fS72fTFa1Bpx5nlazkMkTSk82z6NCr/DDlw8w00lsfSGYHriit\ns8fhGq5tfq5QvL3ns1S71gOYB+5uowN+vKvB+zCT3K4LULd/DGlUU292lee6\ncsWNXiqx06V8v5t7BFpEjLFrbuMRQ0yge9SGm7HGuWOjlGhBUh9QTW4RmIHe\nY06426JyZD8DI8ntT7sRRhoZkzenjJFX2MqgFyojQD5L/G3rMRoQwlCbUuJk\nXQ4VTbqtsi1H65cpoiBbmbcLL3JCjSiRuSWMKDDYLEBrCKIfC5/MTFtNe9uS\nNdlyU/0+W/4H2BHWlLL4nxMzqyhI3jmXTAlfTSPPCc0/e4REmSZ0k09OgNc0\nN1srh81vrvGCInGsEiOdSSflr1d5mP3CrOHImQOVopsfVcwTjQR8P2+TryPr\nVnHeLmUSKFm0aS1vTdxXPEqKrBq0HACbfFIXWMtQ4YlskqS43pGBtrHfgYmk\nkWsMc7pEdbw1eB0/Kgeia6IYyT0+GCOkzfPRIGug1CbPjnCMj299COa6lEl/\nIBviDM73oVtgY9vKKIRq1GPtKmidsKG6WtS/qg33qSuheRnlQXA3Qq+xd+ig\nNlYv+7IsypjsFvIP8y30qaaoYRy57FUOQPB/VcOEKVaJ7OfeWVH+CaL1wj2h\nLIhD\r\n=yT16\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRt5ps0ZOATNiGPijIBzqbnbsutkHy6aws7iCOXQOQrQIhAPNucy2ktcwC2bxves0LFvC1FefdO1w61CLcVd20XkTC"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.42ec6d29_1545227041236_0.2237153193190744"},"_hasShrinkwrap":false},"0.16.0-alpha.58d710bf":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.58d710bf","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.58d710bf","dist":{"shasum":"30b36d96f687561db4f627dbaacf46e6ee68c783","integrity":"sha512-ELiNZaQvAFG/gjzXwEaU77P6lCEV2DxVF8l3jDxn8OaOGy6CpMYaHZUvYXp11AyihbBykST7R7CNZpRCPupe0g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.58d710bf.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGnT+CRA9TVsSAnZWagAA6kgP/0w3b/q7LUiSyV0S0vYu\njEuVf2ucJ4j/KV1bOG/WkXp46lJp0At4JNhl0qBAI0ozHbGjS0m7BtYBKuko\n17ukrKJ6dbJLvsBhReKTb86QjT3aD+ekeT3+lyUuv9JhQONNY4FzrIKL94Ks\npHIdPoK5NVoLo/reu37vS7gEMqNkpl5lSgnqqJHaR3XsXECutzJcaSpuRuo8\njFINYWl+O1Sl8olj4Z0ouVt0xKtS/n2UBfnDNbrkIy1JpGw+SWTx83VMoLq7\nkVbgGGkcCzp6W5QA/kVXxfACeGDc+5bu2Ov0pNQ9y+IEzP8yPpLP464ryHV6\nykfXcYHFeFzdjbwr3djxNA+QrurNio5ZsmAjtLQsuXfEdx9HGy8EkX6jNTmL\nBpFOjRDo+xMysxl/aCJl12SawjiTyhMK8hT3L+RRMd18AfO9Ak9X67hggNUq\n3NCjCiys4p6eCKnS45z0oIqlP8yYB272yYu4BcLCuaq63XUXbYEuWe7DJtHH\nEDlTpVEOmGUoB9pU7pFK1YuK9TtJ77+jrQvdygbT0LiXPkDh9SiAZ8ght093\n+4WxRzPOE9705mgmzdA4ESlxHpTmid6lxObOf1Rv7AYCG9fvD9ZtCl0aCWSw\ndgrBMEGsELgyUp2r4hGPVa4mCHyRG5YCInxcz2VXUeuIfVx7EInb/2yN9bqw\n9NaY\r\n=Saaa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJr1SCASa4KzY1xtzeOQTjLrVOz3+Rll6dm/dibcY2swIhAO7dZ2JaOhqDQAk+Ikp+9fgt0xZQJdpGeU/dBzLKmIIR"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.58d710bf_1545237758199_0.01683923234291762"},"_hasShrinkwrap":false},"0.16.0-alpha.0247cb0b":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.0247cb0b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.0247cb0b","dist":{"shasum":"11279d6dd1c5570873f5fae87c6d89da7bd2fa21","integrity":"sha512-V3JMdtn7VlIGWKWxGVVd4QIa5wv8vXIZLgrPmn0Bd04TqDEbR35ADs16w69xwWVAVHyW5hgqsaQp7xLNwE4FRA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.0247cb0b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGnYlCRA9TVsSAnZWagAAIewP/0F/tRCLijNMfERKsftK\nJmUbkQTfdr63pqgqRCLocKZ2C9D7BdVVdj2G1cY81a4UbmHdfffxKFI6iTzN\nHIYYfbDb0MjZ58R3g2fF+Zfs+1nsNIHSNH6/lbAnT8TZs9RWttJfRDGiMF/o\nKR6UpeuWEFbrgEyVgRGk3kLt6Xc5NBrNk91rWR/pwJgk+f/zTJAZFZPo7mi4\nAVKN1iD6ZLcNCtnuOIePol2UPiEKTAl5c+EjqVcorI350kYjhhG13URCN3xc\nSdoOCREdRJSV+8Zx4vhlx0pkKX+gtYvJ4QEFTecHeNAU3ynbSN+u4x/3ObHI\nTZYa11Xefq477tqzk4/PgqM2E68AsQVxtaJPf7pDhGjp3vLtChC+ItqYxzhh\n402Ofz9q8xYMXuWBBhH13NorbvDhpSdTuTX3je7ekQVU+KW1YoacwWc+2IQW\nk7MqHd3h9W9lEBzMrFTM0wzia7WCs8g7APeJoqRHNkDpwWijGIaUMGlDDkMc\nPCgcjq0A2MyvHFibsoBsixtDTHtCI2Y6/l5pDwixVONeR5BPHqfwMUVNHU80\nYuQLM+JZ4PVQ6Z0uVzHkq/vslS44AzPSyz1AjbP/l6WKcEhkTKoEoiOwXMFN\nwDNXa+PApM6u0w5l9U12B2toqRFCbQiktF+E6SmS2bQrjvN10zFDPMyQDEuw\nVTLb\r\n=dtVK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC1qGxXs6EJVntTJ6hmYqbLrOC5sCRQBMHvaHxTNMNt2AiBmStRG1movov8C4z5eupnalIh+V840aYboDXM8ibaX9A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.0247cb0b_1545238053214_0.8357393193625688"},"_hasShrinkwrap":false},"0.16.0-alpha.dc98792f":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.dc98792f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.dc98792f","dist":{"shasum":"f27138e7b642f1acaabe56a308c0558462e618dd","integrity":"sha512-sHk5qmCbTkPK9mjyJjZwXxNufh5YWbkrSq/pUHE1BfbTUqe1AA7zMBwc/B2Klt2lC8rQA3n8n+/EjhM/ZxvraQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.dc98792f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGoZgCRA9TVsSAnZWagAAuu8QAI+YKKvclLEM3hnTM+sE\n+WDIDb8zIlOeJAzyuZsWJBlfLGjDU0ZLLTi4SXuNf/bfPiKt+ljLNT51wqZV\neeHrBwZ9i+vfwb3UttDUpjvX28yX6S0+WdEKE15MaX3iDzijJ6kD8ZjAgVaD\ndeo4835IAxx7EtFtn6sO7SgjX2jsTBvtDEQYm4PelOE9uBCa202PHz1iVHto\nK1R9JIMlJpTWteQoCJ/3L6+JPTQlmH4TvDMIwAKvb1h6REbCWyAmbcewafmO\nyglt1mXov+HiwWpZ9GCIGbJJ8Dw54cwSuKNNOhjb8igi0XYRa1tLSOSDILCN\nSE6OxuC1P3VYrnfOLNiP42ROu+IpZS43c0jpjUGq+mIYN1l9QSNR8JwMpSuD\nSFxVboS1ko3NQM4MyKPsnYNE/FypPr4EQkvrfIPpFMah2qg1c7tPMOJNtcKW\nvk/Iu8ycQNuKhUtwcTr9lLtnsy1xwHDqpeBqITyKqmQpynqqsN22cq9B7/2h\nltpbr0HcwQH7g9u1PZyVEsNi0LYEvgPBtOp2vpROyo3YtSslC7IoshKJZmCG\ndUtxMSvHGDiByzzcIJMuMf2KNPaJy0kVe5Usxc4BktGeGqQ+Unrv+k/7RwOT\n4n3lHqPKTQMU3K+0tARWhIWFFFB4nw4iYC/8DYXJ1mVC0z1m2OHvz3zj2wYP\nrASm\r\n=nlaz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDY829ZbIA8nJvLetaVvWKGqc1GDx+x9QlvN/JAn6YB1QIgHT4j5V1LY4LIjHVUzRc8aYDyiJ52czsKVSWA+JkP6P0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.dc98792f_1545242208324_0.8848664110603877"},"_hasShrinkwrap":false},"0.16.0-alpha.4f7a8177":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.4f7a8177","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.4f7a8177","dist":{"shasum":"b74a989562cddbd29031df58d02b3ec7336ea532","integrity":"sha512-lYORNP9LzfXDDRCpxWMf18Tti0eHS5hnKY8UzdDRVoAxWOsDtg52GFuC3Yizz7Uw87B+A/I1wsWjbUzI4a9F/g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.4f7a8177.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGoowCRA9TVsSAnZWagAA6FQP/1nNJNbG+9HLyssP2o+i\nJsqkv8+qmyjv5IA4RTiEaUVrpTuU1UVvWoVAcnYesIkjtaEih1GjzDAHqf2h\nBbChFRyOAxQNaTgDRYOzfaa1IO6JEWqjKQxsneXEsXjQdL8HWmdRViiJ1eTz\nA525wu4uUncw12UbzzbgCLMzM3nv+a+y/7Vi41mVLXEn7Uwq7/H5FwjfjWXY\nzjaEhPVdV9icqdFuEdgRcfb4aJlNgBZ+ZeL0fHkOLvcyPY+wSK/A/M0HQ1Az\naAFsA2Sjr2Kn9+a8hEF9aYnAU4LvduuFxdboTC60gV+Lv5yWcn97zRokdppt\nNlFz5MLRWeoFYS+j12VJ0cAFirjz/tySVLeFXK3eRcPnZ0kOK34jP03TQdz9\nkL1fEgVZXpLM7w1PSocImXDXEKgHL6n3fqMtaKPyDa5BDN5NlU9HUfWnAhwS\n476FkRHVTVTuqLOoKtjcfPHyGSoYwHN5hpr2dhXxS2ZAJId6o7MlooW799Uw\n6lPrBFD5H9UCZS72p9OU6MQPHPf4IBLXSRh0BaOCJxdpEKqh5y09UJ25wI39\nBQ00JLkDLqL6cels8e2LNiwNm+Zxzy92LmfJ7k9dXeL+rxfQ1rjOLCgdsLxJ\nFvwn65Zevm0rSnKY39IL24mPemTvRSRP1/pdUA1irr8IM7XQ9zJB6eJ/XU2U\nU9Im\r\n=iaw0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDky5Rj/Zu0ryAPfb8oJPvRX3WD4v6Dmuue63j/NXLP1AIhAIor++Aury+yedJA3yg7nEwRjzLe3vL3UqaqUP6X/Xhe"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.4f7a8177_1545243184012_0.16947690029998363"},"_hasShrinkwrap":false},"0.16.0-alpha.93db0dac":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.93db0dac","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.93db0dac","dist":{"shasum":"fb3b27e68ff05de2db38c71a493cc61032f58991","integrity":"sha512-xdNHXoNxPI3Pmaph9qQC3SwR7AUzSnsyNvy/qho6nfIZc1qQ7n8WEG0jo0dhlpAJYaCa6GM4JGhD3Eo9dU10XQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.93db0dac.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGo90CRA9TVsSAnZWagAAnb0P/0QOXB/j84OvyidfoebM\nuBGX2hDvzkuqg6XkD5iAeBwBUXvXXtUhgAtLcFm9GvbIpD2rbNnuR4D5qMI7\nqawgNRU9SPnZIXhvcqnE6F5vc/H1B3CeJnPl5Jvhehiashdt+o2W+rdV8o1a\n1fFxLm1gykJm7CuotJsRDb7jFOGi8zD2C4Qx+9AWH+KxtxNC3tP+idapGvGX\nHV19I4AXjYOFm+n+nsunrbTMCILjsq43C5adTGqUs9vuGQQdkWtxgAIEmC55\nPqdxyWsUVew5ptgQdFOiWzD3JzuzFYiFXfEHkxvWGR1aJBbBkF4ITNOt00Mj\nKuq3ZW/UxnI6Vb8AVCzHLzzte5i+xVdnFtPusJHdtivHpUfi87ItFmjVF5sf\n7lvunqjYUBCa4dIetUrIQh817SFiyIP3en6hYGV/P0GcNVck5k4r/ovRf3hs\nI/9vLm0+9BgnuBbqy1UZ5TprW88J5jlabjdZnqXtDPBEjaXo6jPe8sStKf0q\nlWuRLPMIjSzTi5qJGyC1TDZk63NSTMgKt2wOEQnR6R+Jp2W/63kLW16Uz3Aa\nNtd+OQP7pLSsJ7k0/KsULfCWzPbzbzVjf95GAGZde9ZVMptEdg4phosT++Td\nEQ1y4l1BTsN21QjejmkEolcgRdEVUbH8PXsc3GjiSjynyfUhWmL3TJtqtf6G\n3NSN\r\n=8uhO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHK7S5mRUXN2f1IMuvkyt0VdYj59nLdJCQWgiF3fbnn2AiAIgsMhQtbEiPcsUaXSall+ebNjywMgetHHKvdTjD+sqw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.93db0dac_1545244531580_0.18869113468495935"},"_hasShrinkwrap":false},"0.16.0-alpha.4d3c651e":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.4d3c651e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.4d3c651e","dist":{"shasum":"3a5546cfa8a621f3a0e9aef1674166e98f20301e","integrity":"sha512-gOxLhNuMt1/TKe5VR19cRhBhD+RfSn87MTATBfoecq4nO9Amgf0fC95U/Kk98sCX3MvSZJelQD87J2Gk0i2Sgg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.4d3c651e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGo+NCRA9TVsSAnZWagAAh/wP/1wwP4dPwVjE0z3z9fjW\nv2qPPwU2cOFIISHOz+7xuioPRAnX/O7oNEUyEls38z0gek/ZUusZwtX9EwV9\nX4Fr4EAv4R4YyCTaFxv+jRdHYMJA73cG9bCV3NiXWPAI1DsnL9FjAgtz+Xyu\n/C1AFHlsSlCdFH7eZTWsB61XNn7hBpmbJqcceSeL7HsHqgD4a5lJTGdMmZ6S\n09ZvADOSLMJBKUYklgPY8n6p+ZV/e/RaRze6bqX05GbOq7hmnoEq4DrQjF/4\nnEask5EVYB6IQvym11qJ6w8DBpBy8ugFzeMc4dINwQS5/5lFITiqnTclG75v\n0iALnNC48RvFKhkYYwHzGglcd00MscerpVamJ86DLgg5KgptrjhF7NOu2cjD\nYDVfTqUr8/153k2orWrMb9RdWBsEuObEmbN1bqMCTCaanlnALatOnsdBEteb\nmNKrBJuzZGPM7hAJLnH9qlg2wpEnvXSJ2lzqfxC97/vvDjCPbzCc3MwRRyr9\np3CWnw9yciAkvJHaiCnll4NwtINB/05/7pXNnYTnSUSFEKjoO2DG5zEHMp2p\niDSgCClaYC2+rXyhQM3NcBwmFd51RzoOWHd8vVuMuETDjJYYhzSP1A8cVyEx\nM79a4tV/1QZUBy3a+1SLule4kIChz3T/nVuJ6rKMtIQCs4GAypKAEHnfXGSJ\njc3X\r\n=lBSF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGyFrFn0EmcVYLYNqemYpBxpUgLBidacb80htMIZV1SLAiArfpSJWAf4hOBjTg0InZxua9jRHBk/sg5G9KLtF+uU5g=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.4d3c651e_1545244556826_0.9664337189139223"},"_hasShrinkwrap":false},"0.16.0-alpha.306a708f":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.306a708f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.306a708f","dist":{"shasum":"6c42ba8ce33aa07061ff14b547cea0565ee03b70","integrity":"sha512-5iDOI0EVlZiZSGfb1HsAD4EL3bXGpsiXzJFikqxbSNLF3Ad64FUpTb4dvwtAQ5o+QK5JlAsMRj3fMgjlqE4CRQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.306a708f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGsuSCRA9TVsSAnZWagAAaXkP/jQqjnq7FPiKAZIMwJQv\nhOWABEgEA/mc5Ta6fXwHVhioL9020QQM8ac00F2wRP/xRkCh6nk18tXxWzWl\n0836c9p85IsDbv66v01rfwh74wnKxjivr86Z/Ft03pRN1WHHVyZojVVvOAnJ\n82J0aJ4liUyXf/sEdCC6Zi6Hlt87WWaMNGSU1cD/U/Fwi+lTLWRhvNSE5tAK\nr58HyvVSakVrZKbTOaB6k5As7K1gQFD5LYvR2XwfovtE1wMU9ITKlL/DafcM\n3SjQQFHGGd/Q70THUA34TUUX/jgPiRtRMQbETsQfOMfaeE1kzr82fv7ityFg\nXNGZDm0qLs7ARYXQ4FTKkypSfd7IFT/F9PpxbPhoOj33AmrvHVbFipZl6Mxa\nIYv2Aalvyg+kSQA8Xkn52f1GvwhRCY6B26YMB/oqk+yh9Y8W0jDSI5Pq2kbb\nHy6y+aIkX2Eps024nPkk5sSMp8vV2Ny7aMYc83acUPEw7uCkVnSnEHmMyrWx\n3tiiukhfx2n7Kn7smRmK8fnSXO5abUzv4t8Br8d5tAfcZzSH3QKonJ7sCpd6\nIc3jpjuDZ8/AvoZln7Fe1pvRP7aIj9V8DuneEUyRqbMHsKKOJnCNYROuFPh7\nr3Vvffvs1Z8SNpCCJL7AEz8F41HoeUENS2JGa5zZNccshulTEv8DBFnbplR1\n5WJv\r\n=/olu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7rWb6UEkZa0HXnlsGyFY8X1UiD9GU+3zHp52h1AkjVAIgGFRvxbGZjP4kZzdMlteh1Rui1yCyWhQkYL+IaZeU+3Y="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.306a708f_1545259922246_0.048962826014689265"},"_hasShrinkwrap":false},"0.16.0-alpha.a686cba5":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.a686cba5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.a686cba5","dist":{"shasum":"73f83a7119211b64940de4d38c41f41dd5651bc5","integrity":"sha512-sggsA1jNGx/GAoITMlMK9OH1bBUjxNRvPkH2NVMCLwOk3B059JA/bRjbAccw+QnX13y5kwjYqvdIRnGhQwSZww==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.a686cba5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGvFZCRA9TVsSAnZWagAAZyEP/2OxJj2sB3sXSI6PEke7\nktZ1RzRFUHI435YMfQ+2a1+di7RBvWz/ha2/HjHIGgBIBOwQW93RY/wpm8sC\nZHHA2/Ugr68eq/GF1o/EGiGFj8lISxWPEEOwA25tkKA34EZvmWEHNQY/dRgW\nNj7eW+QVgs29XfxM8LOb+EaPvTWVhPN8J9hPIglTgZIm2ozTqI+uSo5YkOqh\n0+rMAcSaJM8hV57gbCJI/EvEZ7/9wFgRobFtHxRcPg8SnymilRALNRkcAvxH\nFWWfDmUdHX6saEPNNftb53a6ZwYd9Th5Zb5PQWMigTN31Q43R8MTYTlxR2hZ\nCv4H2qa5IldxHGoAlmUw4CDgDUl/WBy2A3IViCS3+mT4RA9Fqe7Z/ddUPGzu\nSVJdFMfVqoTQ649ydqUfGvo8TjJHppWZzr7OReJ1djmDCcwPcZoxgkuq0hNC\nM60evn+GteEApu9Y9LUhaj5KHsHNit8skMMinNCc6py21E6LSnB5trXlpL2Y\nKUfT8Ooj/VqgY5DPEja9de2kfztgxDbGy27MgW8LF1l3V9lGw7BFDFdfnCCB\nVFI6l1yxZ3SlUc7d3Jf1xBRAJ1vjcgXac3fm19Jm6Q8vHzr5NJZBcs+govm1\n04pHW28OLMXSwYcJAk49Er3bdeewclpn8zG6o0bvRxA+VyaiV2uMzcbdMC9T\nzIKe\r\n=EDGI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAimgwMTWcZ+g3l+VUs9TiIs0Vws430z6qFqzPUwh20iAiB7f89NhSRZj30AEg62RAFPyvqVpxy8BovimUU90zalcg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.a686cba5_1545269592415_0.6547388704791826"},"_hasShrinkwrap":false},"0.16.0-alpha.16ae7efd":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.16ae7efd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.27.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.16ae7efd","dist":{"shasum":"cf33a6e9483351311f7a830068ee7d26d014530c","integrity":"sha512-k2r7HgleNVKFoBYtIVZYOD+VoBmDmily3ooDj8m8/8dijPD+QJYcmQuAAVozbwJKDdC4f9Eop3BwF/hPIppD7w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.16ae7efd.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG2xmCRA9TVsSAnZWagAA7D0P/ilCOVRYaREsam+Vo2ae\nxngELOSx32ojCLmNgGQ9bUkGldEYwByvJkwMw/wGB0Vt2F8zgKh4A124jKfR\nH5sOkGNDfeR2MVPGDWW2h5qvX2FObUDZGHBOpSNdOaj91yGonXsVX2hd66rE\n4sHHP41C6ZaPQzBYpG8lERu7mrxupPauqbr2wwzVHuIb7B/2VcG+2e0k0siH\niLVTx19fOgJr9mq2Z4evM4Y4Y9++kDVfzDnecCL30d00Xgq0juj7un9f04DH\n/VaEOItRE/kNEh1K2PE2kERLH+5GQ7XQnYf13Dp5CB5bKBQwUS8T+UiIJThD\nZ0gYblDVP217HesiDSuF4OCpjpaBz77Wwawx5zT5yXNsICj5f+xT5tQQzlgx\nhIZtP4idCxb8wuNCsBH1n7O/1/WObHRzHvdCk7rAvY5ZP9q5XKLHTE0vvpv8\n6ENGnmlu9hTT6Rww6cmag7gTF3x523zqmrjxPyXH9ScFBfQHBoDkx/jF4b8z\nd3qEQ+k66tesvA0m047c+W4gdMk8ydWacTT1fZgq2GSFu7hrhOihzMJuGk9T\niV2902NEkmeiPBZ883dpC815Tu4w6HOwldctjdV1CCNIdQBaRl6VCTqSKgVE\nuItJ/0t9hHX+r+aAqoyf9y4RwlvaBgQt7n3Ze8oShoH5yl0obAqkoUQIVxaV\nJah0\r\n=6bl1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHQw7G71t1qYK3cDK+ZkjsPch/p2XyA/wNfhMBDvzbPuAiAB6TJ87mAYNNl8KMRvw691ZxfCBcL0pp4M6EBJx6CZnQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.16ae7efd_1545301093958_0.2870885822007696"},"_hasShrinkwrap":false},"0.16.0-alpha.3bdc2a76":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.3bdc2a76","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.3bdc2a76","dist":{"shasum":"999545dad1cc9f284ec96d77733f7f9285747641","integrity":"sha512-8RUfiwpBcoi/15Po9Fc8XAuOuqLR6jm3CkpE1r8CFfDT+g5gJ5VYZx/eHFerBl40iENAGyQ+R84xjuXP3qCkeA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.3bdc2a76.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG21HCRA9TVsSAnZWagAAkysP/jD0pR8C+lQKyCuuZjj8\nCESsBu/ntNJSZ1Va2JThhpkzSdcJrr3YkqKSZ8V9eK8aJTHwN1/+dyZCdOr3\nQlimu2wEfllxE66KKDZLhKby/upGPaxRXPl1XOqABgzt29T9XOCHgDIl7yTE\nllirTmzCOHVnDAD00xGhW7ndPlvSAxrvUbr7w7x+9Pz1kAe3A7Y0oDQOmisD\n+qUQsCJAqkwdL10U6GIhrqWCAzWOHS5U5dZzpVEm1K3cBfeoky4ceIHIlZ1O\nRGP09Lp3Y1ViZwZxg6kEdgGhff0K5cBexsiRT3ltiWLUk46jM77+851q5sEh\nUkMTh70YzbMFZ384Vu8jG6DPxZrju3vk8qlcdCXdAZHKa2kxG/MIcJH4EAsn\niyGMwATgtwa0/GRfNxOTOd+beOD0XNyu9rpSBrES7nSPoxZgTkVCQU2Wgrfz\nYwjUUQFqCm7/lo2iwWRG1eB3/Hisgsb+EuE4VsYmh8Ms/wOiuXGQB/bNcZXA\nFsA0vRI0XSWvCa7kJ4Jgp3UUsNgA6KDSnptD+zsiyGemgKqRsqLPh6Sbt5Rg\n+rv5axSh2e9uhC3HFtq4xJivcR5qFj2h7WcwToxjUB+ka9XSeJPuoHt8MVEo\nteeq2liBDLkEwgs+GJAUIn3Agr3Oh2JQuMdfiiMPHJj2I5qP0QNeIZHMKKLs\nS0+6\r\n=3zxn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCK4rCUcSE1h3WP368tKtrG/AQBkkEon424Jz8E3LddygIhAIPMQsJ1yaA7xy+YPi+RZF7sMz1QHg6wMASTyGd8J6Gw"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.3bdc2a76_1545301318581_0.7235742316475429"},"_hasShrinkwrap":false},"0.16.0-alpha.4d8073d6":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.4d8073d6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.4d8073d6","dist":{"shasum":"e18dc20cd9ae43f763fc2f824e0745659033bbfc","integrity":"sha512-lueTrAPFDOzhqvEp7537CGmF6Mgg2z3REkCP9/sYC8Iem80DLvOSQ4WZqLLBKQzrSNPitPdY0aD9R8uLasNgvA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.4d8073d6.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG213CRA9TVsSAnZWagAA8UgP/0yTUgCKUvES9DHPh1wk\nr8XCGXUpJYSWs4wktcGxehJpsPQRD2sE4AGUFplO3wV1bnh24Chso8inbCaB\nz5mOaLq1gsWSaFG/3QtJDNt50uE9o6gVJhkaopQZK+Y2/A9G3V5xgEPylBco\ntbBuVtLkw+JrN+HDbJR60BS5Q0I6amGaNx6RY89HUr5Ed0QXFs7MeSvKdYYf\naK/euIVm2D8ed/H30Lb6UU2PFVMzFMShEy6y7/VA4lK5xU4neLSKbXoRTacq\n7fBPlEsdDaHOVyP8Uj6cu+nkBTC+9mt608myzm734F04KiuovUvWVbvLkMBt\n4WAI+31SjADGAGLD9/4b34VzsrQaJl1/d0UihFIfdyuy9k6I67TTZF24EMVg\nJ6AAZ/JujpxSW8uoGTIXSh46jgkhVfXVRHFETRDVsYvTuYeKCSquINQDaKbr\nuH1sscPcfuYCgdVuHeGIhyiWxK9tAIwUBg5V06/gyJAhAcWMYHnEIrA5NGFM\nsSzdWsL4opJiql9e7RQvFJKvKZ3Evye6/UE5dy9XxAe0DA4eT734amWpQAif\nO0lGZwZORYoyr9bZly63BE7durDo0r8XmYh49/Rt0UEKbdkVLintxDaFF4Sb\nwFhCk3sK7qht+fetRPYmuKg+MGsctPjj5yCkbNP+0ocoHBWqSnK0DNqks/ai\n8rN5\r\n=snKL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFZPbuF+Vo7eftDDj6Doh5+Edli7DOr/qFrNhZERNhEVAiEAhhlcT4Vq6gwhRgEv5F6a1a6CdmqAORpbbtZaGoBz8dI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.4d8073d6_1545301366959_0.8217836108473116"},"_hasShrinkwrap":false},"0.16.0-alpha.b4c9d539":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.b4c9d539","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.b4c9d539","dist":{"shasum":"24a8170711e3ee4a2dd49db9a31e6b971ee432fe","integrity":"sha512-VfmpC1hdKDFHR4uoin806S+FEQl1BE/wL1CdB0KuF69AAMcu9lOv6PybU9uSvBUG/ftRWT5ViMwO1UIoUelHAQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.b4c9d539.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG22HCRA9TVsSAnZWagAAenMP/2xIwKlkzr/FtBhWNY1y\nnz9Kx6Ir1zqq4d2iv7G6u4IKRXj6Suo3Fz6We3P1uZ9H03YxDvp8QEaixIse\nXtMd5M++Vam+QAiar4UPMoU7gHCIfgdygsoZKF1K19X7CHZqdFjDEre/Ez+Q\niHm423W1PA9elf4kC1RXnTKOaZtOoxiRrgh7SjJ3PdGlTD+AW58+WTNngG5e\nS2wBkXDXksdThpAqKAl6W6aSNaDVdTsbN5u6NTmc18x5bltz6nzJQIGQoHpj\nyR7gsZrsUw9oOKMk5M5sSaCG/eeSxGdbgstrGIqab+jDzQnOdN7Wqw7rgMF/\n+sG4tKbuNoRRonkL5zLWzX1q9EVWG0MoDYLNER6hiFKdwu3MZS/dgEVRVv7O\nF6cgS/o5mnNTqaGwwENfCcmjSYHqFsPO17efrOE/ljbnFve8KXGsu63kUfli\n42/vUpCx2Zzs6fbpcRppNCB9wFDLYk9iuB/YhgPYTJqfIuVdnpfgSZJW690x\nlamyMaix1JRoAlxORl8dWO8kIFKAnMmE6BwSePbWv7fPsg/NsddM8ykSKtIO\nBSoqoiuqh/Dt9eJf+v+cIE7+VsqXGHD4TMAwY1iLQes4YXgqp7ktQhN0utS4\np7xhvQRsrl6PtyoOnMhix4vTWn4nCp968Uyf6SqOg3bLNJ+iR8c17P+x+alz\nOqhl\r\n=eol+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvqmXvAtbqx206J5vRoXZDfGkrP4noYrCv1AAQQiU1fgIhAMEx/YqQmTAiwD6hPVeDm8NjbnAvciRDnBc0kBX8CO/Z"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.b4c9d539_1545301382731_0.3637571298775477"},"_hasShrinkwrap":false},"0.16.0-alpha.7f38c083":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.7f38c083","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.7f38c083","dist":{"shasum":"f8810f933015658f14c36e7684810ed6d1db2d8f","integrity":"sha512-R4ZE5aEdDYWprK42BIYOjgpHINNcr2fwCXNSh53NbB3Bsp703RUNoSfsOhyiT8WOn75zQIoyMju7edfj9tnEJQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.7f38c083.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG23GCRA9TVsSAnZWagAAFi4P/A2PnPH8m8qjdr1GG7HE\n7Pb749FxtVsN4J65z3BC1ksujNmr2HQqYf0EAuvKt+oM+dSw7inxRWXlSzWY\njoEtd9fsMKxMSFUi94RxU9iGeR/ya+cd5EVW/PIj8xuJyNSKwuXUdIx7/IZc\n2Ft/CkMSSfBnivalibx8TrjjMu9MG0n6BWshjgTeK7lwMJAxS9c7wZzEv93F\noYDg5KVaXV0BaYjNrNaaBuPkHKgfk6BMgpCyQhwRlwhH+TCdOR4KvlJfizJ0\nHELJMgylEMQAWOiVw8VAbOatCePw1CWZ52xLvWIAbuh8BFOrofFEHoOi4Pa7\ngZAsB0UCygEssXzt5nEDiHtD2oQntGCPkwURKatiJqLmKATIzEfpWvgHC3JO\nbYYubYdT4rZWQYiHxKweDmWF1hNWSCX1tV27X+rTXKfp+PGJK/dEzCcJIk/D\nkkRvG2/tKNfc8lY9RE4HVSo8s7l2VMPpdxoEEJ0uMHp/3Yq+jTWOvdpHDxqs\narnO7eDlt0cpK19D2hQbacEF/HnG9QjcW3WHjDRdsS0X+pIsa55ABc42nwF8\nIqoIk/LRBGgNEA/Di7I7wtR2kdlqK0WjrCLyZapV9Q6dc1Blq35Gz2Hxs9aB\n3CTdnt0k72unSQWR8baLbSWhz8NPaSdYwLn9/n/xJ03Glzz1ccHVrfSsHyWL\nzMeo\r\n=2g6g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBycBOVbMFsLvB8bMIc/xQ7H/+u8/jjVFXztHE14WMQ+AiEA1MzquDwdSZ/cVPtA1mEcnqsIlDWA+bR0aQmwKXNuaZw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.7f38c083_1545301446199_0.02782146255733453"},"_hasShrinkwrap":false},"0.16.0-alpha.887fbc62":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.887fbc62","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.887fbc62","dist":{"shasum":"10110a4a63d469af0045e063957589a628f5ed25","integrity":"sha512-cDeAURWO/EtO5BLeMSb9NQdAN7gJ1HylImhipU7fgl8SdQU6U3XfLXExpWm2D3yC6ALorUqIgB5DG5Bt2EP0Bg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.887fbc62.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG25mCRA9TVsSAnZWagAAZe4P/08xQHMd6qqM890cF1jz\nspuGfsmrBKL52gw/L4W9NR76QEIriIsnEaZ6+ImJ0O6xJCnkHijbfoXiRG+E\nO9BjAz58873kdAcCcQ1DGOM39/Moam/PFxquO8kfLF98/+GvowWEOxNl27Az\nS9yx/mQrj2K1ynq5vf1ql4eiO/sNUgRszFpgjawJqHLs7xK0SAPKDSqJgUQS\nfcSy0ZIaImNitJn3Ozh/0xoMuMly4HYadbxDkgluv2cuBpubhmMgkehf3E6B\nOI1uqfsus2fGxXKHV3bblqhdu7ZVbp/PiO1TmZRUpWuFaoUklnxcZ1uUK7Uc\nciUk0wK9cdxF5PEKeR5gZSrZqxW6D8ku0by0/hh7IZT+shWZC0CDd9McnEeC\n/ajBmLUqK7wSxlfUd+G0Rnq9cHdj0cc3tJWRZKvNaNlSsyfmDAisBMFx3Hvh\nqXPK7zo2ekokjLtyazIf8voJsDIdS0lRPbHd+RcFjpoHtDj9UkvqEUvmO3DY\nFZzPedaU+VE2J0yFabOw7QXuAfEH+kUmCanXUMC7BU4n/omf4x9H4DIih28h\n6XVc6h3fiWzzIu9VDdhti3Urq3M8XIwsN22zcMtI8rE3aZfIWWHZ9Lq6z3w4\nbYoacCPnu2HPTTuRJv/CeNur16ddZQoeO9tFMBS6/xKJ9WpRk0d/iINtt67U\nagLX\r\n=MZtC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTfjDcVXJOsU8lkwnjx4Dx+HlpCV8Zb3w6fwrUimaceAIgBxxusTOPyvyHC1ozzFZlSHqNVCOhJI8hi4O3T+sisOk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.887fbc62_1545301606103_0.11210238079515977"},"_hasShrinkwrap":false},"0.16.0-alpha.b80834b3":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.b80834b3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.b80834b3","dist":{"shasum":"d6dc4b943c2a9080b346d2111cffae3a56a088ee","integrity":"sha512-oCeDxmvZScffZauVkk3Q3NekQKDBfKxebDw43yvuGXg39nkH5BpLn1fPS7pVl1ZMrb0KOefOwGDKqTrS/vce8g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.b80834b3.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG3iECRA9TVsSAnZWagAASG4P/inZREYX5uFaniqRpARh\n/KWMgL7WgYYPZhw9a62J4SFHVgDlZEZq6Mtjsa8cjno7ovrtno1COH0fERqq\nFJPnWtG3IZhKRGYnCUR6g0QdpFb4gDDLA2WGpVlQllywGFR9I0miawjk1Yiz\n90TKQ/zyZKhygW0RXjikPRZbHqc0sDsjxu/t0aqNiv1mTB+mk9zee8FaIgIN\nus07ceu7CQfkH+mPfpN1b78thodfyJS134kF96OhdwnDk4fgSdlpfdjbcK+K\nIzHLGiRI2klVhsiZgNhY2Wg3jUHY/cqKcdYXUtknKBGVh8vpci5VqAcoJqCb\nkLVRkWLiWN/qJEGeAJ93UwiCHmj9YNoU8LtjFQnvx8FWKAby8YVPXc0nUXyp\nEsTnSpMH1O0/04ioPfUBCThcsgwb3xbqQTAqZbSHgc963RmdTRPoD2tK1D55\nFOIhUwGv+bvA7Ke1IQVNk6GS/JNaFzIrD4IwgdGh7z+Ljm7oOIj/eZVAj1xG\nvEnFg6rEhx/b2IVTwViswzc+EQ5PZOGP6EvPkC3dhfIx7+m80FD4r8aMS3gG\neQRwNSGolQox7/JG20Fi50faX23Z36fRn+33jQ0F9k4hAdk3m3RSMoxsg0V6\nu/WFZi0IvpbnjeVViursc3hph8h05t9rYdh+OH4CouVCMkYF+7VLMWqZU1J3\n7E5e\r\n=SSAU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH8rz2dS6xenDmgo6cy2Y85dqKJQ0YgCmGnEoNiQOSFGAiAGrBsJOklyk1jXKCAeg01Oe5THmf9ZXhLPxmbhCXWc+A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.b80834b3_1545304195384_0.9961250350837278"},"_hasShrinkwrap":false},"0.16.0-alpha.a9b535f1":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.a9b535f1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.a9b535f1","dist":{"shasum":"9aa59058eb3fdabe653810caeb769fbbbdf0dbec","integrity":"sha512-Jjs+R2bA9f2XFL/wlwYcFvSjKSmO0xylBIYF9rf9aln3vX9vgQAh03ui3+Yma3aNwj5YnqQ2m8JwJAbMwwIQOA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.a9b535f1.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG3iNCRA9TVsSAnZWagAABx0P/1M/w2zCpuarZRFvCCkL\nQxUSCfx0Dy4IlPCUGF8W6DUDKuW4vufjsQZmziqe4GRu/nq6NeWvNtB1CIMM\n7oRYXtmIXtGq3yyCYdX/HtNgXu0dgPTXzL7hHoeZfpBC0n0/LvYn1oXqmec3\nKogn+GlI6YPO9RG8T3NE4nERX+edrOlF0BBmuIKlJcZPFpnpCuP1TJp4F44D\nz+qC9bwVTXF1nOl/mBOeq3zGmxUC6rpW2S4eB7PNLCCaR3zcY7uNXTYweopo\nFi4zOzl4wcevVtrWSnnzuRwRM4/mU/M6DtcKXqs9ao1M7y3xnmyAPycsSqG0\nFBU2736qFRYQ/NU2GEFWL4GRc8V8XWPovgKXA+0QrDj64q+HZbgNVQjBvxi2\n8iIjL5zsa6XJuHhD4Et17vNUD1csGM4m4bP2VnobXRZUnk6TeZ9dBckwaPK/\nwarjX9rRuBxYaR4zzZ/N9s91p/Q0mkALkucbeNon0IDKsjUjo8hqUZI8io2H\nwkuqmwNgU0HNlb5K+8sytejGBqADfykhWr6fBor0RKXc7oXRe81ergDviW8+\nCu1RWcbqVXtkrfuYJie4RjSBZPOls6lGLfDWPxJifJSiTwiKFdiByVIYASWF\nqpxjnCIXxEKkOtnrQY6JjGdSo62ZefEO/Bb0ovgoy023OINJqawZXo3N6PD8\nWwPk\r\n=L9R1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2TQ+DGSrKqG7Eb1r4NlqOcOCo5rvwsKEt0XolDU5zGQIgSq2e0vV1//S2nkIWkQsyCLrcA0HEsVp35PyR91WTs2c="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.a9b535f1_1545304204718_0.20593461675782598"},"_hasShrinkwrap":false},"0.16.0-alpha.eaccc849":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.eaccc849","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.eaccc849","dist":{"shasum":"f7874ae29e6886e99becc417d4494bc25958808e","integrity":"sha512-kTxMm+g+FvJ6Qb0TiDL4hIq4cUhk/zHput4+dCHqb6WH5RQ//O8G7QANbyyEdmsEr1P2v3ZG8OaP6FNJet4jAQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.eaccc849.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG3i0CRA9TVsSAnZWagAAoS0P/iJ1I4y0s9DkLXIJ76nw\nndNrWb3yPqipHGZK5xawfHMr+TfD+Oyj9MbTNjr6ggg69G7vkOf5wKaumJYl\npA58sjiyjhPfapR73R808a28zpk4V+HUfgQOM+8yi9+aTgfyNqmdhUf1EkaM\nSx9SjGDBILAWYP1Gb9J0X5AnStrPxdCKKzFBZe+Y2RStiVZFb8beQIB2Kjkq\nXDzpmdITuFi4RVstapUp33QOWDAvzFv4lKPBpj7XI5yuIX4qjYGcYmBL1Vl1\nYfg6FT6X8kWPHtOCVlfgM+8tjYWOVHmITB/PM4a9gXT99CdMHynbrQPYgdwL\n29eaHkwXv5ccqjWqifd56DrWCXeSOskQiYOIcTdUrrlPOjNxihFbFpK3Od6j\nCqegxA2EicQzPYPt5uMeWbkQPCHLMsB2HGEMQIM+d3flDsmS1tUTNzlGL47G\nqfm3qIinFng7UWsZJdYQ2qptSlGQmSedh3GF53fXb1b5eRGFjUxG0xVtJ7WL\nkYgrPg4VX+8dQ3S2pz3Id352IAZmi9rl0D0p4u+d+y+5Lo4HISUQrDLWBIw8\nkq7XT02Ehc3k1DbGt2bbtFaJ3BaI79RIDSSE9EUSLHOWHPUhd3CGS4SmhMkU\nINMUX7soSh+jHQzexcqyvFIR49AeTEo0bCsp0JKq+3rtzDusJYN4QDuiIaEH\nqrWy\r\n=NRTy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwEzpITeGwI9qSkjO0AB7XjAEHq0mYsZVdZBhMcG6NAAIhANXFEYSza8/4n5SvzmOm7b48AK7o6Vt0gVO7FJmczd1E"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.eaccc849_1545304243221_0.026421094056505057"},"_hasShrinkwrap":false},"0.16.0-alpha.fe0675f8":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.fe0675f8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.fe0675f8","dist":{"shasum":"09cba3c0b1ae3e33cc0565d9bf3985182b0a8a1d","integrity":"sha512-sieLtlspzwtQ5AMYAQwrwvteHz4uWAasl1SLaXzvceBlN5TlriiN1ecmBY0U4cGL429hfxClC5XdxWj4AUWpyw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.fe0675f8.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG8PoCRA9TVsSAnZWagAAikEP+wUXgoLlObr6RLDgDSbr\nHttlC2S8iuvQaAZlEF0f4uYUoKGxZ7SvqykVtFzWH89JLhp7BGLt2sI313tW\nilCKrfTd7BTdNO8RM8NkM4uEbtVYNG7FM2P5PbO1FID3IdpRRL6t1y1TDFY2\nafH2FlOU0B3x5n06wOCKNA192N0cCiXsmhQYyLa6jI8oQ+Dq0dAZHmzMP5Gp\nP8hk8/PDAwHxnyMSCXGe/GVWqGEXrAlcAvfg4pGYqSw9ONi3FOCT6aMN/n8H\nlZ3q+TMh+lJWB0FOb/UQgxSU8ZJaCJxUvnJpnc5wWrYHNRhDeJJSlYzdlzKZ\n63mv7w7C43kbX+8UwYW8zNkubAWigVQIfdYdNzLqaaH6C5zXFPRrqGxokzIO\nYaHXBZSzfoIPukZCIbw1CGc7ezbRIniKOJ3ZhhrMHbEl6Sz/99TG8uyKob/Q\nUUwZsLXyfCOdX6T4oGAaFEOVmPD/jM9GSMnyCIY3VdncPK3MyClZkyIqVRxo\nj6cdy/8FY27CKFwkMMpt08bpgQ1yuqscgJ+akYCIuBGb+gJG/Shu7VMltLZK\nzTnjV40HGZuSslFbnuIEMa1ueDdDacDLUTM9pb/vyHfFMZ3dHwFVGdgpdxHH\n5/J+ecf0AXUlecS0KOTRzncMWd4qMWC6KpojBgb5/ZKmAWFn6+dlPz0EudHm\nKrA3\r\n=ReRZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHzKwk5kXCuPIirr9XTKiInNbaS8g1nFonUtbPciprffAiBOXaz1A5vT19xIFWU95WazDV0PPJ99rMcgkXGnw6e57A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.fe0675f8_1545323495297_0.20641812813149896"},"_hasShrinkwrap":false},"0.16.0-alpha.fd0ca14d":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.fd0ca14d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.fd0ca14d","dist":{"shasum":"bf0a3595174003b0f4e72bc4f59aecc8795816de","integrity":"sha512-WTuTk8y69RV46CcBQGTy5WaQZzGlXuowfNeFxaNJP75EHfHmDVG2Rmml0+vbhr/sXTriIxhyguSQeyZlPGaTSw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.fd0ca14d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG9HeCRA9TVsSAnZWagAAkT4P/isQ3j1lY6kAHdOs0eqF\nJ1XIdrxiYwTQYw0PRgk4h/GCC1nLzRMwEDQpij9D2UJf25fBXN6HNyuDsX25\n/e+8RmP9HD0k1YknpX+cTzIrhy7hrIimIn6KJm9qbmFYwtRDYQE2Ynf7sNyU\n4Nng1jjKPUuSoqZrXUcGA38OfwIWa/cEcgPlr6oZqoDbOFcAa5ldjhR1BCUE\nGMSY1omlXIk11qrN/uP/j8ynz8kVl9oFu4LsR4zCEQNs4pPYV3OaffMd71gb\nDDh0lkYGIsG48P0fpuzfYnUog+hCiYDaP4+VeaG2Q/rGzvljU2Dr/xdVjeml\nMoTxuRzEPp4hjfwOBBE3ycAQvseD+CvAgAqbwq2Yki5vrb2VIURVKju645rv\ntCQoPnedy8cHqPF151h+4hFR29bwEju4VpVKx3AX44Rce8Lavfo2njC04zsA\n7GUKnBPs6I9+0MZ5U3TpwZlt9iyOrJ1ePOQMOglsVgCBVnRklccEwbph/S+B\nUqWQr30FGReMceRUeB1SJnZqMwRzB1jFO0NxKQwn5t9DVJN/SgwrRW4UWMPy\nCWnZK5vj1oKxkQI2pGumrByu9+/mVcv6zp42aV/Vi8hrc+aSJjPun2OwR3Xm\nsfDBqXC3oYZaho2cYHM6sa5QIvML1AzzbtGTYhSmmknUcW6rdvY4Y+2RZQii\nP0iH\r\n=v3n0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmtxdaQK1/36KKgYIiUFe9WWFPb7nRyCJ/R9gYoNZEtQIhAMFqTQlBZSY0Z+suwcEzG5F0LQ2RmrWWAfOtFFohbtw7"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.fd0ca14d_1545327069351_0.1394204474448446"},"_hasShrinkwrap":false},"0.16.0-alpha.fda5b03d":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.fda5b03d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.0","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.fda5b03d","dist":{"shasum":"086629eeb931ef5310cf3d920ece5bd5620e3857","integrity":"sha512-UVwkoUQKV4kcsyUdfENiyRY4CbAV7oib5fWr4yf26aNIOlVGh9aphBVh5klruYHMEHyc/u3zpkop5+mNy92CEA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.fda5b03d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHCQjCRA9TVsSAnZWagAA+BMP/RZ6HeXMIEisMFaKuWt+\nQfdgeMcverh2I7UiuIC3GTPqSS8lBdMf8bCCtLanB6VwooohRqe8xoKjRQ27\njg/Kjk4yqiZ1J7Lgw8+wEFAa4/NF5CtXO2B3XnuwVIHd184H9yAPquuLWKK0\n1kg7MgyG/n8MBU1plMrKZxlCJxvWatKLwola/UuAzD1Mae41df1x6t8/VQBL\nDHcRN5ezy3BhQ+gAnL8WOEoUyv2Q6GJ7VJ01vi9+91hFbTS40g3IyqbSGvNc\ng0+zqpDb05RifTjx9CooL1/SnFwRXOQHQL2O3Fxpnu6rErU66eCWpNzrFX2Y\nVeVHO0PEcp4c0ejQeiiBlBOoQj8hSbqJ1bE84/XX5GO9UdHyM1w2uFTSuY5m\ng2YH2GL6kb1fWb/EbeL6kg74H7o9mYRkwsdCKQJUlU7d1vqHrVYnkRRnXLgV\na2l8A2mzRatbZjsAwEsaCJG/5bc44/cGenbi/69lnPISsCTlrNjPN/rFNjRs\naNqG9pi2q9/OGrhB3kxBSc7/PQi4oS7j360gU0dHtMPG3HoZmlwafH6rZASR\nDO4v34JrvrRwyDueSIOKRun1uP6Fz6ORK9UnvrjIrKfK/OkhMmLHfu+dCpoA\nn4YqPO1BunH+Q0Qgf1hjlofpM6etpYF4GsPHBfe7NG8R32Dn5Y82ytQqBwWI\nw/v6\r\n=1ha7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHShsZzCJRxyXynEruqNYC126lEKCtGs5VrJF2O6x37pAiB2XL7jyKM9peydCD6xLMSSbgDvpT30l+WX+2xOR9QoSg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.fda5b03d_1545348130696_0.6326110568227084"},"_hasShrinkwrap":false},"0.16.0-alpha.bcb0fdd2":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.bcb0fdd2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.bcb0fdd2","dist":{"shasum":"6dd10960760c85410cdc989369533f8cca939409","integrity":"sha512-zYugLzarP+WkzLekFonYF1VpuowGO9nMcZ6pTJTUF0FH1ILDfN27umJRrlB8+2IgCCMubSsaHO8fMeNEaBNQaw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.bcb0fdd2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHKXyCRA9TVsSAnZWagAA2+gP/1jOlc2Lc6AgwYfFhChu\ntO45e8HK6LPTzebSDK9TA/CYccwBZU9qtGOwIl+Hw7B5Ve/0lTnXou2+l4rt\nqz9zYY0TBJNNl5KBo9vnVM0+8UbykOKNzD5uzHypttoeAIajuH+jqg9VcNzV\nsCCHKaqEDLUE7msclfBGzcVi3Ehgo8KhvUDCapFbRb2q4iYYS+iJVN7xihWM\nIdbDw10FUTlpsvkA1k8nUVLIGwaLxtI7kYEh5ojBok1emb+r6FB0faJXlpk+\nsoLQVctPxaD1y/1xO25CqStv+yA5Ow+5dCEtMYi1lREoy1oX1vM1hWupv1a8\nYrpoKibHNniFDnZLvAytcHoI9VO+uRURKH+lKrA+rWCGCK+i3r0+U1GpipQb\nVpBLLGSCM1LuglYcrCeipUYTEoq7MvBT/k1XbENy8YB1ZHB7tKYNUvCBKEm2\nqwYrpHcGPCk4kBNE+nYr4JstxFbYgg2Hx8NIw1zIybEgAYp3hmJSLTJpXZWb\npYtUdcjuSnDXXL0F/ZkteXmRwXNaqUe+IAdC0QGbfsn10ryxjTBMj2F+T+G7\n4cq1IAXxMFYipptD2WYju76iKbQjvssc8wlzrX1hBLWvcGuHcbrp1cMWGejE\nt2XeKzduaatFmBiz+3hbe/0CxpM3L9SD/YWVmH2RcAO+wqXgwKoEH9MjvN0h\nH1kQ\r\n=hZzV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTwP2vjmhHjDAZg5kcGeRVVZ5tFeENdG71UhytqXrNmQIhAOWhoTFp8ttu+tVgtLriDY/oZANvJ9anRSDzvZn+OGz9"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.bcb0fdd2_1545381361665_0.8657056546148807"},"_hasShrinkwrap":false},"0.16.0-alpha.b6a44549":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.b6a44549","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.b6a44549","dist":{"shasum":"6f48760e50b28fef03775f2046264045fd5a5809","integrity":"sha512-6r1QybyKquwkrjIGXZxaLd7K4AyRXVFbGlxabUbxEGyjkRrZZd3drKAbqpUKAOXB9un/xOPeAo7wkGeCbH5YGA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.b6a44549.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHKYHCRA9TVsSAnZWagAAfPIP/jUz1Y36kC2N00vF5l7G\nKidi5xf2HME4lGRYkTjRTJRPVajNfNH/2fmwS48Tthv0BZXSriwO+Yixjg8V\noMhjNAdbvteA7NF46Hueo4V0hyZxDKlD0DCICtTPeL9aVphlT3zpMgh2E5W8\nScJDAaiu/E2Fcum1bsbx9TLdO0BEg9JXzxioi6yRdwvmzMewYo4ZvXbMaAl6\nDcib9Q/YwTl8qGWp86Wi7NjQfK45elSqa32lj/236BJHrAWcGRNpTDRQhuK5\nr07QughlrrM5Hn2kW5iyhpTGJ7Wz6sbWFtFSNi3tSHmuA30kbD6z3uRV6nah\nWaPsDOs5S3hji+1/Po7Sn5ZqgCeY+VnBEHPGTB6fUEsBuwjaX8FKFLJzKr3R\nwl++VJ9KAF0tzrQ7Ge9j1pKvEtnogw5ZAm9mcz0cPBrTwCi8IgTeYQige9++\nIiAu0YHT72gM/bigh1mhytrBbxV+clCanr7Bs6tYDF/i1sXESr1CPqA1TFkb\n6QEokXeknwcBaVW8Ect9+MhFZz+MPq7x+FtSrw3oBcaZNOWFjug2DKYrewLG\nvDPejk8cyYox/IQcbr+HB4B6RWJOnuo6XEg1mHT6hGsHYXCYGGDRAlFzMh3q\nYfLCTs4bZi4uWvapJ1fz0hEGwp4LRklVSKzQlEId1d77f/bsgpmyWIDSZumL\nMcm4\r\n=wbFu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD54HKUSBFmKqAyFTJzQb6fvfjwIy6z0VcILow7ItP7vAIgU1UhVQHHKjJNp1WZsTYPLXytRuhqwn87F8dX+2hCfCg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.b6a44549_1545381382745_0.3536599635229507"},"_hasShrinkwrap":false},"0.16.0-alpha.e907daff":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.e907daff","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.e907daff","dist":{"shasum":"7f277562e6118b9a001e28c10c9c61021474f2f1","integrity":"sha512-v7HimBQeKeV7zigGDHN2CZq9dGDgjQikJ9joMrzs7zukfnN+mn1ign72HmvJAPUEGhDZFGiUPyyzlZhJxCKiDw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.e907daff.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHKZ4CRA9TVsSAnZWagAAfdsP/icenYu8VVceSbKimnQl\ni8J8ByMcjgluaIr4djEjExD2s3Wz5fG7iKQnJbeBkraqbyyU315Cvz3/XQZk\nexxv/rYLEMVkHk/QkHi0qTGTWExDdXMoOAX+c33PnnIapEFzuo1Rh1+LEuhb\nGWTz9GkHVBhxLMXlLQ9IJ8Q5Qtkrsmzo0DfJvzVs2+CKExbBcvJeQDBdb+HL\nZneTot55EVSTXRwlaQEJz9019k90KA1O6gORMwLKpfIPmmySIO8vsXvR5Mn0\nBH753pvwLYfzqJ3JQNtTYpFC5TpTlZZed5kJXoT0NmojADbRHkcgHIwygqKi\neoovrnpdIESb6DLsNhpFoNyUc1b1Oeldh9+ib60lUgyfug/gJUThAvWmSVJW\nLTtm348CcAdRkGO4HKTfSiPtOetx6eOZ/iA+uk0eKm0SYfzsSKeobAdH92PB\nhNK0KAw6lOfvFPf6QfnEk4IGwyv8RCSgHkycRAl1L4S9A0wo9/dJABFlwXrQ\nochESMS77nHJypp8T7QX4NFNZ6chF88Uqv2tTXEuD01X/FSGoHHNl90CIdpd\nXvVgYnQe5r7BvxNcgr/mEZVNlvHXoJqLkqFKHkG8WncU0X9HyqgNblV3LTHL\nqZsk6yQ0E2tjrleELxXqw7DVWBIDnbSiaFAkNEPyNohRQauvdMb3Wo6i1sV/\nzrtJ\r\n=LT22\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFOYdX67WzKvH8CF9UIH5g/IYooS1leYKXyeGyf6gwLQAiBsOBCjNE3mkKADcqJhpA4gGUnHYu4merJUQO3pLVAvRg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.e907daff_1545381495515_0.1123477778435642"},"_hasShrinkwrap":false},"0.16.0-alpha.013da346":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.013da346","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.013da346","dist":{"shasum":"4dca250acb9f717961a75049b5741738047cd485","integrity":"sha512-QAZJDPLg6XDrk/Y+aNfakkf2zeGjD/VX4YAw0zHvpR0kpweEaDjAhrW6NG4JudcZmy4crsvqt5IhEzD24AJPuw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.013da346.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHK6/CRA9TVsSAnZWagAAWwkP/0sYwVvjxm8xYT9rA/8a\nK+NdJ6XN9AEkWJ+4rpWlQhGTSGHpJB5CgN4AoL7IU6kevW1Yuzj4+wQS9HMI\n9sgmu3zmxPfDBWooipbcj4uihE3pgUCrmjimM3AnIlkoqn7cnmQwKQrS8JXG\neq+tWPvfQz9PxcI4ly7Ap05wcquFGVU2gBqlnmR03dwwoTwGCQzz31fwzuiX\nD+vt3fRBF7p3fRdSqufop3wmu7JJ3W2nOr02q37X8EMZkwA/4VGBg88UtPS4\nE6gZyxx9O62U1EaOr1vuLOlD1iXBR2ggQxVj1kiYgT6EZHGqrodXkgtx5RGO\nUjSX/wjUB2v7S7mSlLGcNo88F9/VTFnhZ7P5f20SdRILEks29h0oGxG1Fgds\n/2OMfLRIBTVFf+d8gVQbLkGtPfy63sxRB3oobIrPz8V7xCv3cyF+YDc8V7Tn\nQpVxugfD6/xL7rz8geW85O29Y6DJaEBk9SZi//UixExmeDxDs32zAo9Ss+5F\ne0pjwNekmiHLLrP9ae+LTwZb1snGHvczgk8eg0mT4SQnWhmmASDL0yatIO+Y\n1H3hnB7mWEamuw1W+KSltSB8T3anTFs/GZCUh5bIReAMEBq+rwbrbpzUiI8n\nu0cRsKs0OFdo6MD6GPkTRXfbfVpd1O7MRQN1RtOkOgqYsaqNceWDEKcrwEB9\ndml+\r\n=4jEp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBY5Y9StX7eavtJkAtWO9GctMyh538IC47E1ULJt0yJgAiEAgc+M0YYHyJTV32lQBDLORikjV8sqOiLNdNNqKRB6DEg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.013da346_1545383614612_0.0016229814593220482"},"_hasShrinkwrap":false},"0.16.0-alpha.0d94e864":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.0d94e864","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.0d94e864","dist":{"shasum":"b31f37ac3dcc601c64232ffe209f9986aaaa22b9","integrity":"sha512-aflIh/sVxjGo1Rbe9pqytrOGmfNOZDR8WzlMZTymCtjreSBRjFkBMQ6cWfdGZWJoJpDLUBHZtoeRE8ARHNWGAw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.0d94e864.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHMV8CRA9TVsSAnZWagAAB8MQAJzfuAEPYsYq6rA96oLq\nagr8tvFtYNHmaPULd6FWbW9b6HJyjLkcByvN7NpslDuodB1yvtpbSQCBQ+T2\nS1FddjfhksuAskJ7Tsd1B0rzKHGSop85a5KkNxpTEaFR0E+csHobtEx5i9f2\nwYNQ8E0ANi29gDtlNlzbDYYqJd+wPm62oP2X+3gBRqdKtdjrNfuXGsalA/ZT\nFEdvcFAxhn7i+dseuRCVyn8DFd/b9mj+7C7S1UMVtmkf5SdP5U8RSGn5HCEC\npQfls7Yt+kaXtkx0/rleAGpeMQLXf1LkXdqWb5C3XVY0BZB/7+jw6Yzic8f4\noVWxKe3SK2B8A+Eh4rvLl7Z9g96mjS9b3s7e6ImRDV7Oy8A0QHZNXg9ucgbq\nT97LpjOJJZTgbs2n94D+GXJtywExJm4HpWkg7Vu6gHwJoIb/xFNA52pPU9Xg\nWGU3MqHfWRk0IT6dh/O7VXeqMSDJvi9ewn89WB8Lro7xlA9mQ/EOUJHKBkVw\nyrN47JKUQnutD5FYh4Q1hIl5EuzRW3zFhLIf4Eb65pHR/yIcoxjog+gopncW\n0O21mlKhPe4tnzStWTJ2DRixZOFcA3Okp37j//BFuP5CYmOAc1iWfDkQpuxN\nsTvfFqa7sUknwX7VPSJu0jdZy9dFAdMcZNWWU4fbH9VvOlG1ZhMaZBFFVKjW\ncORO\r\n=r+OE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsHVDZ7xyB5k7h5iwc20zKd8I96STOMED1UhckNWxbVAIhALDYpRlhJ47MbAKirVVkHo2wHHpEuKoxcnUYxqZa0FVX"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.0d94e864_1545389435542_0.5873347610276234"},"_hasShrinkwrap":false},"0.16.0-alpha.bfc1bdd7":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.bfc1bdd7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.bfc1bdd7","dist":{"shasum":"d391f9c20c6a0d1c4fa9b33eb7d8a17ddb1fdcb0","integrity":"sha512-X+sgIfwivpK+Si8xVepGl+AiS+VTNO3CmGSIdU/HU8tiTEBA2rcGHRZa5KwHMRl3kt77BqWzY6Je/f/xXPtkvg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.bfc1bdd7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHXOoCRA9TVsSAnZWagAATw4P+QBdp8exvfJQoDrOPgA5\n3udEZco4/iTLYoBiJm0fOR9wdpOA9wp1IZUTUogdunSr5D7bVWaC28FHKrMJ\n/XVCBqL8TRwKgbRcy581IPxVgV3lnNHQ8WWS0XDK0zRj93zZTk1ewZ8BN8te\nn76OA4hpVR9cefPfz1FuAn6yVuN+Y1Hnsz7oz1HXATceNTrRQOSNSVHveOpb\nnQHWA6fFc3kAcHai9Vk47owLmfpzecN+ky3QMUrKVuPtkhlt0Ya3ovfAOONH\nr/qjVRrC/8DmKW7v6E0Le7/qO51X5QvBDT6Qh1AIb4G5yK0vN0zZxA4WV7RA\n7E6KVpUUD+OBQpSV3srS6kRw5NC9R95Me39VfgrDMnlJwCVfThOuHfBkv2XX\nhdLffu1ZiyO+Br02gXt8QQvcb2prFs2HknRv1ee5tetpiaDg+8dWly4cK0hw\napakEaS2/Fep9gqnZN94Nh5mfWqcguuCeIF/AaXxKyN+7hstma1qGZDh4QZO\nOl4TYCJBhQgUTut08NlY+0l4+UaSI5ta8l8m2gDyebhFfhji40l4rLkyofyP\nxwgNdN3SHVNazpUcepE+YkNctZYw7m+8p8qQM+lYFhbJiUgdvB7cKU4DOkiS\nuToJe6QsPTNAEINkmXcbgL9T95/xBmDFLFyxDk/eZ4YAA4+01iB47YvkV0Hv\nNyv6\r\n=yHXN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtFxGD9DA76qC8xR7y5L3j91DchuzfY9iAwOxYH6w9QwIhALSsOwD6r0waGJ65Sr9B94MZRjcn3VRd51aWUGtWEH6f"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.bfc1bdd7_1545434023626_0.47500106157175437"},"_hasShrinkwrap":false},"0.16.0-alpha.2a98b4f7":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.2a98b4f7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.2a98b4f7","dist":{"shasum":"b63471ad90090a85127cb50ef69837ad693c861a","integrity":"sha512-NfRtYLrvFtfg7JKviWWEoOTQHq3F6lYgqugUHZJsYgSl0tCYkW96WTOVUNXZ2DEPJfDax5oCH5Yi6Oxvx4t9vQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.2a98b4f7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHjWRCRA9TVsSAnZWagAAPJkP/AlSqM0WYxTXNwMvOhAN\nJgBggTlwqIxtvMMGMF6VX8yQmJmEYUHH08b7t5dVH3eZC8DNj+MmnrIu8ivC\nGKZIQ2POVNx4Ot0ens4VcfN2Q5UpBAveREkFbv/wZMU4p8prGCJRuTFfSLBK\n1nDLm4o/8WMYm8iOq90FWr59Oe3o8sKlZ1BO27MltUs+fuG2Zd/3ElbYEp18\nMdin1aQxfx06QmR+gxrMLtENUQF3RWFPzE8aZ4xQBifOSkL+7248pbxs8mRa\nQbwMXg5p8suYzibklfXUImCICGKC+h1LgoKNlvaqCC46t3MJ7K5ibLRzZUvY\npq/zN/XloIbOIPpyygq8Xx23ovpIzWOT634ZRgOR6JzyyMRv/2G13iNi18u4\nzOR9MQqMZmZP0RhGtnO5YkF99YkIBdpMfCnL5ZohFk/qstOVKFDZ/VPZxkoX\nBdElgR8RJXBgDFPFYB3KQ1Q2yt/u9jxKyLY/Dudg5Tm4Lc+knH1VMiOiNw/F\nDFyZOO6S89IrdxEwc1mn90BSkgdWzV9JdQj2HQ2pXBRlgZskRAPVDIhEkv3b\nCthlL17fTSz2lBnBrNvl26lguRgrsgJf7Nh//OgOo570aZU0UlS93xRsDn2F\neNHnWbKyQvPP43KbXqCG3JtJqHd8p9R76tx2nDu1WasXBB/0+XxfXjZ/rw+S\nNUDJ\r\n=YngW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzWsv7kHisjyNRI5SDAoxtnumc+KIblN+6y31fLwUb5AIhAKOjDMYb9/ivB5cqbBRAiwcViNgEMIy5MEKSqGR2WiPe"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.2a98b4f7_1545483664383_0.5064631533826558"},"_hasShrinkwrap":false},"0.16.0-alpha.7a411e29":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.7a411e29","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.7a411e29","dist":{"shasum":"06c51857f2aca0853ea7e38314895128e130d76f","integrity":"sha512-/2aIlVxOqT/YKlY1Q+25wF6OV/+1jTOGD9NoaSf1mVitddIo9C++kMOQ/lInoKj2eElny3gU3hKfb93ImHgEqg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.7a411e29.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHloOCRA9TVsSAnZWagAADsAP/RU4PEi2EnJMW/jVOjmV\nNHMRE+KHfFBMXE50ZIHD5Ly2TcAQIClz/NAuiPEKtF9T3PxnQ3/CUpLY/c6z\nV61nUi98Gad5zK3403X+hoORUHcTDCmMTJo1OqnUD9xxaZWgE4tYjyvYd7Bi\njK9AnF8fdK2gRggHqK0rUf8MlVaNS9FcbFu6I+J/sVMx1Cx4vcdB7ipM0eDb\nusVVqJ+0OsL4DtN+WYPdgltLsIkpgFjRlWqPcZvk7Wy7MVDRPyHZ5NmsK54O\nLLxM0M4uOO2QU2jPDgzkug1407w7HOELRcRe54+eUjwn5vVEIphMtupKHKMj\nMMUCPXDEiwtAdTZy0JhrGOo+w1LsxsXgVEXbsK2GKtMDP7M8KTyClui4IGrg\nUL5Guzg2ZMjD/Rf/L1yApLZ09MVM0WrhBsW8H8gdIa7U4liaep32IBn6DaCD\nBdlKhDQ08UMjNLO2A4Q8UtLnRtznxS6+GCnbgxxmbx+B9AfHiNKccgjPHACz\ndX/B9AhOij3ljvM0ASItmpGviZyCGqeLHEFKPG5RaC6VM/EMy6wymXeV92eT\nuzDOCDGCMEz5kSwAUQZjiWWYjictPRODQmDu7Nk3E/JONX55ga1I8XDwjhBq\n7CZMf3Nwg8cBziRo7ZH5dtUOiO5Es/ordz4y92/xffvhbel7XyHc1Z6m1C2v\nDTFv\r\n=0pYh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGLKWNBd80gHuJXqneCj7Em88rHCFsEaNeFYZJtgtf/MAiEAy21ndPtJJgLfieKslDwu6Eu8MTDG3P3MGEYahtUXhbA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.7a411e29_1545493005274_0.6430566710305563"},"_hasShrinkwrap":false},"0.16.0-alpha.0e612a58":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.0e612a58","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.0e612a58","dist":{"shasum":"1add53d895e82c505c5946d63fddd958f79f87cb","integrity":"sha512-OimYBPHHFXIvmjXFWvlRyH2Kfdm0YK9hrckkQPBazhrNUYK340mO17fXxH6c1k6HgaJmncoxu6xkThhqT15djQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.0e612a58.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcIIMbCRA9TVsSAnZWagAAetMP/1d9y81qAuIHYcLPpDdv\naCVnkAjcMsYlnyup1Dmbug4ik1BnOTqMADk65zEASlHuP4fBgxAJWqBEO6vD\nm1WsnKppISFDncrSmTiVnYpVeHqxzxN/BJcT94WZchYqIu0GTsLEDvVTaj0t\ncHSO8dne0DXU2cOYLWkJBfxDhsuh2EevBx1zNFLVFlw70htbxuWzgie7e4m4\nfRSSATklekEZPlCdHCdGSRKFhqjZAPNpgZZhYQBytFdt5WACcLpCSy6K3RxJ\nRNvfdeRRkk1UPZyC0yaaM0oi4AwnwYQGlOGV2lb9d8DdAjh77n9YiqHRnNld\ntahS7/jdpMPxHo8oZJB+pfgr/wzonr/jJ2ORSIZ50h9ksjjCrabcnxjEHqXI\n/+PklU9dl5vFm61DYZEI9aCEOVbFArE9pbyT2uogmOfZCedhc0mDlq0bWSZx\nAYBvgBzOK+eymb1oc8d5WMnLAy27okUL0i9U6CgbXmga/H51fbb9FAGUGYAz\nUH4y3r6239tQ/wjhHiLkfPqgqeY042/vGOb3icej4VPI/qGvJqQrD36EdFDY\nC8/wXFt46OuxcPesG0J3YRzg3HF8UssbJvVTnDbkrNMdRmNW6NRmvJ4DaeAS\nOfJfY7qauhzJ9m+PGfWzyDpNTwpsSbWHryaZNt62lhQLfri7eYLxT8YE0uIK\neCeo\r\n=2kB/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICCy/XDT2RVBBauZnHtn+8f8UMwUtrSH9OttpUGlDa/3AiEAy2pIQ6p2DWUpNN9ZBySiCFdA98eoLEJshSwABoFDU0M="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.0e612a58_1545634586786_0.29746077208115373"},"_hasShrinkwrap":false},"0.16.0-alpha.3e8007ff":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.3e8007ff","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.3e8007ff","dist":{"shasum":"06a8ebeb26b3105b28395e9749d23abf3c3f0e5f","integrity":"sha512-0mRam02VPomiNJwbPdj3KLziKHuD9v2Hn30flzYFHPupB2IXQGneTl91Y1XT7THSP2+zvCrwc+sNHlU2UIkOVw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.3e8007ff.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcIIMlCRA9TVsSAnZWagAALOEP/jbh3XX5TP8Qi8KTijMU\nvN7YCVDXRRbUPubU+aCmTPiFoNj2OESOuB5QjOMpovkN/8BDKRbLBzr64R37\nu2i3JSbeMbGKADq3QW35FJaiFF2VBCiOB47r2hRPgYnnspQYge5XJtJfmiG2\nhzjlTQn488tJaT+o0DHh295/9DPcss+OnO53mevtOg+1/jkKAKwmk1HnHIlC\n/JiFzhqnhOg1hOq9lhM/cysWodvxUygoZqtGPwVaHhc6DQ9RhehnsLak4X8s\nld35D47VGlnphT7at2BW+hhk1aPGCgCJ52jxNixsOkh92M6tpNir/pQUXntT\nVkiPjDOVYmHQ0jz7I+HmhObWWYcdv/Fk9lg0d7bztWV1rDWNecom5djBiOi+\net14nu2PYU0cQEPAMLGYF6pmBQD5tsDTodbMDvmbFWt2fwM6DrEdFU9mLQn1\naYdP6nL3SdpXc3U0h1lRM777gqfvph1t/HR/sOkG7JYtGIoerTxTnOZLqWZS\nOhSPr6Oy8SDot7pIiDD9XIDtDsLsjgOXC4IUCqRk8eOVPveaZoxk/cb4qWOh\nbSBJC2QUT7fbj10UQnzGgrek91BsXWNdSgLjWArSvwK/NdjFeHiM+D0z7ZhP\naq3sBV2JR9h7iaNJuJL7Zu8mTtHsiy/1pay18KzoAqiPWmnW4onfhEEXFzQv\nTCW+\r\n=+cZw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnCx8SEM6XKjP23Q9WS6LrzHjuuFVR+ZcQylcIy6LbsQIgcih5kMnh+WfIL+xkSdC+xtVUp7cjliVIHcVpExS/G9w="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.3e8007ff_1545634596631_0.36708436955191837"},"_hasShrinkwrap":false},"0.16.0-alpha.40671fa1":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.40671fa1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.40671fa1","dist":{"shasum":"53c14a3a0c568b9f442df570b86952767bbdb825","integrity":"sha512-iWZE/hzo2vdCHrEAVZJZ2Nof4G19BSUbyeJJ4xVprC4hJ2zV/YPWu3jBLn+vJtNM85M7/k6XtwKsg/hNccblsw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.40671fa1.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcIIM1CRA9TVsSAnZWagAAepkP/j2CcENyNLRvzJlhU5x3\nuanVsumIRcp9SlYrN1vapWm2plAChIhCbFH1GE41jXgxsiaC3TpUJECAIDtj\nHPuZ5X4MPcor6lyzUA+RTYEMR75t1uYmYZIfnz0gA5aCkGsyeHmVHdBNwWUi\nfO11ZXgf2xIYtLSsIyC1jRlYv88BAHLL2gX44Zv/lNmOEAg3qH0bDOvU5qZL\nfv69Y48RtASnA64mOHtHNnA6gPl27MhHA9UzaOkSWwzqD+ZFDG62Z1+VEAKh\nIYX2vAT59AUFl9yCNS0yTPNxln7Bgh5uvevBHWkZLi9kNk3OE55w0gZ3pByE\nkoDpjnRfl751dOd4DEoeuVOOUsBQATgxzP5NbVDh3TD12i5r0YIWG8FzivP+\nys2gyhbmhFVpFiNjHdxBElHRpjSMQdD6sK/cwPL3yLIjRsdJZVRECb5y2JnG\nDoOw2OajRExDzr4toQ4Ieec3YfCDGAo/td5IUnl7J1u8627aTQm0ZtSHDdZg\nN2jsuE0POecBsfdPAuSB82v1RgRxvdk1XgMKBjeLKzZK8im34PeHj9FLt6Ws\nK1vhWQ8/5XwdbRkEKpdjMEYKXOcxGGphw+p8ruo2qKyfxSaLf496kJNEwZU2\nYnOj1S8+k/CxImyFHOPsBmOKVpaJb27APykJJUO9F1BCnaMVRinYHqyiPWTD\nyyPI\r\n=xfK+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqHLjX89RKEQLXPbqVK/IoP2zDYdfAPgtULaF54f1pfgIhALq+9Lz8sC7RhpJaBBomEF8hT6LC9gQ2d7QMiOJrMfog"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.40671fa1_1545634613072_0.1693364846079679"},"_hasShrinkwrap":false},"0.16.0-alpha.2c468918":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.2c468918","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.2c468918","dist":{"shasum":"26e62acd42d0038b156db4e983587d1d453da4f6","integrity":"sha512-FVh8TNU4P25BHXWc1M437bEdAy+fHJeOXNxxuS9NfQIVaN4mL0UijsniMg87q9hKVu4GbgJvB2xvRXkIAJw8Qg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.2c468918.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcIINGCRA9TVsSAnZWagAARfkP/jobxwIFKYPILPkT3UbS\nSB5LpTNQHqYr1+EMGYgD1/ZPg+50vuFp16ccR8T5kvM6f3Qi+dVGl5Uqigpy\nEeCuR8aBgc5d6+oJ3ZFzdEywXvl2ln4hjN4iChKoXgg2pwgm1Vb/tUV3Tr3d\nqcJtWJFtcaJF8mqG2ocHrzQjFEtsRPMJThJ2mDLsGyX25kSQ1Z4+GheysezN\nogTyUjQPHZb1q5RE05TgPW2fOKmIp2sIMvvqYGmC+IjtFalkO5JDkJn87Fvm\nyej8CZM31y5JOdcjrqwgsbu1jRGD7u7Abqno+q4c56LscM0gs54GZpe5HLnH\n3RShpXgl6/8sDo4h+V78dtHcVzXKeb7XVlf5ZEX4XQ2Sb9eDd0Vtifkiv9II\n9px8qO1ImPOEHdmyXWH2x7upy4koj1wQIOaMzJEx+okfL/5rin6b8JCgsLMJ\nL6pZ2F8iWVy9DsuwaDJpJOqY5/mnamhKgcvmnhxL74HsgMfsQclwNAHIubqH\nRKRuhpjEz/zjxhYBB6xWxZkdOjqdqKJCe4r3aF7P/Wh7DpFNsuXA2aWV99jo\nQgK00dzbhPEJ1pfPL30HW4JPqiFYGTZgCXOWeixb0oGqWVdTjQgTcc8rx4wO\noJ3OoWxc0TI9NWwwHQyrr0TXJ66ZvpQ+1kNJCwgVKWkjy7NibOlxEwM3tLDX\nxqrn\r\n=tOWS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEeVuZMUJAFHZYUsgqnXbWeZBFl5LCnhR+nOjkPZ+qDBAiEAnE6UIiXEejulCsCVhdpgN//NPRQ4bD7g/BEVzNAquu0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.2c468918_1545634629779_0.3353554239903582"},"_hasShrinkwrap":false},"0.16.0-alpha.545a6622":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.545a6622","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.545a6622","dist":{"shasum":"4141c7c718817520c941f5008824fb6c7a53ffd0","integrity":"sha512-btUdAphbb50GzCe/nHew31EC6yLJp5AGZ9T7HVMBZz8za4v7WZQcaDoEecJlk30qDySKghbtDgw39ONT5lh2iA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.545a6622.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcIIQxCRA9TVsSAnZWagAAAxsP/1ct9Q3KV6v3scHJ+D1v\n3l+2fxJKTDPNAFBI6dr2XGFzSJJKQG3vKgITQZ37AmuC63D5ThpPLsuM/Wrq\nODxGMGFBEOo6sZQiXlL65bkcAE91kMtf5i9qJeHaEJqqJBw4WivV6YRrExH5\nOi177QnsyC8hTCCt98Ok6akz9uVJg6wcJ6cio1jszj6f4/bA9SHmNphLjF5U\n/ScGpTiydnhMij8uqMbSH+TRlqqbV1OANeDjYA2jy/rUA1UrGCxru2FOYckE\nwD7TdNo/Yi+C2VZsE29ZBpUgqe0ykXJ5oPNR71wBu9TodFiC5PttzGpV7YDs\nDeCOp8sJhfhOENDC/2bMhvJhCZ9zbeWucE6ESuiNLkiP1AJywOksJMrdZWZi\nxtvPpEXgURvLkuQV566WzVp2cAUE1bSXOeFQCG29pfsnjdZrLAt6qLIT7uYf\nMJHj+X/gn3OW0SXQGyxGXw7FJZ4j9fZ2Bbrn2ovmUPPA9SjuWv9Sm6vajgt7\nzxn7XZVsPzpDsTe9e88FVZ1Fa3XlXo21KKzgCEUFqnwkF4RS5j7/D4RhzXlx\nSzQOWiFC51BlV3anCOvY3+egnC8XzTQGuD/kYlRc1cysJuiQtE3iBPMqs/qR\nOit7kMxwHQxEK9SLWpP9UvvMPRgBIP25UohXtUwnJxgaaJaPQAsnqVSvqDhn\nG0Rt\r\n=xXK9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDwxJdd5FKwRXTQODxA3iU2xEo0AIMfwdWGWNIfRcn+RAiB4aoTih2hePM6q00nChJZKkPX0iFZoBUrAKn9eJgZJWw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.545a6622_1545634864828_0.08740742218595976"},"_hasShrinkwrap":false},"0.16.0-alpha.27d2b878":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.27d2b878","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.27d2b878","dist":{"shasum":"d029a42515e0c76613ebe0a13778f2b45c371796","integrity":"sha512-HmwNndEz80D1LxxqgtVqpMbDyyG59owXuEM3H5l0PYlJN+Gnz0LxG0KsNe5DIAG53JgQB4XDUkSvZl7YKttWKA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.27d2b878.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcIMHtCRA9TVsSAnZWagAAVBoQAI/PNMHysIDnJSknM6Cp\nmKeqdN77IrxkoSLnHHkD/wCVKx3HnyKmMiCb9a+hk2cdydsjRuOcd9vvV4J7\nxRt0DNCpEhjmld37SpUfaa3ltVuwpUW4ZEwGRcep7hGtFO/z2fW4YSLa6D9H\nrnyrsV9vYL5GoZbz9Miqp9zjadyIvXOD9GwdwImnUyXc/ErJlSeDM6NlYeDP\nqQvHphBup9hQrXIl8r2GITrslO7UMVertu9z4ZnEUwHxP8R90ltVVEt1HJBc\nMbWWsk1zYmZqPGKlcvaSzuPA2DGhZwckWzCqTW9OgJfmWmlZOPOskRhoAGzO\nqeoozY8xm5rRi4zMqh6VMAJw4bDZaTgZm1qVfJmsFlGuycW0Z8qHS9sp3LBB\nIwrXDXp7s4d/8MrKXDuoR8mx1gpBaUESn1YX2nRpCYF8gLcpkP22lMKAG2je\nHPxHTjI2GW5rn/8rONjkgwEL7lDbBoXTsOso7jQcEKkC4cIMynrP/mo8BRlz\nJtdbQfPhlrFuWFF+j4PUmYrg8tQJKDjz0xd/387a1sVIu5V208O57y1Ps+7S\nzikH30OqEfDiBIOe9gfcQfblhoAV28NOPfAKJBti9u5WIC9NtrJQWsYKTdYi\n7IGHwqFOVKnIQnvy42zqhNjaRxtMF5xmeYw3d4PIx0wI9DZ4wTQSmrx6koN+\nI01d\r\n=qO5o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFrbnU845/vDQGIYRHx3Pt1dFGhrgH6leUX1bLQQKS5xAiEA3TKMzeiJ+fIHD2676VfNZXfEwaqRUmoP+/K0TTf2vlI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.27d2b878_1545650669055_0.4300590740629362"},"_hasShrinkwrap":false},"0.16.0-alpha.2c8976da":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.2c8976da","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.2c8976da","dist":{"shasum":"7356ce99810fafb2c0bf8332688c36ce03787651","integrity":"sha512-L5iHSzPROpPLkH8miSgd1MhCef05o8XBCPIoW1+O3D9PGsYdjNpU9PrYyYwiBYR+2Ka5Hq4CO/fwuWGJZ7L5ng==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.2c8976da.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcIMaDCRA9TVsSAnZWagAAWm8P/A2EwNiHsBh7j62tK8aI\nhI8JcKS/cN6A9kacjFn7dVC4Nrh5Po+DuCPFdElWvRSnIi742iWOTi4w/NJ+\nANp9/86PeowmfS2OVV2+6LKt2dQN+/0UyhvtkAPQH0hYDelvWg252qFsZCvt\nbgeRa3hyxCDQHu5HV6olnXH6XOwPvouMtYPJynLk7ww5KupNlyWOv7xN9K1U\nhcJNANWBBmvAhvBXV4sFoO/+AVvbSmlGgdIF6a8/ayt3sWtLAJP7bcHh0izt\ndyRh0lDAA6QPORM+wNwb79UMbLd9Nf3GaRU/0n086rvafouO4x/K+1qSeIZl\n7WmNk3EHcEc7ADjgqOKtGBCk/2vVPbnRrcwUh1TM46xsqWPahPPGa7/FxcXG\nbuL9ImqSQA1txGbT1DAR7z/GPN7vnD6wO6In+fVk4zYsoNLvdJdo7bDAgN/J\nchS2HRk1sU+S9VcCMMWHB8vyPS8eXdCSSPc/6ffF717yqzh46mULcL9sIo+T\nOnF1ofiRdFUNArWQzgKsz8a3dtJWGOqVUWDNJaGn+GnIB4uMf1kq4Ke7qIO3\nM94D0XAk3CUbbcItRXXMMx2ctOYhsPL//pYuucWQQdauyFxtlLCOgKy/iAQj\nUjEUt1D1uFLNepSGlNUlo53ZJf2Z1xmZvLWIxyEFZW3l5bIaGLFqTqSWcbJ0\ndsYB\r\n=7xhi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdxu3XBGMGLd0QeT92n+xpM8TSbW3GrNL4VnZRpDXHKgIgIXpwqEqDwwV3cbD1+8l5cBQylWmwKMEblWO5btLI5CA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.2c8976da_1545651843065_0.5786875957860518"},"_hasShrinkwrap":false},"0.16.0-alpha.e65d7574":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.e65d7574","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.e65d7574","dist":{"shasum":"9d0e9d05770db09ee5dfa703c5ced95b7c754c88","integrity":"sha512-UaV3c0pKtxu5kNX2OnYRxWz/zlLQhwbtErB45EEXl8CX6PtT3VVfJs/BeH3BLRPaNga0zfXluYYa+v1sj4KStg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.e65d7574.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcIMpyCRA9TVsSAnZWagAA3IgP/26+wR3TzKb61dGD9/Qw\nny0gO8zBUBPcTPyyP4606fZWw9D8FoM9QZZDg+EyHFOWcBTrb/ZY6qUTkUyR\ny6ac2ZrAfj9irB/t76MpwHSZVKjyPUr1MDRoPZfPWu5dHD6Tb/4aI/z6lMOg\nOm/e42Frk7K+e/EAwABn3y2F1yo+0MLTDlSaMJNOyI3xIgYJyM9nLUe4e/wt\nzwG5MJXt7HRxW9HxtbR4cUl8zRGIqqFx/OsQaiRhLsbrDrKYfAyKc2CaS/aJ\n3ClP1/IzTG3S9jEyTVxRYhrJONfYGkqg1Sd+hLN/MFi3QULYvHuq0Zc1+UFt\nUlDXm/6vTJKP/X1AXKb+ByKGpT71YodkjwUyFSYisAEA80abEhE6Uj5Rc9/m\nkHMDcBONgtAoqzOegnZuJ0whoUlCxB1ZqW/ZpqExhu/XW0Bd26zL39B/Pt9e\nxPgWPGG4xqbaa6bNPIC7/Ns7daWkyr6Wkf7URI2QUnQ2HYr2Lu5PxNgPafRg\nHMNlwbf+8yrbb3DKJwRKqrD9ph84U1SsoZV8nxFI0uLiny74AdZUFW5YYXo5\nJIociZ68HIzlSzgR52CEtgC5gzeILYBCSrwJSsVzgafeiO4bwu04T9dZtFSJ\nLEG1csJrUYEU9/vsfR91yV6IMkZvc/kxqdn27nXsi1EedOBERuRF1BVY7szo\nt1WL\r\n=LpK3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFT34aooBIGt/temjKq7eC/FSK0PuCZZ69+0Y35n98QEAiBvpS3TP6cF0WbVgRoyMBOaDGVZcPqR4E4EorrGArdSHQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.e65d7574_1545652850126_0.2670247663678009"},"_hasShrinkwrap":false},"0.16.0-alpha.6beb3759":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.6beb3759","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.6beb3759","dist":{"shasum":"d31eba4279b4250031a096c9c7fa6027787ed41f","integrity":"sha512-YwQ0T1rzkYtMNwJNO6u49f0IMX0xv8UnXGIKiHBNqmYmlJyIgX0v171Bn59vAsx8xonZxLEhyY1073Omhb8xAQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.6beb3759.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcIMthCRA9TVsSAnZWagAArsIQAJGv32Mry5nBZR4Slhk5\ncSPHWTGFJAzo6xX6sOa4qHIuekql20duDPIdoCXjyEwiZbDI2IAIFxY/s3NC\nfi65a+0hl0AqlTBywchYMlr4d03xFeuJ858QM8MyZlu3AyhtRFqxtBO6bZCl\nB8VCU6TIohTbDdZ1T0IylSmf/RbZHw3FdK5TCTo/Xq3VUTZPrgBFbRk7kqyY\niGEWWKQplLR4mg5YQwIBpJRyjsWhoFmL9LonsaT3eSOYkui0KNSnwegvWgHw\nx7yJ8LMYk5jRq6p72wdlgJBl4oOqWFm4ycYSa4/Ia2KxcO7240Me38Rwgvov\n8Knwuu0Vel0UlUWscjKJFkYsJschFLJhj+5/vk4QR/YeDOUwDodQEud48vEO\nnFCwPK0otdVl+fSInuK72VJ5lFfcEa0uQA6jDqYMMOj/67Ukk1+pdxluihXk\nzLCuTik86VybbMlIHOlcRxZ+zZsVD81mmEU67zpe8EtsLwY1w5bK/nT/vhZE\ncGpLugxvfG/ImlBSN7msGdhNgYLoCR5DYMA5K19yhShBIY6Ortu58K7R9vRg\ntlo0AZg9zggmh79SfvJose0W2q0/fuPWJsXgfsbSMgOD1vtLmKbhIXgmF0ni\nDfKy+bAzup27NxTEDq2D72oV2ra1d+DWtyYKovwVvSOgp5ECDTwP3qt75tY/\nON12\r\n=ne85\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9ZV2j6zhM49cKXcxAamLX6a9beCWwcwwqnmNf/rZYPgIgP6uG6Z95RWKOJ3i+46pMH2he4NyJhmfR6zJIpBVgWN8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.6beb3759_1545653088435_0.5618582595975068"},"_hasShrinkwrap":false},"0.16.0-alpha.ee61329d":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.ee61329d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.ee61329d","dist":{"shasum":"9a3ec73c4b36713fd68283b0676dbce94d79b5fe","integrity":"sha512-Hze4R9JLeTStQglO1vVWMKFE2ADt6JABitiH0a+JO4HcYLt8SwP4p2aUPs7u6bcssvfIkUtU423mV/KcUtbFAg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.ee61329d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcINATCRA9TVsSAnZWagAAh0MP+QHjG00FUNLzXkdLRbY/\nANJ8zHDhJR/tlL7wNp/Dog7TJXqM9kx4/k8fRbhw9gFOF1svt8iusk+wsqFx\nbdJ8kqHpc5v0JSiZWGU6HykxR7RiozZRVzx1xxJ/3NTut/vQewBVN/sqefO5\nWjMevlFzrsCoeU2yshnteiY5uQLUuSk6HZzn947zRNXJbA7FnM5M/Lrr4DYQ\nNLQGXCDpdAlmfRTpJOjG7wuvAFEO3fHL+X1yng62oRM+LKv2BlJ25yYg2Sji\nP4N3Ui7iInE7kL9bj7hOQNNaTTdYSP2RM0dJhy1KZbJNFJGNWUkbs/kvl5Or\nKg2pFB0mnyxbyLjNNJxlpdMuhE7honqVnNllzxAcC9yBV1jyd5m4KoR5yVFH\nq2P2ESVswtcWthayEPLPe/CjKDxxTtmJZU95jVAd/fVLAyTgGkxh7dWhj3VG\n454dw7BSuV7uv998BmjIGTFY8R/yU6wh3UDQCQlYYFTpTgA1vuVwfmUg6fXW\nxk11PtUXUwptyBICufyLCuerVY3G19ESjOtORjS/TJNjZwa0PSDlGMcAIv7O\njYl/vDmYfDG/N650NLIwy0Qab0vPcSZuDaW51yewGyYtZULk2e9jlnSgaTEU\n0NvfeDYtf/yu7w8fVRn7hsoIw61mK4LeHkmwgHuJew/cisXUF5gImX8HjvtK\nuR8d\r\n=J9Ul\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE8/8HeRLr3prnAoWCKbOEvC2+j6tu9JNfeUI+IEUkvqAiEAsWLYf/v91gN9YBztARnZ6Zn/TDDYEYsaU/yNlIo1jQg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.ee61329d_1545654291149_0.6847768090682842"},"_hasShrinkwrap":false},"0.16.0-alpha.22d89977":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.22d89977","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.22d89977","dist":{"shasum":"32ca6b84aa5ad864388cdec1f158ba2ba8f63aae","integrity":"sha512-pdTQzic7v8DNF33H/FdVqRT8eWzettRDbFZM/p/ho8JMb78gDq80YIyJP10kZY+lX21xHsqS4BUnIjhXaMkdUg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.22d89977.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcINXrCRA9TVsSAnZWagAAdkMQAJNOctmcT1GFqttt3KU0\nOUtrXp1SC3SbPayAaPdpdx/i4P01jiLGU2aynhQnL5ETeR7cY9BoEByAHGpV\n87MqslRP5YknjsAqPZwdui2KNfc/u3fM9qk1bqHCoeZopeqgdpVXho6Bzcy/\nUnZIT8U3asXrJRPM07cbdW+mtvzLSyKPEmjyQ5AiToD5LjjPfGjwp9mNco4p\nOVF5docLCywRCwsQQFNP/5D7nSy8WKWijkvAkh/RkfmK1/bz/NhC3d6+SnhV\n0krW5IPL7dqu9+y5bmkZON15UbRQapdec1DVTcDtwSB/UZvu77CvFlmSGZWY\n9abPLLBwQYOOxxKsjBaPAxlKGWJn1QuNtFXhyFGR2oiNF1Ocanju94LHDj91\nwvEUZhM4MncL7J82EAuSMcB+Iopprsl4aRCvSACWnXd7YTofYNsbNzsn7mbb\ntG6gofGb/j3TYGIv9pyE8+5/2LDNpEiPFX2poNZy7Kcx0XgJaPR+gBRZPfO5\n+F2mWHRTUrIRFrTYLhTyiAsgp6XeUdN82J9Bxbefb/1+OeiM8JcW7SfVUBog\n4QAuIIKLGYCxZi2rZd3g/lXoeTWChsDIEX69tFX6iaXeQmIVcM2t31sOLp9g\nuxIwtZ1TR7XaZAvwlJbon1d8X//krK+hguN8XMjZi6B5TTaiecLw79olUXi+\nlj9Y\r\n=j1jI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAVcmZ3IjpYlAEfppBhRGqiKNSd3vHvfGeSNAZOdU2zLAiBfZwYvm86u3T74OzEUDHYE8eZFN5WJ94ONUGUOtEJksg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.22d89977_1545655786745_0.36694446702858774"},"_hasShrinkwrap":false},"0.16.0-alpha.a9b4b106":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.a9b4b106","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.a9b4b106","dist":{"shasum":"60bad41d97f3f737d83c2d5518f073912e9d775c","integrity":"sha512-jYzXMjmw+7LJeSY9hzjgY4gWoB0siqIc31G/zs2PGW+z5LdtP1G9urLj99lSvI2gryPdnUqlzZIJxFabla/fsw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.a9b4b106.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcINiqCRA9TVsSAnZWagAA7xEP/0IW6A3xh9gNc9OvarNN\nhwV2ysuUMHwjt7X021X2Y4cpa2MOXXjRKKqR9rUSddPOYmHqQ6yQsRfdHnny\n8OKFCa3xSsC/W8aib8BELy1D1thNEg7xSc0M3kEcwnFI6dOcIUFxEHEHaK08\n5gCV9a4Kb2f9j3oSJbD61bUmQyPgcKscwQpdjYWHrNtEAtXuAgiTXiVS7YE+\n9lIjildixC+vILhn5N6aQFN8Nmu3cAVQuZ7FqBQpPkBkcDzTqcG4PU6y0QhP\n1LwcjdzWzJ5lOQRONuCqYkUY0LxAs18+E0jqpXMc8yRtzVthdTe8WPW79kRk\nnhKFFju5qt8mwDvxfLvn5HgcrkcSlRy5vGdWObZXqvPHwK4cYPyeVPm2a2gx\nyNFASoK9S7NFFfv1PVhFZFMdKZHLUGqPXE8eYMQRL5Y9h4o5cjx/cEBr7VT7\nFsY58u+l0PVeixt3bw9bV28nypoSxV+VrHO6oMeERnYuWJaSdC/elK1fsynu\nyHUoaAXTkLTpj1Df1Ey9sF8Orqz4dudFqDeNiXq3RLSxqXDDgz0EsPCrkp9e\naqy7iuCwfrcDYXillvsXpJ68aVIur3SLk10Ps+oZmdoX5wjCxAdd9GCtMoYW\nKuoqTYvWN2rNQDaV6a3XERqEYfKnqGjeYRmzJFeQbs/cRsRw8nZAqS+dEW7X\nBpvv\r\n=1puD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH8Fcu/BgQU/3HQ9EvxVCIIu1ACd+AarF0PNg57wi9iuAiBLTXjGXwO7MMsrWemisTNBLCqPweCdt6P1oiZmI00Ctg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.a9b4b106_1545656490283_0.5431171869582985"},"_hasShrinkwrap":false},"0.15.2":{"name":"codegen-templates-scripts","version":"0.15.2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.15.2","dist":{"shasum":"14c086bff9b80b3bc5d7a01ab0792dc75fca8137","integrity":"sha512-C5GkV2j9e9dHj+EKGIm2Xxzxfi+9r2yl/T3TIPrwZa7SBG7N3cBJuV1vO3L415IREZckJ4GkvVJC/IM+cDyVsw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.15.2.tgz","fileCount":22,"unpackedSize":16711,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcINv5CRA9TVsSAnZWagAARbAP/itRIVCxDUXCtt93JD3u\nmeDSokK3ypKOw95WgCR+LOVuONFvwlmXJqZnxYHh+/C0n7kcEGiatvq+M/Tf\nZxsxt+HXFQDuKR5uJHsXtCp7pIBr3pRqS2SxR1d/enjNkUBWfempCtb8xm4l\nQnISnsQxmbUKUoe2B3PASBI8S/ua4qqZNwd3RnvAguEUvjAN3jwUpyXmzSNV\n0/y8tkOVvjxGYViV/wqNSk3wWrvIp4c3V9tT9cyaELQwORwyWWRAtrnD8JQE\nSutOd4wq3pxI4xdxGVqGZ5l292MzxtPbtQNBSylYLSkFr38tHZCXsaGuaPv7\n4Q/4f2Yt7nCu3gR6nRfE1KKGu85hT0NMne/nb5lf52LPwJUnUbtBt40sjHI8\nDAm2U2NIjvs4uVH4+Xl1LOVSXFyyVrIO0pEAYEGFvAYmsF7b9RRL99jB5QLB\nXVwiWTnV9m3M6HZ7kX14/MQtBLtXHU9eaWY8HBNm4dfMWFulW4L24NcH7KPb\npccuJOvb6y5V4tE6OdLgyYwOZP3m0UBZajDOpLTs4aQP1b7FlXEf2GW12QbU\nZNQFUX5RGm/2jOz0fO7BGkpB37SlqyRFtvvsNXCSEYcbL7UxxZ7I/dFrK5Og\neQcPGxsTr7X/Ovb8hizW6btvFePiKLUiIJZQDN/8NSFS/3ZTyOMrFihUa0B9\nR7Jx\r\n=tyjr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnqUVFNm6UJqSTYP91B0S+a7PtzTXU66USbgxGjGAOfgIhAMkYy9hAzWbWwwrsnlaJSlJMRMypfJmBhiGBOZubkbjB"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.15.2_1545657336371_0.6783599076581033"},"_hasShrinkwrap":false},"0.16.0-alpha.7154c52e":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.7154c52e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.7154c52e","dist":{"shasum":"9fa8cf18811c2fc64c41833b24cad585818bc4fb","integrity":"sha512-Nx2wMXoYbaZWG+F3129oTPV3ra01ZOD3kc/ygO6cK7NTBEM2pInzkFwZArPyu8AQSVggW5TcgUw0ARUlFvub4Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.7154c52e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcINz1CRA9TVsSAnZWagAAH6gP/jKcnmMYwGmWmELLP172\nq+qkM/Qx0AwwV0RwJMh1SVoBy6CaZeaEXQeTCyVdql4snJvlxFfDNJAvkwhs\n3HQMDEHigmG1aOvIQA5uLn9ZtXwMJSA1shcLvRLGjlFD7GspYj6xmAp599WO\n7yBq+4gT+5mFLOiaBfvvIXgIt80OgonIo2C4L/v9TBibS7kVaGJN8/jewSlk\nrfPahT4slfExLr+0mNaNSl/b58Ivd3k1HJDaaWJ/FWQfPqY9NZETYIRGtZaG\nSvCvqPV83kIc1Iv+h9tq8F60qJYwlplsUz8CveVhDL0quXr7EvWRIcTRKCRz\n1quEcEbBuTOuWaLbkN5n8ngbAbvi8NKjLBpu1JGAi/ToryAd6I2FR50S4/mK\nb/VyJRoE4UWo7Db0etJRQKrSqHrpeNizGD+y/RxHrWq6TttcUcHoCu6lK9j+\ntcTkWUeZ8HLWzguq2Yfo4HDTHhPXg/R3kl+CaXswtTm3wTE5myG32Eg5Dh6N\ngQV6QvmC+BKq6D6Q2/lu+iH8WnCNfXqRuollUiOxavLiyUXAG5cUl6YnzULj\nPmW2BYx2YK1YyrqLgL9xrzy4knSz57r6n4YfsyOcRtKdWbymxl/lDLIK3LFb\ntrroKjNT2XX4I1ANeuf4Qey6qVFVKYT/OioS/sc+s8kYYZwN3dXCVsOLVTB9\nVoJC\r\n=zy6K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH70KZNCu2zPRGnYvNY6IOIjwtujg7jSwf2k5umRteeTAiBVg1DIX8U9u1brCOxkdQXIA/fwPbpllBKI3aKMX9o+Pw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.7154c52e_1545657589000_0.5575691936489242"},"_hasShrinkwrap":false},"0.16.0-alpha.55fec510":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.55fec510","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.55fec510","dist":{"shasum":"aad6b86ed458aaaf7306e19db492fd599e55bc48","integrity":"sha512-HD7srwBc8GlCQdWHjLN7KR0MEHkWbQ8QbgP/lWJXppABO9lX5R/nHjqtDu1HJoKT/G76K37PT8MxxPezilCQ4w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.55fec510.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJP1ACRA9TVsSAnZWagAAXoUQAJ5RHlkYXzeWIbtpA59E\nS1fpJykAcIgK7nT1G+CJ4//2XrS8PzwUAlvRffdvZcM6fjfADCdhkqPNj4M+\nUcyGfQO9T4yhU+1ASnckIMKp+/7vLTD4nk95acnwKqzw/wnlrSfMu1sLwLwA\n663IqvZCco6oxdyH6L6oYpSr6wGZPNRD3P1KyT6GskyJFfb5YNFkfA0PYhFK\nmU93Bp9Nc1btppcwNNf6wTrzrCszET7Q556CocF9ARiQpRhdaQIHfGO64r4q\nxvJ82mtfYXX4zh972jDUTYAfcr9/4fz0Uetkv3VxgBQYjcM4yNyI6LcXmLXk\nAA7zPL4ForvXzwQr5qzqmAgHdesTT/tq8Eh/3odCKrBWWzWHedJox35lYYez\n7bHc8o9+Tr52vHPWmOcDcamsSXXPfgZ8lsZ0gQsU7AUS9x6KlGwtiKIbVhp2\nfysTdpJwMDUflaWGP275wyAlncSRaWVXddXqYlTVg+g15BlR0U6/7TpUYZGH\nUy0Hwj4/z43ttv9GjUoM17LERyFNy1WmcgvXHqU7Lv2YBxRZjw4SSm0AY3oD\nJfCiX+jGYPR1JJViO0MhtcR9kjpOxKmX8YR3N+Bu9Y1NnvMZL32tDSmP2l1/\ni8Gt+gWo47XQ3SRRCaEt+rwDjNvOEzWZPobOpoFjxy081k52xEPgruoW0/cz\nbdLg\r\n=7ncF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG5GwPaBGn/5hVuRlAEI989UrzJVecJg6GLcYWid3BZaAiBB0gI2ufLBODO3MSLkI11clfR+3O7HVaWw+UwNXyr6+w=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.55fec510_1545927999530_0.9871716193527316"},"_hasShrinkwrap":false},"0.16.0-alpha.5cbd12db":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.5cbd12db","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.5cbd12db","dist":{"shasum":"7ecd87485c98af57c01f675746279aea2c049286","integrity":"sha512-VpqR5XZ0XjE5zaAk/Fi+7PcosBb9b2EhWcgXCJKCm8IlWwjavIR+OP7IQZmxGKJR3pKRhT9OoiCvr0aUfKVEOg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.5cbd12db.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJQ9uCRA9TVsSAnZWagAAwxUP/0ErNbpToEomyzzB60Jy\nnmvyHwmZDMmcl/P3WRVCUoxCXHoDOnnfLDB+BLwTi+P4DMOsh6zSvz1hR6DM\nUVyLaxkpc8LNyi90UHuNSfNqodyXykXT/Hqm5nTmA9jN/9Rwf0pKeKYAX0HG\n8DErS1oFg0jQMeag2b0K5V/DA0PRK2rfwI8Xy+UwA6Lvlbwbx8l0aSZrI3CL\n+yTySkb7A4kiL0ZrBIwvlItz6WRTy7NdltpOFfyfOh6KdpXoYkocUw3swD54\ntMMbMdXub6urAO74hedFEGvHZVqcLcZP+pNPTQqg/5/laNgnxua5bvLeTH7A\nc6VcAUQIdtu+YMISHK5NTZ4adIfqPGljMciA1lhnveOqJjqf6V/iNdqFedRl\nwzYStvCybQ0IeBe6V8JlwVBp6ZJ4P/wQ0WGRHBNgq2++FGu8rrAUqZipOD06\ni0ozFZdE4pjmmOT9KS5jdgwi8YIY9bc8/yZKFpfJVPwb8lluTQbRnWj+u0nD\nyoWN5/nwbJAEL5uMbpWREoNXNDSDS6ugG1MBKYC30XI831CaTIalVDpsrKW3\nIAPRuRI8L/O+QHlMDEmiidfkVaCdPtdZ3WZ9n6fnF+KVSWGn2sRwnLq/fWWc\n2PrAWQf7fUOdC2TOkIg6fGMq18+IBq8YvL4bcNgYtDqxeeoOmdkARYfkDqdd\nRZgn\r\n=wBQl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDqCOXUGDj6XqW/3UKbPMxoJDMKCZtxk+cfQOlUYDD50AiEAhYN/+hJd6x3lN8i7x1pK9ATfWlHXRcLrqMsjPiYilLM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.5cbd12db_1545932654067_0.7532397742445178"},"_hasShrinkwrap":false},"0.16.0-alpha.c1e3d33b":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.c1e3d33b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.1","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.c1e3d33b","dist":{"shasum":"15329a0c2156b81d396dcede79e0ce53183f1de1","integrity":"sha512-EvhJLHBJN2nWhic9NRlfYxItGahBabh7aMcBDgLAefZZmS6bas2jckN1fx6UgpoTWAKJFYESqvkeApD5yot2rQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.c1e3d33b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJSD1CRA9TVsSAnZWagAAIFIP/1eD4D1IWduwVidErcgK\nbwKDNSqZwND8DzSXq5xvKgXpez0sG3vE+WTqgoqfsXP5OtNwmAMFPPVDKGe5\nwVcNL5H6RGornDjp8JLyqvu+rOS30eEl2uhepvPL8x1EcRIuaW5J34nklRGr\nginTSh5PRfFDssb2/+vb4iHisY2HZnLU/MyvqVWDC7ExVNPY7tZ8QfSAp2Gl\nRYo4kLfCciTilVjCYZet/9eglHxFY4JMjvnQP5BLyZOTCRPbrNjEW89qla95\nN8l+FPQJEJCtFPCk1mtx2a2q+6exw3K4IMToVdA0SkkUf/GsWPWkCJS328jA\nvlTwbZRP0rB+FwoB2sn6Cc8RIE+eCO9WPdt++AwDGmO/xl2E8PVuYj25X8L5\nACs0v2MHHmBx57+rJshKR6LsI7vwNJ67/nqQeK+J79munPAKBh8akzZYw51m\nlYaygNWVAMKu2sfOaW0uIk6NLLYyWfVOb4LJPysJIlI7+fmP12lp3L8jHL61\nvkTipHmyyQzy6ESRpBgCRlGQl1IAIJVrTOAoNWK+f8rh2c5fW6CIc4lbVTzn\nSEk4jr4GCAlGS47mHGAZ6Rl/AoPg4vCwGcMA2XRZ4IabRnzGkMP8JqGMrPts\n2gLwAPP4Mf4tuajptoIpvWNpEjBPxNtj5PNRFe8Agpx5bgZ0cHCbR12fu9AV\nXRqe\r\n=3K9x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6YtJqgi56DcmaGOZ/3F1h/QZcKAV+e5FJ2I3n8WH5PwIhAPgglowHB1+1d5crJglolwA4GhIkZvQQlNyd4VcoP5HX"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.c1e3d33b_1545937140630_0.5738951059812909"},"_hasShrinkwrap":false},"0.16.0-alpha.24833839":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.24833839","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.24833839","dist":{"shasum":"7f443f2b25c0213ddcdda6e72587cc727b63bf47","integrity":"sha512-vVr8Wg/XV/4VCf8lZhrDE4E4kfGrVz6fOSrFM+xNs13ASWtkdE+E9HbWmrOFI0uZ/yXdDi3G2Rdh1aDVCBNHdg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.24833839.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJXH6CRA9TVsSAnZWagAAjosP/0n8kfSTLDktzlEMi3mK\n3VrFnV2Y5C5L37/xrUCbs3XgTurh3ACNGGCQQeOlQ+bymClpR2bufOZBKNzs\nkw1sNZ6lnjdlDZt/LvmF/4iqA+3XmsV3MkcYcHo5XCpA5O+XMenrYATgvy6Q\n9QHoy648j7iXg8BAJ3zPfKGz6rzj2Tby0oJX83t0FBiUe3hPWYGMk9WZIZD4\nyme5ZvUiFF6CxvrPkusHwn1OExjUibVAzGxjIP0B7iF7G8pCESOCuh09mKls\nAWMeNrEZUYEUm14TPYHS/nR8aFn4qbBvwUfgrlc3gTFOKsL+jbU1bs5u+Z3A\nviIoH6JD2+yOl19NnBMOdne4banHBy0r7GEraoy81PQPIApix7WEwq/p/uzG\n6h2aluwUBM96JayRn2Du5tqF1ad9Cd0Eiyq+hki1tkiYBjJp4wISZHd+giVG\n+xGVTUSygRx3nvKh0YQFj6VgWTKOVDDUt9qEJMT/yzede71IQQk+GXRFm+ZJ\nWewfLE/RB7/X0DewE43bLPKh1fOffFtCdoQ1uQMkG/Sa1lMP4uxuM1LHQLB2\ngxzV6aASrMcfxsyTkg9D3jHTOZy4fQvVopTqmmx4BJ7lGMoQ4pm1moxWBpDi\nrxsA1ogzcQbCNAiOxjwwO8DpQ9ZO1Nef1PnEaLE3yQeOsH5Erm4fEulGsEN2\n1aSt\r\n=o+/u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWRsteIkuKIFJ/NvtDb1+wTOgZmoMN2ja7s/3ODG9HpwIhAIyOkJqUGjabL0qjszk4znoNT+aFBmZFWLYzMQp2EMPE"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.24833839_1545957881563_0.36502458752091393"},"_hasShrinkwrap":false},"0.16.0-alpha.f90124b7":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.f90124b7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.f90124b7","dist":{"shasum":"1045f01f2732d56a283e69c2362b8080e1255b2b","integrity":"sha512-H6N2IHDh3tY0QLg3bBc6iIMrjCXDtBi/0Xr3aVe3ajqyQQpCSnjesxwUMtkgfKYNBZ2hRcOM1qwihZWtldd0Cg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.f90124b7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJcLgCRA9TVsSAnZWagAAdhkP/2J1CMVRrLTY4VRIG7GY\nORPvpzUpZfzw9QQXSxsj2AaO1kuWPRLYOa4X12HDsC/3vGhz7ILZS69TmrXn\nCqboTYROBhfnyNpLTtv8ltFV3FroLjiUmA/teRPAwpPNw6UFK5iL8d7uJVAW\nlrud9L0E/DyNT3JYh3QQD04/ZUEQ3v6cVhcZ2YWnCrGobkJUI5dcCZPJ29JP\na9ypNqtfr2nueERWpLIpPc9JNp6eymzfVqQJ57iS5/O6G9yNMQJn22X1RZgJ\ndi/pDfhk5sBL+BVd/SrSZleZBr7Q7nsigDLrhLvmH3RTe0kk3tzf9oft+G1+\nEEESL65yrE6JYxR5f3axi5TbGgHBg9KX4wx5xuWmsEjSr8hZReqGx4tmI6fv\nQ/TQFdwQaKNirViQCfetP7qDGQiaTLdp4lU+SxauYZgwjIM9HPQF3D32F1mV\n/PTSrhWlJO2uMIMfQh5m2jwlPkrfsu0W9Dj87y5Ofpzarf28NdZay/M79Lff\nnANnfa/13Ex44auShdyx+cvZ5FVI/8CYerBPiai7tGzFUXYqWBg8O0vXrXyq\nRrTZzLvA9GZixF37YEKehtbosFXZ7+sjPVjc1kGiV8+BEVWFm10z3q34PFPX\nbSiGbuUYutWfrLFfuwVWVHk143j/XGk7TjHTheLWnH0oA4pQRAPuXm00kXL0\n4Jpj\r\n=Bpeq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE0wJHIl+wx09XbYqPfHCoTZfPutrAonjLD+LY6kCSjEAiBkaGHF5uJvzLkvhsPU4IqZwXE3ZqxYQI/8uf2t9qmECA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.f90124b7_1545978591664_0.703971833389005"},"_hasShrinkwrap":false},"0.16.0-alpha.bf94fe7b":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.bf94fe7b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.bf94fe7b","dist":{"shasum":"38d2f1e443f17a6d953200a50450df81ecadb26a","integrity":"sha512-r6joaiGsjpEKwZmqZ2KRpwq2hLVV6wPQp1qoMQNnDeZb1Oh3yo5SogC1pYd9ETFV3x0Ij4x6z6vhqnP2ywbRRw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.bf94fe7b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJf9uCRA9TVsSAnZWagAAti4QAJ7Or+TlGwDKqxdRSQJP\nDL4nRfz81G6gqkpzI8XBmSxpceG9pP4ppT+E1Wjadj+QNEPj8rtIhrme/8mP\nINqTZAfmt4LzUwrt4T+I4yH2ytzyNC0YZMd5mbWxSp9/pgSi86wQdFSC61/F\nNFHtc42L0IN35E9A2iAWXX0fD3i4YIyzb32ohK36czOYWGrnCG22yICO4WTI\nNAsFsYxaNT5H1ZSShnNQD6k8xqqfqeI6BlVgdbA6cQrBf8VS09qQRo9rtuyw\n/y4PD97sVi3fD64DycH59gI+RcoEC4grtprHNPXLA1C4KFdMcuTdrFU/r4rW\nDpxRLjG1BRt+uqNvqQT1gWDa1nSpq2ZuGVuy7mddYj+waArWdT5zpKN6qZPr\nZ8VoweluY7WoUKW39Wl+R11BP5Ln5rgRGX/QGIkzMzCzA+Ul1sQw0L/2ZGBc\n3QfdL0jGav9lUR28kjSt9qNaHDVUxup7b5uuWJnfveAz0aOlIPExjsW5MHjD\nIPe9DHtQdosDWzMzSVozePLlavHZofywDKmcL9EwF5fuffzlgcV4vbsASBRV\n5NgDEzlElERHl62oFmW0joQl2boGutrn0ie+1cCCosx7T9s3ngfMTE3A+6w7\n3P0xey8DEZnFgYGOmluUT/QVNhhVx/eW8uMEhjoP73LEf00eI4k/II/ZElOU\nfB+w\r\n=yZ7O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgFJMES/LoRUPBFHzpvF301xxZ9aTLcwgaSwJp01fggQIhAJdMCNTonNrS8VHUGJNch56ZBZMhyN2zTWm0zJ5+cWyV"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.bf94fe7b_1545994094339_0.6639915954755167"},"_hasShrinkwrap":false},"0.16.0-alpha.e9233982":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.e9233982","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.2","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.e9233982","dist":{"shasum":"b53dcba3c0a7db11d357f709f914371808822832","integrity":"sha512-jUldSWuQnfcNuX8Zg7xVdIS1uGyKh63STd3+jvFfGOhwAEfZk1kcKMYC0jePOZxUGaLgl6d8wr8JD6ejYZSCAw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.e9233982.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJf99CRA9TVsSAnZWagAARfoP/jtpQ6Uh/U3Y4QlMFPC0\nqsHzhlL0aBoBO3COXGrWBPkFqsKD7W+TJWQHjo5NuRpiBuT8zMXBz0ODkpu8\nEE3hHB3ANrIRIZ6CROum4YH6PVoT68+mQmvR03dYEEQ9dpdnKR5aZfooFgm9\ndCFfGgkQrFaQwR+2m4o7rwZHi2BCj5h416kyjJEaR+PJlVAveozM6pRkYzkf\n08Eo/WzK+28nocTj+wCCpnJi4Ac0LDA748k0elQNvbxzg8Z1uy8S6dDUat2V\nQFbhm+WO2y/Z2+svz9o8UqTKIbGe2PMRQmFqnL/JTa1TJsD3QqaNAz8/rJCn\nPiLdexQbxMZS1b4gTUDrKhugfEog55V+7dyyiZee4fgOYCdiAxYQ6j7/Y55E\nzLjCmBOw/QlxzAGX4NaOKSOyy/KE4qQxc2WH6Tk2/HaSiG9jfEaXxeHzt7M2\nmwRpV84CASbSlEGpnhh1VcIUTepoL5uDhunPldtnXLSQw3nT6QD1A+1LtRdU\ngqQFCnisq4mk5iXdsMJfp10AQEF4zY7Q+KsQrT5c2bIN0C56sH8vxS/CSl8H\nH9uiBfz+90cgWwzMuwzIxtdeeOvYfIQjzodYY05omZv6tz5sSfQdSiv285h+\nGQPDR44IQJFP44lrIlHcKA0RXa3rDEKb0wuHT0+LWvBg9PZUpTceLKAo8PcS\nW3LG\r\n=EfoQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBUc5zVYkpLxeV/dgONA3pV8co4RONdVLJCyBCmz912mAiEA5VQ92cNvx+7ZokcwtgXLPbDDliPHFNq0+C8GFG/F23A="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.e9233982_1545994108555_0.32528692986105323"},"_hasShrinkwrap":false},"0.16.0-alpha.a9c142a4":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.a9c142a4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.a9c142a4","dist":{"shasum":"9d1dd028d48733d168e349deedc2285f023dd9bf","integrity":"sha512-Ef96Kra1BIapjWsrdpPPByO9LPuZBm35gHHbkZ3iXzOWuUGJtWHJRwro0mBob71t0FWRXfFF/NXQ0WQ6U1cqoQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.a9c142a4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJ2K4CRA9TVsSAnZWagAAUS8P/2c1bRh1LCwrMmRbUHhC\nIm7ArImXA1mNiNr3r/vLsT8qsc9oa2uq9JN0L6fgcDiAic/TJgQRgI2RZmMI\nEKuvpdL1/JHV7N8a58U6WMcNXmSzulJ+HMlgaRgKqoEqLvlWaA3vLCZWZK2V\nr6+xTCy6dwsWOxx8qNjEY7mD4MsG15hgsgBKWqPyb7IUBTlhfwAHWSi5BS7U\ntlaZeIpjYb5S0LdLri2KKTqHSqy8oeLy1v0OXtqn8Ka8p0CXKduBlkfKynrc\ny2JC7u3CkvR1zBg/dELx7VVpi3vftLdAyYIkLQLQajg51EacfGo6LOOlgbUn\nVe2lZgK3XdusFKrrC7chY1uZ6ueMAnQMuCKAo2cFTscmrxag770HN9EnVh/J\np+ljiYI5AmJ9RcvE2mE7GhfZ2biV43LPYPjHFMGmlK8TGFbJPKbbbreNHYMV\nURX4goukHIN1O92bpNvJ7090rPWt9sANmfxK6GKcl39GFbWs1IFcvLypNK+e\n2Tse8i7pThVvHSlkLex+M+Kak7/5M8zbqBbUCQxllPT85JVWEKSEIY6zT9mF\n94MXmTDqPKgDy898+TkWJowBhodGkFtoqU33VGvr+uhjnlS/9dlvyQV9zt5p\nxddqavcpl4qc1Wz6dCFJPsoxvRrFMY6Bfa5+p0h6YfRjl10AnHFEwZrMznDh\nivcJ\r\n=jo+m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC6HJ7Yf81gm3QmuBlSGBnPb+k/DM50tr6BjMPoqIROAAiAtb/GvcVqCWCzttiLJjBg8bWuXlnclt9HHPsolE24eeA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.a9c142a4_1546085047330_0.10565934188570525"},"_hasShrinkwrap":false},"0.16.0-alpha.ccb46744":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.ccb46744","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.ccb46744","dist":{"shasum":"a0158b87ff12fd8741c578b081180f2ad3cc1e9b","integrity":"sha512-o38BS7IMDPuBz/5SuXk4P4usJIntvEvftwSLpw3ao9I8jRiYqSpav9yO49fpMB2W7gKsCYVkkZ/cWGwn4pYHDg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.ccb46744.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJ2nlCRA9TVsSAnZWagAAdsUP/0vXKdc/XUH7Y5jRUnda\ncUOBzZnRdTZQVKYM9ZU2/CkWbDovTm9Qci2mZeEwj+O8GsEJpAQbf69eAauT\njuvgO7qGsprW5iHsTZoxGs7VWoF8eh05Obaasd0OHPUFkNPfIMig2x6oacXf\ncDL1txjtNfa+3NJsNPUsp3RCSXLRwcA/ICgIUF2sywlos8fqqlP+PXIelyZX\nefQblYv6ljwkLT0T1Dcwy+8yvbNpTA8nT2BerNjKTeyZlPuuMkyS6waH1b5e\nxCtcDnomuvbvezPODCFNMgXrZmHPJxMM3Wl61vf1LY5Fh/ZSoKnwpzRR1JBD\nL9nAyv58YeHj3Mt9D9VYv8VPHj23ixXE0YfKtq7dD4no8Fj8CtWH5M5U5S8Q\nkgsT/8q1bgZQCDX7/lpWAOqtnkyQlyrii2hA01o8n09VpijXhUQWVqgB/Wq6\nmhnyR6BdMxLetGsQnTBpV72kOXa9wf1EvlM9I6ZYgirDK8wGw2DkZRuTh/L8\n1rXkKFPUetYK3aH6BgZQqPQf5R1aHhYFmpRuUwBNS24uyk9mQCzdtpTNdtjZ\n6gd2fnMlH4t+Zs0Rk4YTQWYYjEmjVgnFf5KozHCUHXWIhGZxn00Nug3IEKKA\ngI3sXRQyo2wfu8xjpHIx09qLB0iaByobyHBk+ZHiCiJ/SwZCyOG1IB1316eN\nPlxd\r\n=1nIE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIByhChsfvSixjGj0tGJhNUmKt6T5ju6tZyoleP6h2f8vAiB/OS6F9On7rsgjxrEkmBAwPNf7bNSA3N5tmo9u17Y+UA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.ccb46744_1546086884346_0.11004947385943264"},"_hasShrinkwrap":false},"0.16.0-alpha.4cd584c2":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.4cd584c2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.4cd584c2","dist":{"shasum":"d7423e41fee82d5318ba5fbda440805fd223a3b3","integrity":"sha512-kk2vz173sdzQXbSltzKOx3+dYKzH0Fv/V3sBzKQ1DTB3/OoUBg8I5mdJqLlBOQgDT0tIq2ZOy3rAPmLNNbd8QQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.4cd584c2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcKThuCRA9TVsSAnZWagAAX+8P/jrHhXOmZEPvFL4T2/AS\nyERfmrNOI2+VFv+t7EZKfgewJXlx/VvwMvMpjpbo1rbuIwIX09OtkvDsNgd0\ntE8F2iSSJA3APnWpPE+ArlusBRV/UFeymMKVo6BqCsZBG3mQ9ZSFOrsj0CJb\nLO40C2kbc+OCn0bE9e26bZjPsQRZ01cTTUyygRgzyoS7iQn6+laysQznIcbI\nIEZel8ahKHl54f7e9L7bCFDAdKXRv8dC9XjcRpSueJJ6yID9lmAoQQrMkWvJ\nVBFEP6a/DCgl8L0mj/gyzn9ZtD46ovKDssZQbt/8w2hyMbn8T145inwQmefF\nvmfPWxQRYoLXwBUkOgkoHm0iD0wt79+yNBdHechoZyYHTxX0OWQ0GDwM+fm2\nNKXIuyEnuvzO+mARySUC+PvsTG0mJWYvvTELPTf2gbvdHyZJMTl6ugP+oGwh\ny+KZVhQMs36aGmvY1v3mmyQKeEwZddmPUoHUVy+DWumxdR6RhYi0DyLwcGDG\nuC3Nyy+/fhKW6kJwBUThKTXKtLN3LhTo+Fzxzuaf53biNmjYoD4gDIVAHDrO\nU28WHtMMvzaSil1nlGu5MFRIzb3hvsGjHotbfGdJdOoIzKzQ47xx0w/J+ghL\nfBAasRiW0htQ9bXQxB9hf5oYMsVUt9KtvZn0+cgDeGr7sNrr5RmYAx//U4YI\n+VAw\r\n=ArP5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjpbnSaCnBKO2Yt9/hi/0Fl25IH+C/yfyhKCP53soluQIhAIErAga+lAmi8DLGcUgLSXNMFJ8P43vU0DgW01KpjrIy"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.4cd584c2_1546205293770_0.6204677864240109"},"_hasShrinkwrap":false},"0.16.0-alpha.f16d645c":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.f16d645c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.f16d645c","dist":{"shasum":"b355243f80fd5d82ce4df59305e25a2d4dee817a","integrity":"sha512-+Uye45A7s3plDiUbl22M9f5ghY3jMb6f9TjAK3uA9p/3gX7end3cwjd/Rk59E5JULP5IS7JdeVNARZ5MvFJiLA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.f16d645c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcKTnFCRA9TVsSAnZWagAAkC4P/3tYzbc1yH7/ASmiZHXp\nuKMB+exNEpLlQfCTVd0YloV//0FqRLazLZ1CYHGhE7QrJtsEDL1JUIqC/aSU\nPIp042wUF8X+eWvMj7w0l06s7xmKZISHuiywyUq9hcKxZ/4hvUm0SfxvO6HO\nxer0I5HBbowT3yMkcIcXt5C6bNhFx20HM15b9+t1lrncBP8bHighgKtwhzUN\nk6qAWtJDM8foOe6WfVgi5bwMLFc8dn2fog5QVrRWa1DMLjPsHRml2xVZqCDl\nMM27kjn2lmU7DsmmBbZbHqNTR9OWAmqGUu05KISZU1Oizg5fJ/JCVTcbc+Io\nUYqO+9/+0SriOjV7dHmam3y8bLCKtmltLy/ZkzfoL8kwcEeTtQ5NcAN1xlZg\nm9gzGIsKv7FWCkWlT36XakFaTTNMVFr01RKq6d8+aQtY1644YIMyHfW9TPEX\nDVowrUuYTXuLHmoIIm0HNsEGAdStV1yv7DbUYN3LcXnL+2mLJn/YyQ0cu3Kp\nbNVLa+DU07EtjzDiR/gkJIZjTUs6Fhz/r7YCEL4j9zujRXO+2xDwo9Vu+yk1\nfi7gxv+hkfZLUHpWBnc7tp9NpRHs5kdT4E03mliWYARrXJdJgswJHs1AEWhG\n0dFhbJr8ogix0JnXb/yrS8RYAxWEjfJmh5ZNvSLOImjkLvPzY9chuXIjr4wb\nEin8\r\n=0UOB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBk9XKkCFYj2HZiKUNR9G8ZCfKcnQ7Z/6Sh6mlRKi3ZBAiBv4u4fG/OiObYCyDNTbTMWEbEy7dAOg6oGnL7YH7oz7A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.f16d645c_1546205636300_0.4138524052196355"},"_hasShrinkwrap":false},"0.16.0-alpha.a985b3ce":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.a985b3ce","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.a985b3ce","dist":{"shasum":"0e55eccd63ee3a018653e7f96146d143beb883d0","integrity":"sha512-NJw7M1k25Y+tBkpDCi+YhBuc6XkNYc3TmrIMDqgntBRKn1QyNZl5LmgDm45lEIEfZHcP25DASOQVv5BKDxof3Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.a985b3ce.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcKcQACRA9TVsSAnZWagAAqnMP/jwDfDOqFalaIpD1i8sH\n2UIqlG+sh8lUPle23PZfI+UsrZ4UBoTAVgqt73ZIxInPM2b2t375hdwkqZT1\nn15xJi7aqSZhaWRAF77g94/6RyMxzUUZD5pQB9UHFG0t2RQrU7ZC35Cypra5\nxx2nN3OqfCE6JGPNXAgBWy3lsEBUStk97szy1vbl1lcaRLF/wnisIR2lFcaF\nXssRR4YJj8YatJxbEkDgv+UZGKPbpu1zCmhNo458VlzlK5rmBHdqI+/zl2+1\ntByBvpOhIEri6yu909NkVR++IwiPrSYSXSLoPUxPaMfgx+5D5JBRquo60gkC\najZJi4aUR/bn1J94JiTU2IRN549sq2deSJc4c0OgSieN3bCLvHib7nYsZRmV\naAYtyXiPWfo/mtVG3gc51Lep99QLKH08XvlhiHdOmZGfEyerHNjXLYU5s/ns\n4EolaphvNJD2ylhR5/Tv4gtKVAXkJ6lDnZahH0j1tm87UYFofM03qvCLjZxX\nTEC+7HWjIpHUOrVvfF1JH07il505fUfCEUE2fjLMqrJ7H5jJh9Yfa/Ing3Pf\nCnwNkvKlvt8IPVW4BLR6rBOWeYZMNsrAMa/TBReUzLY6W20VbhdlfvM5RYBe\nFAUSTsAwJ2jfjNOhI1VK7Bxybg7YB2+F3VXmzlXHkwLjvRl6sQPmC0KWbDeF\nanPX\r\n=LQFl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHXLzO7EyFYbR9brcD+VP+a7BBFvwz8wkROfLo9XsO+zAiAS1brSCLJlf5tjizGI35iuerZ2sTOgQTf+w8nOjA5vQg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.a985b3ce_1546241023567_0.18691334037329188"},"_hasShrinkwrap":false},"0.16.0-alpha.f1fe2fae":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.f1fe2fae","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.f1fe2fae","dist":{"shasum":"f75d71668ee54793eac02964703a82ab542cf64d","integrity":"sha512-4HIGbIxJ/kEShM3JTC9OCZQDbpjtNV30+TY3dV/X7L2e5K9RG3iRyR1UzWCwCg6ANcKuHF/uge7ogQ4+0AIHGQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.f1fe2fae.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcKcQLCRA9TVsSAnZWagAALzcP/2nU9WXk1QV3r0ejVIRP\nzbfYMnVDWjHa5HtNjnFq6eaICmu3nz78mqGhD1d6muy60BwIMYwbRoyMsbdK\nBgbi14FUSJZqRLilEZGNXXHJHAe7vFG3THpEsvv15mA8kaP55UxOQQfqRROS\nxqCSs1FxuTp0iUS6sXadStBg2AwPnMvKuijz4HudJBqdr8i0bUOO71Us1PUN\nEzN2ULCY9IQ96aYbSA46eNQZFgrP9m5Jme6T9Zp0SrXCrrk5jkBQ+Lv+6tKW\nxVwPXrL3D7YZ+hNM3MLuFleUP2McWUmDBsaXitGLrvUwA+7LXgDDvochvLor\nFWQsMk1GbL0ate0B9GJrjtrh3M+gnfCk8UH2OQ3FmIbHHg9hN+v7JCUcEzru\nJBeyaQBmwGeun11g9cc/0up2TZOUNfcpnDt0rPM7XOwmRyDOWtnOOFTdS0Wa\nzBbPcfPP1diNShZD1di50xb22x9aoR8ffG9lh4D+6Kky2p/Li3sOA7DD0A4H\ncmYqfJMb6BxtQHSO8rPsWclONl1SujLxwgseVrN3+0xvhQaKc2eQPSZSSdFG\nlV9QNFDAJntAUZ3tMO0rizLc3rcGiF1LH+mjyU3kRREQ2z+AqA7uLzPKSOS6\nBKYlWk8AhFl0ZkBDk34uSwnYJUHavcxxY7XM6IiaH/jWrRWV9RgKtWyx6F6i\nM1Em\r\n=NRn8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD35NnYFqvCxRetIg0ildgYDOZSn/fhGuKZ0AVCpAax3AIhANPDpGbuNeRZtIY/8s7WEmNGNhD8U8sjeUI/qO7ssfGS"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.f1fe2fae_1546241034736_0.7649333096692179"},"_hasShrinkwrap":false},"0.16.0-alpha.379d37bc":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.379d37bc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.379d37bc","dist":{"shasum":"c6c4bf63a8bb43331d99ef77b2a928ef6cc7a22f","integrity":"sha512-ZaNFka2zFSBpO/RkX3mSdXz1/VHpHjpcx6CNaShfCSfQzRrdM6g8X34ORZeCnaBrb7/xs7zE+YnjyQXSqHjdHQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.379d37bc.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcKgU0CRA9TVsSAnZWagAAFnAQAJQdc+gNnPQZHToKizjx\n8UBDzZoTYM/zIy5eSJZAe8naKOF07OdFaEtZMSsP6vU4CNVWxYjRixfE96oM\nSEOfzshdDYwDlZC9WO38inzpKZ2bgkxKG0LaQr3xRDj0DNGwZ7Ue9p6mIy/R\nOJkvH0DO9AWMhxCnn6UDiS2fY9GRS5jYEBOl4OdCCxqIObMmFdbn0BOlyqjD\nTwTmlvb7xhe/+AkFQE5ZmlNjMSkMT7lumnGuXl2cFYBExw/xxWpNBQ6hkOSf\nSo2T4J+IbqsGhOdXLbSZj1BSUWdjkeecNwdqIPMIZMZywjzSjRpXAIvGZgk0\nLQEJnGryF4P44EPv+QbYHT46O9OXSUuu1nzJzJECdhlUsOFOGILQow2bLLFX\nTgKE1+2SNxHwhgE2kqt98AxnOWZv72FWgtlFmhGu/Q3CaWPWYZP3B0DWe6iL\nzaR0iTpTJqecekxyGXCjxZIqI9/Tu2Wd2hNKm2bHENi2zaBo7sOPac6xjoIL\nYePJXDOz/y+/ZMRxn3d0FuRBvNTvzXCJfTYGVqbKwyytjSywbkC687/VgmIr\nLxZbOHM5JyYDBtjZdOWpZk1rDvVsMHassUry7jbjcrjjCQxEthUVx5C3JiLL\nbkp+8Z1IZrau0Q2oZL0u4hKIlrayhBOwk/ulY/pDHvtx7b9fKBVJdxKMJo41\nALAp\r\n=mFC0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsJkHtct5C01RN1AGXud1ufMfXEhOiM0AmT/xDSLf8cgIgNvedN5grrtyqfAT33h/ffrWhj6V+BzMw0xMeMtst4A8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.379d37bc_1546257715445_0.47201673196518135"},"_hasShrinkwrap":false},"0.16.0-alpha.6e6d1845":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.6e6d1845","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.6e6d1845","dist":{"shasum":"65b753b06793d1fe39c7489d4aebb6ce7eac554c","integrity":"sha512-l2cdA6XWzIGmUZCR9tgFG16UqNRFSD3HJuWsZFVGYER7DRBdfwAC1CcezFW9B0y+LSL72tMO/OmvXKW6Q9CD6w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.6e6d1845.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcKkV8CRA9TVsSAnZWagAA/Y4P/0/dea4MQwUNnlmhiQas\nXbFwNyMeBGs0RS3DHAdAH6cr81LKqTZWdB/4IpC6IkKygxTNt2JMBFDcY8hu\nV8AVpdYRC+NMxigbZMbpS+QSmX/JHfbmBlh4Gd9S3DskeVDURdttS9MNAdK5\ncvfWPptUkThxkjg465YAssW6j1xavrx6ChOVJ0oXNWP/gz1UdiBkpx8N/n1G\nQEWhbLH7dYJ8U69AARpNec3fZETOSJF3Dh1GaL5Np2km9NGpCiMj5MVa/IWt\n3+M+gHNvQso+Owl7H6XNGe4OLziEBeucDUZrQm2xhR7wVF2puf/PkuhcSKRp\nb02zEdqRNUgMTj1KMOaSfYLbpu91S4Tu3g/Wj4szbmV7Rj1EqjgYj07siM7M\neid71QFrBelzW115PVTRY6mEjAM+OykaHvHVulf7NSJUVTSMG3ajn3hoZLwu\ndLeuyr8ikSxdBD77ZQVdnc1M7TBtZGxKMxTmuiwHonDkw40yiHd1Ne/XLP0f\nmobPT6humIAE+71fP/ojgBpa+c4alwhDG6rEPFHLZgp74fr9AqJA9qg4psEf\noCbhZbxpYkashGqJO6Q3OxOE4T7RwXVyQqPyQ47Dai9weu59Dpt9WF25OCK9\nGrZd/HyU761PdMe+gBkIepCM1tW33hknkk2w7oqNwPx006FsmC3jnRt4/u13\nBddq\r\n=+PJL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAHO+kX/jhJjgsBhdKdBVnQy3+f15syL11hEhB+nokOIAiEAlQI2uVrDr6ew2YAtdtSd9+EoodY1QZ5oTC9XPOWHJ+A="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.6e6d1845_1546274171790_0.2287965387441071"},"_hasShrinkwrap":false},"0.16.0-alpha.be0bf3bd":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.be0bf3bd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.be0bf3bd","dist":{"shasum":"99282b55ccf134894d4b88c81780447a84fd1bef","integrity":"sha512-RRqwlz2nt6GRJijHsVGeE4BfoLRVsI4eYwjYLCYeRf6M85M4MRmyPhNtVxcJNZhvjlPuo+MJjm+86IjTaGuNLQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.be0bf3bd.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcKkWSCRA9TVsSAnZWagAANL4P/RVyjC1q7Muc3mToGhOX\nGn2mh2mT10A2zrTSnAYSHpmwW7LGVvEXKV0zbcMBYCxULe3FASdL81I2jUEg\nJp89T2gAEpwryXnL3hEO4YqaakocX2f8bofIVbk5Cn8SEZ2leqaOyXSxqYsZ\n4nucSivJbSdrXCsne+cfJeYF/QrL9UE9c6tfpIZVsxScCy3MgC8zvj7fx7mG\nNmUAfkDsTSq68v8xDSKX+5icxTpGznpMQb3lyp05Z6ono/wJY2KTlPwBjvtE\nCnrFmUGXkRisMceHlwhP7SxtNspAGAdWZe2b5k1YBfEORiHV78UhjyG4E1Fo\nB0bgRVxtXTHJTyGtg/a4jfLmKVLqWvl+n/zvmf4uBUM4dk4j+DUKkLhugc8F\nPNoifVGwBQXtJfMyBcN83tpgxS0DLVPjHcejca+fpAQcUVJ/2GHobur+05fw\neergrhuVrRMLEguC60S7IfhzG2dxXhf8lIwq/CK04R6RhV/BXpd5QVhHnysy\n/TT9wBF90fCcUrjHl2W8uerc2cBmNbWIg8pmTK0/0tm3rjU6bbINbiOhcNCt\nFML6bqvnjvLJRazOhfJNuNDvzQ+SfDKgRd0paV19m67ERe9XBOhgjpJ7MVfX\n5muvzXPIPPVzGV8Y29eVVGk3uaiUtCTUEC0ucA25oDb39Ns3SBYmWm6KRkvn\nfzSR\r\n=m712\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIErP5R9f8RuvLpFNxDFGDvCmXFAO2OY5Sck/iPR0L3DdAiBIdwz5UXdHnqUKRYj762p6lEVHGYqFd2aGLERZ8IJmXA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.be0bf3bd_1546274193636_0.18242861222668538"},"_hasShrinkwrap":false},"0.16.0-alpha.3553ef16":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.3553ef16","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.3553ef16","dist":{"shasum":"17d9442a49ea05e4581408909d5725d6db683569","integrity":"sha512-ZIeZ7jS9Is/XFtnbMpnBlnUkbso0aNdONJThoSUIoZOKUyMQww6Dd8UsSjQBymkf+WtGYRcmv7lYGvNWktpz5A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.3553ef16.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcKnQsCRA9TVsSAnZWagAAaZIQAIg3C6OWeJBA8MX79f25\n5O7Y3fyRrLL2aX8gpJgvrnz+wXM2pjWpRc78R35p8ctfZtNoSbD2zRO0tPYs\nVjy7LIbyiBGekaKscQ3JlT4WkQP4xpcuotUXXXXSR0/VgQ+ZmGxvZu9dj9/D\n3PQH3qJ7yyqsAr2zy/eluGP/FwGWXf7SH6AfHrFym4Lhvc9L0Fp2j/Dobb7w\nrgaI5LC6dYSKM90q6M2KfsuUrFh0j/t5FnATUPY8MNzg5T72ckDae+cjKjId\ntTj2q0YtXH72fGsVqJWMGxtTMPGqLlkyZZx6z+Sya3YmBAv4ZyixB1UxhRT1\nVYXFItfQj6nawXVc/MWBl+LRicrm5EtzFK4psnepI/+pPLLHzfat4JF85e82\nvlwrPuIJU1NbDSoFknpPiExaNj9H8G02v4CRucmP6/I5weOacqQL/gXZkbXY\n6D7c1h3h30e4PEYADNBwBmZRFteHahaueKs1cFjg9CVYtvFj+wdi9a0lSjhr\nNw1rS5ABa+SdWX3bWrZfF56WB+2N6eqxeDeyu/q/vyeY4K5TZN6+tjhQyBir\nBxlNErm8o4XJoIWMIm2vKE0mX4Rr7UeQmPWBDpDBXTZG+u2bysBM7eaKBuDZ\ni/ZyAGS2GU8hYhz3Ty65lylKjEYGldHnwI1qyO68QGCf0V5EmVoOZVDyR7Fy\n36yr\r\n=Lx4d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF9SXecm5Ig1S5QKMboFp5ul48ROiMeNSSiMmYgPkJalAiEAkGVODzvHgMrZpzLiPQdUWZz4kCSyuWzqBBAmrxZYWMg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.3553ef16_1546286123551_0.5070797076071267"},"_hasShrinkwrap":false},"0.16.0-alpha.606bc452":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.606bc452","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.606bc452","dist":{"shasum":"27bb1c194ca422c987d342387f7470c78da0aaba","integrity":"sha512-xljUSbzEGdDPqI0bHxkfbF/NkZ8VKJ/8TT5APYl6Zcn9ysK0NBKBzWgUkstkIE1UFYQFjKIpqNLoHfmCLq1UOQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.606bc452.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcKnQ4CRA9TVsSAnZWagAADwsQAJViBkq48B5eqxL0ZV3M\nPdSV8GGEXKGhLzt4hQ5QloP3t5Kn3+WJMxz0i9ToDToK/1dqScDxMGJojujW\nrZ6lqxtE99NyzVxwBCF6NgZvt1u1WKg0r10KMTEs++7RF9+DBPPMBMeZPTw3\nXp6l02oZ5TI91eoP4/utDoNnA1Zg1Pxpr1f1w1t/UgFhxBkQlobRSR0za0U7\nWJHOlcjrd5fc+4tNNMB4RRrXYtZSE1Gux1XLa4BypBqQ7ViA0szSXk61lT4l\nE3Jlwmz8+8VqyUVW3G5h03Nq462zcL3C9X3jhmh4qYJ/7nPN8l3x2WUYV6Ih\nfmK9CfnqVIPhZW0BXUsisSvYWVYgH90LRxHkIFLcmCLLw0KzC8grbadAJ91P\n9zO7XYXpE2gQIepQFYNJOogo8hl9O2fa/nxSP/nYBOW3Yazq4f3bcyTkw+Ay\nIR3B+qYfWj0v2tPbhBVZkDK0NUY8r3id38D3NbC0CRh4apQR620d3dRpbXhJ\nD5UvQydppabX3DoWUUi/Oio2+HLznMxM5fIUEItd9WEUrtx7hIeHT27ACHi5\n62xmrq2y11eahKGI5j2q2v9b8loxl5shlEwFMLhykiuJHDUoA1sMmeeVA9uB\niXeUY/joxeWpB1V9Lhu+7Ivho6AMvIaVavZw655KhIERbexqx3ucw29MCW2/\nezue\r\n=LKbM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9MwVtCHlsp3a9ZOpFWa7QGRcpzB7fK0J4JofBb4etdwIhAP/IIUjhz7vlKkOiXhdUuqJpkTxEhaB3E6ZO+1AJJCDP"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.606bc452_1546286136024_0.9067411831436756"},"_hasShrinkwrap":false},"0.16.0-alpha.875e3d43":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.875e3d43","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.875e3d43","dist":{"shasum":"8fcecb94234f6a271e29957e88a7a699bc3e9c21","integrity":"sha512-4vXLdKCseZv8zG4a78NqEmFYck0Z1mhwpbPFjiW+ZSKmIunt0ubBKQJLMAcLbmSXinpPlH/OUlGC6FBMOqWzxA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.875e3d43.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcLRNfCRA9TVsSAnZWagAAHhEP/0tffeD3Hy3zb4ciOKBE\nR0h3oyEHTTzIbIxgUxq7rCMIEIK1nT10EThnzo/6SUI/iSSLEKcKruW2AH/q\nkQh94551QVcOpdteU6dkf14iwZe2PRAFuul9mt4plieX/0mpoqK2f2S0KMCd\nutORx/ybA9DfSQrhwNWvhxLclf+7Ft2o68qwv2sIeG4prV+Jvh5NG9U/BW7F\n7t3hV8QokOk0uY3Vy6VHMxOrpSXcNAhIZ5m0U9HIkIbCAXi7q2YZIyPauRMv\nZJzs/6VQGvjOMXR0DUNzAWRsPmjnrjLvnPTY1P+GU35KE4iYh26fBZT0HUNH\nsaRPKQt2SRGR9EOM9YW1MRhomXD6CuvYGpOONw+mDVxc0kEGpSvfpXppO09M\n1zLbZhbzJw7Rh5ouj24BCjrvjwhUf9iJdsFRG4NAEgL34g7qaDIPAi+kQQoR\nXUjNUry9C9EMhbwjaW0H9HlhAzsUtpK6w2UDvzdJ9pn0fxRbYOXug+ZQfg2g\ns4G+4ptc5fIHYPI91qtV/T/84fVh0RjQT/BXq8gX6TwNuAcux0f8MvEYJMHG\n92LJWXVmjvwKC84dJY45Y9/Zki1cqfNJOqxX7SsEn5Ne4fcQ3uTovZUuULEq\nrCeZOnPV50JcVwLcK13PySxTZDs1Q/ntCEQkBvDdyNLYk7Z7rnOB/yrfSE1k\nSEMS\r\n=nx7w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBybT9e0gSmfSPt9unJf80MPUq9uMCaDxsUzc5GZQprSAiAZgWm3zNTJKxItHl+TC6scCKQdIXkosLzYYdIqFTyzkA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.875e3d43_1546457950354_0.9241624730585072"},"_hasShrinkwrap":false},"0.16.0-alpha.296cfaa9":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.296cfaa9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.296cfaa9","dist":{"shasum":"49813ab2a44de89b64721fa413b235c1bc6b105d","integrity":"sha512-aUMeyVS/rEsRL7mgcw36pXs5iN4TrUpKW129HoTgcCHmmAQAQW4MfVFYe0f7sCIAjFDvT8bViltC5+z6ke7DbA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.296cfaa9.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcLa6QCRA9TVsSAnZWagAAVucP/jCpC8pFtoxcIShJc9Nq\nzM4m2LKYb27URQ0nq3hI8qGRKftnLdNqDivWGfjmFy41sCS7FiD5ID91NUnN\nJbxM+4IDAAZXLfz7qfbHuvVAV0ro/92cVpv4VZkr358elFz/gyOlW8FhsEfd\nRKP5zE6cUIG/qOhlqzgswAy55L0zXtYrDywQpKC3LWTMcQLyyjfxGPQ0yXj8\n7xkrpl3MBCZbQaQIQXuaZAQGwUuxmGHOg3NRec+EC96uBJjG2YI9/whoniIA\n/xnC0EnOeJ2oip/WscXr+0NVD3/nxgigK78HML4ckxOgYYTPJIvK4tLTXriS\na2Fn1E9dXimTtuaCCXY2tURyRRl2gTpFOUde+Kcl3ygI3R9sTCXw4eWSVPKO\nwgYU0cds1b3CfmeL5sxRdwRmCIfMI4mux34E2KpdcsZti/gerjA7njm5aWsE\nm5v+8B8VYYHoulPkIQQjRUwoGUzl5E+zPGtrhaIMHdUJb2+VvuK0jig/KIjV\ne6wzMi36JxwB8FUX56aaVCxRg1xTsvumJsbw/bVpBRTvcieLkXQusaraQh+J\nvHjP6w3BfAWVQDoJUzvnl68X5kD7en6RuhnRwzspB4ARMoDz7fAyEevinpGV\nhBEjFXG0kRTcuitUh+yQ8NgbqN+DA6rUQJuwSRHzlK1OqoR3zv2rZ6PppCJd\nd13g\r\n=v0z/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0u3z28SQO5LWdiQ8JmrkozcMNvVQitpGLFIDZQbYY2QIgdwboc0gfHlbb7ZDoZxCPcww6rmX1I8ZxVovvZFPMCso="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.296cfaa9_1546497679828_0.2511743749955142"},"_hasShrinkwrap":false},"0.16.0-alpha.97b0091a":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.97b0091a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.2","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.97b0091a","dist":{"shasum":"0a54bcaf418c8aa2d062db820f863bd81d15941c","integrity":"sha512-yKR7YkThZJXoQURPaG6HWmZVGzaX0gVo+BMEd9g7Q5FIQnOMXguThM3DILJAz9v7I09ZYEl+1qjDqCbGJcSWSA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.97b0091a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcLa//CRA9TVsSAnZWagAAjRAP+wUjMUi6Fyx6q/0uAWKI\nLl7vLufQXuoeKcofTMrBHwAuuY30tOlYQgYGGn+yWLUCdPyAkTMWV0NVE6hE\nx7F73cLRJANZWaW/CHW+ZP6pvdy1wUFjSMPhHRViQMZz/TWY+lTPrZdWE28B\nM4qX6ly13WDKM/O7kzLBLvYuDTK7wJW1HWO9GG7QOh5MUCH+PYFqJjdoKYJJ\n5kXaJMAuRfnUyrXTQntJwXOj12pjrIIE5ZpTRucZ/UA5k4odziNWKiPxX0Sm\nX3gqZ0NaMa+Mtr47SR1rBXC/OkVZoSs4bc7somoyHueqocvAkXk3ZvMC2fPc\nxv6fAP8y6kVZR6nWuSHdCpr/O2BgBIZ/5HbSSphvqbFj74/WjZP+goc9VPt1\nTwe0I9F6NQ591xr6sSdQNz394vfqJaStSqHtPhKtrqpis33NA8mvbObZSBYB\nN9CM145sWkMCJ1MvUFmh4EMAWTx12GLKoFrCmUkyaKB3d/ZJDyO/TnD+Eu6+\nSGODN7BFOl8W/BKVcFDhlSgjLjg6B0NOgjO2j3ZzY8WU6QBBEjY4IdsjLAHp\n+YZgjqAglxlxf/kQr9wNdDuvVIRwmRr43Yf4RuvLjcKpfDwiiHXD63lD6AS/\nFfeRpmqlFRdYJcPiavaA1d2qkOi6y751DJaRdhoz+qhw8NmL1geLKq95DR+d\nEBoo\r\n=GMst\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDzhwO+/A4k+yPoeE7j8/ika51PIPQtRNVDkvXgzPf/6AiEA6xIMZbhaLF1JO9C/YewrHeQIz1xdm4JEADJYhqqnpbg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.97b0091a_1546498046817_0.6012912011711962"},"_hasShrinkwrap":false},"0.16.0-alpha.b38eb5c8":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.b38eb5c8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.b38eb5c8","dist":{"shasum":"ee21d2a8c0e72a9e2293b8372aa4f5ad28d1bf7b","integrity":"sha512-ZOWU0E6gR6ha5Pd59cIkUypBLSAOo2DJuk+bHt5zNqwDRbtgUViDbaj7fIdUALFw4D86QaoOsuSPmAHbLp6dIQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.b38eb5c8.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcLbCZCRA9TVsSAnZWagAA6pcP+wfhDBGO0Cb5l+DF8eAs\nQW8ekMYhrPFPNjIaPEQxykOm23EmEcuZhTNuBFwGTJq51K7UlRqGC9vTFM4m\nYILPwVsgHsjRDoXDgW4cUh530C10n3fsM4umx6NLeoAbVq081Wulb5+DlRzm\nwoyPpyLbGQ1X72rQH1ZTmb9j1jbkO+7omE5fq22OEd+0DOWQ9cU49THsROIO\n81MlJO1A7X5GbYnVGYhR1Ksj7DOuL1vfIqaQuMNWXG87VzhAd0Is+zaE4i19\ntUBpta/+JBSXe3tD8ntl4phg86+8En930DPcfwTX7zu8ppOC1nCHrjfbLuLI\nqPpZhp3FPbulAXKP1EWrMm6A7yXkeLH7UXxxxnV16yh/QQ52ZcLngIPX4DoV\nXcDIBF9GrLo3wh85RZvwvisLUzLGFyOtKc6pipx5+YpqpFtP8wmoTrRrw2fi\nieDPJj2wjFqqZ2293/kJ2fGcnlrSCQTnwZsw/hZv1apqOXhKPT3GrxtbBsFj\nb1GEPGa1errqYy6X3zxYrt9wT81kFD88Tu0VJdkDO5pjF92gC1SxqXMZy4sV\nIyBXJ26zq5sVtyoOP2tORNTnzu4S4Y8LcwccsIUuvwcsEPazkcSWWEbRRnDU\nu4LQhaZVSorXfhZ4yRXz4BufSyb94nab97F3c3/9waqDJcoAxpGOJBxdBeGW\nRqaj\r\n=uPFh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBIx8TSJdQqXmJziM0q2jFGJHik1qCWM+zWiunnyEyqlAiEA847yX+V8znTbRcKfyvBHIGI5ofQH9G4hvSXMCRDKFtM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.b38eb5c8_1546498201354_0.3381464695643972"},"_hasShrinkwrap":false},"0.16.0-alpha.0c80b907":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.0c80b907","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.0c80b907","dist":{"shasum":"41e961f22b7cec8e7f1ddd07cf6cf4dd22652e4b","integrity":"sha512-KBmxsOMfEyxVtKQSvm03HzICa7wURQBtvv5f9YLSBECMV9uNEpQiE5soThGV+waByefpPNLo1f/WAkRQDMpGoA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.0c80b907.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcLbC+CRA9TVsSAnZWagAA7aoQAIxx44JFjW33oJHrA1E4\nG42q5yTFGNGEShSsjZxkwy0wstR1HL9nWc5jCrkQ/fJgNNGPuOof3g2NSdib\nFWd4T8tzbEffqHZMpCxDbVdS29UKZMFpBYODNoOugxejAUxLEVIrU+VB+tZI\nbNX+C/2d/NPBpehpdVZ9mjJTTQrsSz/8CL31B7IbWy7iubL9TeW4H47jchKC\nj9WLDOtAcEkt9glJin+6L1vjnN7oAiLUk4xViKa2lJ7pCIjz0LYONhmsFqgh\nu33mw6n3YolH8WihTdcP0H6BYsTh1aVHGsm+MIJpCpANPTIzvZHfgBQKQHrO\nSC6rqZKy5jhpCaRzbmsDloeQoyBvZM4+LN4tjqdWmzVryysGisE0EtqyNXxp\nX+hRWKFk18v/w82YFUczDB7wp6J+OeDmw2wkEY0a56x2r00hSmsFRk+DHC08\nNMTqDSQCZeZ37iK2KK9O2fqyCss+nTncQFcK2pYnPAXRjM5quuPKIkX3m9c0\nv1K4/VHI+WCE6CM41tw0/K7J7Go1Co5EqoDsi6s0MfBh/s+J9K9wylsWT6VU\nwunDEZFdo/5HjmqpWFYREgMKzys7BmEQN9s3ESMaZJmILY7mwIiRq1GZ4Ff0\n8Bz9oT9/8ck5Q5oJ1+MFtWAgjk/7+GQ4puVd/8hl8TQNnDTzQWc8TwWoAAkG\nax9z\r\n=1qV2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEiYccNWjMZBVsbCvH9BFezdSAooq28zCaEjlS6Ff/yiAiBvJMLuWMceZ7wyOKYO43KZmIkJ/KbLWSM+rz5TtnabtQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.0c80b907_1546498237367_0.14954802153200086"},"_hasShrinkwrap":false},"0.16.0-alpha.c6019189":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.c6019189","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.c6019189","dist":{"shasum":"498cb2941801c33feea0b408020b5294b29e8dbd","integrity":"sha512-Hp2ku+vdqGrCIdRZmxEY2iW6dRZ0M/nS6ROkJ+SByeGCfSuDm5d/1ByzDqb2Mj70tMvpgW4UzfR10nEGW6/dBA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.c6019189.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcLq58CRA9TVsSAnZWagAAx9gP/RzFqmwFWFUvRXIT87ap\nwRiKr+p4HLbQNQbpk852VbamX2Rf55l0rIHq0DnKD3Hea38OHhOT4uRBd597\n9mJh7tFPOwwEIaXlnxbA8QHobaPeOyNvZqakg0dzADh+LzhgTne7qZcwAIfY\ngFGPd8XBlif8MrvUPq6fjMn7afmT3aHcXUDW3RX7i5z4dqDeolcEhpQpFCK6\nwLRGohcS1NjfnrbbHryZ6Tu37bYhBWqYdUG6WHihu0TCEHtjjBvJnkMqOROj\nxrUlCVZ738n7USJjezRYmhCVxjvZsvBtOIGqx/+o8+UsWcT6yRftMSIEGrpE\nF44gFvkEpqsIkhL1j+bYRRlTYY+15nm/YCwBwvYfMT8jC+TaR5b2XDInczMT\nHykeEBJG5APFbnZkrjrIjoYPjFpYHT2wrgXGpXkUDZ8jNb5lPWsBnLUpIMof\nJC53yT1w1SuTiZmBRBy/bSSzihBTCqwNTynZeDLGGNdLwDeEkLNPt2K1e58l\nrK5of3rHtDeJLNq4pk/5LldIKNw8wmreEox0vCCjEW1X7X/EVeE73RkSbGLR\nFACf8gq/zM8GKV+VlIhvMhMD1OlHrWcF8hnCSKVHKhZECdDa8rR+4pWZpLPw\nw5zr1KDdUC4AJ1FTxwsU3rVyJZHoHNc18o8G21gK/xLroGCCG7T+25knr8UT\n3a4n\r\n=e4NA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFA34N4a+boGPgmpIJZhg4vAefjf2OjGVzS3jmS0psB7AiB+hkU5eYxzNt4YuBRFAEYu9ouDpewPZUXD362N8hP8wQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.c6019189_1546563195804_0.8739339405558335"},"_hasShrinkwrap":false},"0.16.0-alpha.8acb2055":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.8acb2055","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.8acb2055","dist":{"shasum":"5d5eaa2bef250c32f4046f211d4aca59fefef26b","integrity":"sha512-7gfSNWYRx0xhM/r4hCp4bpvkM3uD7SRpT4yqrWIFHwgjF12b20C0Yqbh8BHYHE3iawKM3uoLmdwpbIIfE2jrIQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.8acb2055.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcL+vbCRA9TVsSAnZWagAA8P0P/2EdKmdkYnmvmkp2cerM\nWFsRrCmxLB9sAIV340J8McZ2oACRLNpJnnpKCK8MtKlVfUM/fuC50f9hKHan\nKYhGRVuKA/yGPZieOJFYFcoXIyOlhJFS3EHLIQRybTHu0FnFU9tsfkjQohQ5\nGf2z40iglPVue4Od9beqYaL5jah64/4PSgb3CXCTfj5+1w6EunCNIiVmkXy0\n6CwwY19dqmcMRKDrpjWlQ/FJIUtrDZlC+deMSTHKakx3H7ysNO51QdIY8QOl\nkA26jB5FfFGvzi8427JUXbsemT9DIglqsX5YgwBhxPoWm4yhTLiaAeljuVwD\n8qxkX5iaAbOlMd5m/xka3ZfmZKa0OVS+BT05LicToRy/GaFrw6RvTKj+33yO\nPJrKDEyJ4PRz8PtYCCmJAbsUO6ou2rBljud1rafKVTBIOmjs2+RLWtwTb5Eq\n2/e8G8hSfCkQ4NE0nH1V5Ex/EyK8VbRZ0AOHOIFq7ZPP7Rr/HnCXNy6SKbF7\nPjbwpP2Uh8cyQHJJ622GUgyvzdvz42IL0n8+9N86LXD66DH4i8BbSm01kRQh\nrnjYvt33pLeOwBmkW08cSJwE6+Hi4fNoF3qGeEB1bLmDL8dWA11Utk6nPV2L\nD54YdiFV1Vr98G77JVzgVtgsIdXcWmaLkPlzuEVPvGOM2EQU0/rAXyDs6ODF\nuK7B\r\n=1oue\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkSFUFwIu8pDihro2kGl4cfZnbJfmGkQ3jqcdZq38z/QIhAMvYpJDcdTb6C1vVt6JMihQz4tlYlpaDqF11SyoX41JS"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.8acb2055_1546644442793_0.24762127847516857"},"_hasShrinkwrap":false},"0.16.0-alpha.f7960fde":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.f7960fde","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.f7960fde","dist":{"shasum":"de25b4efaec409c9572a01c000eb2a527a8ce947","integrity":"sha512-AgvtSwzhr+PjCSyZj3JaGdjr2CvEc/bnWfyh1zp2FnAJL2ngG6F9thI5JYFCcQvBbV8BkzBaxc6UD9hVfGzy7w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.f7960fde.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMHjTCRA9TVsSAnZWagAArhsQAI9gtDpIbrJ+fH5pziPE\nIryWKs4TxVTRILm4ZaBbFF1kq+YR2581moJPgz8igwx1fjbxFIExwfOtYZ7+\n1CtXh/QmnVSRlU6BG9p/h8co/kyjcNhrlSBX60SrRhV9uVbEM+0g+mrOBy8w\nAxIlIoz2UVYlEGRrW/yP2SnZaxt1rirz1mU4x6WfTnH6XC1qBiKIrYrThBkq\n8zwZmAF6pdzl+0HrJxwlmhlHd+3S/X2Uns5gZDnKX3NMVFoHOUN1IqtTh+QO\ns4iayr5byDgGzw1fdxj0EgVf8ytIBTH5/uU215TYwkSApk7deTo83wKg2CXm\nqS0YNKjE1aS9WoWl5dHhU8dH9gjqTZbGZqHvsRBECnfCftUhChpGzO7Bf60C\n+R4OfzHk3UvV+Se6gWUwsayraLGTEY1KTE8jsgG0BjYwhgjAzKomT2KU+62i\nWQZOhhVbgD7VWdXvFNkNya4u1nxfZUqEot4k77kNc7Bf5r3x3C39lIW6oOv7\nVFaw7wRZOY0scsHMDPpUXWm/YKjo6UzNxRHC9cEMmXpXiReN7de/g4zTtYDd\nJv4IKpVYkjyP9c8r8YeCfet5c6pOgNrAC4M6D3D/YmvdvEABDQ2B1dYPesBv\n3cDu5Fe3gIWuO+40iEK9+PPDIMZ1Ag/Sse8JLthQeN7fif1WhFmUN3F0W/dA\nzZlA\r\n=EDOE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDa+PD8EZSv57ZZCPY3In1jUIpKa5TgYBfBT54kUYOAlgIhAMSCzroQbnNmVA1G0TGjLfOQhu6494PpN9eYilSM3Coz"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.f7960fde_1546680530513_0.8435130332055878"},"_hasShrinkwrap":false},"0.16.0-alpha.6b33a55b":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.6b33a55b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.6b33a55b","dist":{"shasum":"8ba6b9192986164139b8152ae03e72d599dff29a","integrity":"sha512-RA9p+lLsy9RxuUqOCI6tFefGgU5QEYWuWAxgUIZmSG7NJGapa84AAhZSu2Id7tQ3xyiyjPwjsQu77duN3huCGw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.6b33a55b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMNJUCRA9TVsSAnZWagAAIKcP/0a1wB+YZ7VrcXuJtkYU\nHRm9VKhwPKkm1sR4A8TtW/pPVbYZxpbgRpCCpOgGmlXFgZecmnwBjex1SN6Z\nDQ33IGJGZafld6TXH674GANa6tankqZzEW6XV7u978HDHP6p9y5mLTZ7SlUd\n75BMv2baKkSBikwicSFEvhYuVRGhe1Zy3+mA3KN/c5Ikjiz5NBGFaMdMFCBC\nJ7tQsoBpMrUJe7E4MK5KLw4/mPsSeHp3EQfy9wITIm5f32WAvmConkP0Y5L1\nG9BgzX5tD3lzZxFE+Vd4n5NkCR7ZOrr+/xoIL9h0X/tQJPZT4KM0+Q+3Gs6c\nUUOt+0BUxvbZvKKj+kxzGN41249nH9RmwUBSbx1jnzPetJDd86CXfkDG7nls\nNuLY07Li/kFg5MavHePFkM/+GEGyodCQiwiCsAjV/6xe0hZCGDoS1pnvYqdy\n8ltMQTWNhs10sbixYWlVB07E5RdWKvGA9PpHD8gXwLmQ0vaE5O3wDLS+y3Nn\n7r26wFA7yaGflacOUSiwSA4Pb5G3C4rgSJAtEcJaF3FxAy35WXtDAlke0j3P\nxCg2KnN9/7krKPoCcjKLa5Od39W2Rlqycw5x1A6PVwjbnKmQVIvz6HmSFYam\n76w0qeHExLb7szQGl5CgJ4aeJG86dTRQ7j6PkpzMHwsPeOFRipKytOd4pKDa\n+woG\r\n=4eJb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdrUgUilnJdj+8GTvz461OyEnPv9MnqYL8oLNCGnWYJwIhAINjnIuKtYRtTaIuiFQqSqQhj3Zn5PkvS3fYOAB4zv6X"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.6b33a55b_1546703443579_0.5641119749339085"},"_hasShrinkwrap":false},"0.16.0-alpha.25afe319":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.25afe319","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.25afe319","dist":{"shasum":"8e001007deb06ac0c0774007bb7c0e22578e661f","integrity":"sha512-lMOJ0bXB6SRHjVWXUMm6zAkFLjxJrz2uotsd3/2bB5PkdihMDfvQ+6MtGsyr2lh2bsAOhjiaQyhhK8m8Glg7Zg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.25afe319.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMaxxCRA9TVsSAnZWagAAATIP/3ZKrwERQXytRlsnzdQL\nEZxxQTSfpSOsr4ntRx5/yD4LvbV3+vGx33ThxN0E0l1zkQOVRHVqpFZ3qSNq\nfhsqoOowEz21+RZecz5qgnpc48u9CHVr4hWaTMX2vqymlZYpLAGMGjbdaGzc\nr3U+8qX6S8jECMWnLFU68xpmtwA44SkRU7uqEjjY0K0/MpEWBkqXBgTxZQfp\n9Z0qeGrGtX3/H/2bZ/Lj9J5N4Ger5GqW0C/c8zGGD4jRjeCvcy8znqlzuEc/\n41glCO4ORCWVU//Utts6XijaP12Br0bgqLOvy7Sg9/rc6sldhIxNQcPWZ0De\nF+ujNKoyHe4duHFBk8WaVhAdShavrjSYrKXF2wS5wQJQs6C50RNggNRYUq3b\nFqQh7aQJ/yfYMVt3gXhQNSBU1ehmgZFY3XHyPECF1XEynfSdOJPnWqJCVcW4\nQzKjfJZtiLymqRX2UpIGUsveS2VxRqylAvEgwMTWnrxXkb5+IrEVczmz+rkF\ndqm9xErgF4R8oI7I6Zam7cwy+nkGX6xvaEAnI0PLgaSlrEXTT606D6WJxeWD\n2fI0MdnL/OqQuOnUi0I3Z4LCVHd8OT540LJXdCDSKi7Wbwd6+pNAfQkasYaM\nEQosKbSznTTBpb2ZEnJHJSL3iHRyELk5lYY5eE+QeFf1yJn+HDzPdlZ4+Dbm\n5ebK\r\n=PMIH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYE/s9Qu+8/FXsIThHb0yrUoPIvG6z5iNJ/+6feVX+0gIgFqEJsyipC5hjHQw0oK2tLPDrWe+K+BHI1yQmOqLrVtY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.25afe319_1546759280700_0.996232185428843"},"_hasShrinkwrap":false},"0.16.0-alpha.69dc7348":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.69dc7348","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.69dc7348","dist":{"shasum":"19a37dfd0a21bce9377d023369dd5c2ad2c34778","integrity":"sha512-YKBSVsR1Pb0+NH52xczXj7gjdu1YnwTzmxdJEFHWuk6MMNso699KvIfoMhCdO2OSGwW7qUgWsU64ikfeSNE3uQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.69dc7348.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMax+CRA9TVsSAnZWagAAu7QP/R8vnNq+gkfntzWa2mhJ\nCfeMQ2FGGH+aVxryS3BC5ZTnChDTZvL6L0legT3l/X/3bon++EC23hN8uWXE\nrSASCG74AFIUNbuHOF3Hp10wpnfFop0Y/n/gxOmq0nLAkQ6rx2cQcAElRRo/\ncUxY2l1U5AFDPZhhcaaBel9/Kq/2w33lOhzOsylSihwBjiCMW9T1o/PzY1uC\nIA1vpFaNDXXZ2+MQGpSwPFP5BLY9xeFbkJgIqus5X4xL/vb1/n7oJH7uEY7K\nam01pCvlqe/4bwM8Me783DxfHePYV8G3Z1VabSmO31XUwGX7swRqq6mooX6x\nYL4uEd9unPA5hsrxNzvFRE6E+dOphAHo3SGiTJPidWVFa2a10+RSiEXGjFOE\nq9kPBKNlYrECp9EhdruDl8ZICWYmkS3yPonQm4NNvUYv9UuxDqaxItwfXP6P\nTeQkGVs6weTljZKYZUi9ez5cOON5qgpgSdqqLLpMy0q/7CzIdae4Rxmn7B8t\n8bjGZMwKP3sklqzZPAEFvD4Idcy2B1osH1ll6RglK4JdmNQX8W21x/j0i7Q1\nk7yrYWnTEbELQLQS0lbHHzRIWikhqoDFWsGHGMaHGYMQecgjT5HaDQouV6Cv\nX0/Ge/XdpB+piaK7g/ke+LfWfDvY/x/qDytZBMNc4J3coSGa0ThAPLeuzCNH\nNtz5\r\n=9hUu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9R2Y6RDgFXExEu3MP5RIPOuTlUY4YT0ylK/wTUJ/BFwIgZH/0cTLEg52Xb5ujt8ZUk5Bc/E/yl6JteBLGkfeQhk8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.69dc7348_1546759293726_0.3494179436441718"},"_hasShrinkwrap":false},"0.16.0-alpha.e41dadad":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.e41dadad","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.e41dadad","dist":{"shasum":"c9f7d46f9529ee85652a7070b39a4b777c14b10f","integrity":"sha512-hLM9RiS7bcPMdinO8UxC4iZuGZ6s008RUvXRSQv06QCy0PIMn/52NmpIQp5MiWFTsWVUpPUxLFcTKcbeCpMb5g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.e41dadad.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMaypCRA9TVsSAnZWagAAAWkQAI7QZ6l2YimC2cFmEI/O\nGmyMqngyZypHU5SLMVhlDivrlQ/uT3+MYa3tT9x30kTIXAAM+erEHzqNN2m/\nvhhYm7mg5ydn17bjXNkJdSTdFqkdCAWTkOGObc3O7AZDehNFioIjkzZ3PLx4\ntJm+w6fUQ8FkWgw4N84B0KHnlMPX63PpSG/lOCGJwT4QUpn0SY4F+jONmfqc\nOxpuZ0jM4hdkocysHGDVO4ZQVjuOJUIWpc5k6Hd0TSHlGfzxVgN+eyR7dYLJ\njeC78s6ag9nWQaVsGsStAY67dTl+VC6ilnN3Uz8iQkXgXQumTz+mBn0Y9MYt\nsafcTnplcdUu46LJVVK5VwceoPDUzYiPXjQ8nWOw16N4HlL0xp0UKRGZWCYt\nDAnIG2NzxBIxGmMAOKYHwKvLcm06BELxA74w6PW5Fc95Anl/0zG/P+kxTN3w\ntB7tQHJ4Rp2ELNbvMNPjr96fpZm904r2mgw2tSdOQWO7/AFB2uRrASfwU+G7\nqN1tQhZaMfxYW94ZLJUlZnSNSwddhNIkEkwicy6Aav80agWfNX8oSP5EcDSc\nM16M/u78UHJuWILoyuNtxEuVXtfd5GXCA+bmjjZVI5CC4d/DMwWIR33WyGVT\nJzKvXo/Tx3B/4sn3SM6MmdxH3qbwzy+R9Y7f0LF9SpNWQh0IlwmEyF3Y7tvL\no+Ai\r\n=o0uT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRan5LgMeemiwRVhUpAA4bMOONWquNwYAsn1CG2kEc+AIgIqpd1+9NLfFc/wVWV3hvzlFRO9KUIG+7GGAcl9NmxDQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.e41dadad_1546759336879_0.8089005804655267"},"_hasShrinkwrap":false},"0.16.0-alpha.1d2b0438":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.1d2b0438","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.1d2b0438","dist":{"shasum":"8ec0becde90607d9d1fbb8f2e483af050f68ac5c","integrity":"sha512-mzVwmD/WCb5H5/AJS6ZX4SV4RBnTmHVpHgCilZwmYYNJ/KstTWAb1pg7a96fAnYQ4HezsJP1hErnQeqyeri4dQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.1d2b0438.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMa1qCRA9TVsSAnZWagAAjdwP/RMEp1mFqw/6IZDNZCdT\n7yxjNNtILmX2lIma/R3WLe8SDfUZ6dCZzqyMHba2PhkXSXJTvbpPrOcdUUiM\n6SC1oke2wmWLPPouN/ag7BUVOLLDw+zbe1ndZF2FUKk00SNV+WwSLH8QSi8N\nO2jZJGw/yjjQvRbo5dPNHb7rXweePAecmxLykW6sBFaxmCSQUfY8r3zZ1TxG\n8vc8wpaV+5Hw5bccleiOHKk+srWpcFy3vSP7b3HabZztD5003yZvbxjumb6K\nArQR5MWBRbJn7klt0SHS2U53cpMNdEojy6+ayYiBOBzMPzfHaUuxMwG4t8MF\nLjv46f3fKIerMu13DW4QgYWqm7uAKlNgIjXSIN6EDKNCDBwYbk4MNm7H089c\nmZRfSvS/VzGSn1mG74lozswy32+wIwJM53uvwR1CZEayK9FXfzyQHKqCxTfV\nvUUgxSdmgSybiBeRyITVzVvabiGlSLu/QFeEusfho3gBQ8EX0D4mT22bjTGv\nE5Fh8H5CbQDmXwcvE8K5tyqRFYd48v4QYY1N08kf9GQdGhIOG0x68Y/Ax0NL\nVJgO684h07ZT1taEHzoDh3RpUD6FP+WhuJ566MhEJnlLupGQOMt/ociGlccG\nf7XV22waRV7M6IgXbjIvSco/Nt6vyF3GhNnUJcHQI/wqa/kpEaTIJSpI1dxE\niNC8\r\n=kQS4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlV5Fcw5bWCMs2GuQcpVtmv081Aa9vhETjeyZhJV8yoAIgFMsWlWrAdPoMaZgbzwc8o8/Hco20zzkp8MCh/pxYDgA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.1d2b0438_1546759529919_0.6448397121540113"},"_hasShrinkwrap":false},"0.16.0-alpha.ea6775eb":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.ea6775eb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.1.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.ea6775eb","dist":{"shasum":"3f9f11e7f09f63671f57c4494dffea0ac88a1e48","integrity":"sha512-0aKYqBo0ykbmVKy9ANzRrCQzZu+9CHqq9IRu0weleGH7BB5ozJGyHoYmAjJnCVgflO1ENKYnVyZbLL15Ffk9Dg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.ea6775eb.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMa13CRA9TVsSAnZWagAAAiYP/2tAfsbXkVAmLPuo8uuS\nlonhmUj2cCPVTLisP7SyQBhmwJkLqz8oi0WYyZzULcLg/HaUylPLBghEistQ\n+ud3ZiVicXK37bcuexceKQHbas0LnmbNdnfAzODqV0gCCFcS5Juc5XCMGV+E\ng6ipyvNSCji8XFj15RBqcIKzdqNvF/Kc2prsNkEDmResOMJ7qSQS2r5+lnhU\njLOjeZDH5jAgRmm3SHFgfPW75vM+od7QXVt0N2kFhbj0vrCpTgJkVthEpwQ1\nK8VCDVImaNlvnAf9qJV49WW0lv7EWy7/04wnWtqi1tjuKEO/mzEmPCIkdYYg\ndFbblSlsym3rV1w6wDEUVfEcczGT1pzRSD7beAISP3sfEoZY7hcCec7RHGoy\nVnksXBLUMValo5vmYzLXzd3hqcFITpq5E+DsKpLPiYAmrvpmEKTmfC87rYb0\nDkjGDN0nZRvQp5O4xSaneM/XLHEAoddA9CatEEnY3w+Fy58pSOOqHHncaaQE\nVdWlicyzMZE3HIV67OtxtMop05T0O4hGitZwGKloRq2TZ0Q41d/AP0FaHw0r\n7ft8h7nupGdScn08Yjp00Osb7GZXt8BB+fwrosbxD03vqs4PBMtUHRNVEdfk\nt5tvfWOArUOnXfUKkgdrlCKzdUGAQew0wY9ecC2cGD6eWyCcxvX0++hE9Jqr\n0qqK\r\n=/iNu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID+KLopn/TICkVn1fDV3fzOOIbnw3prLQX3gvu8v+yhdAiEA/8fClMOTD1WXOd/ona4dYPpmb5KV6Iv7SzVSB3hNeMI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.ea6775eb_1546759542715_0.48962674558054986"},"_hasShrinkwrap":false},"0.16.0-alpha.8c6d6f71":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.8c6d6f71","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.8c6d6f71","dist":{"shasum":"5712377f3a7078ca63d4d7fc7943e8a0b0e3190e","integrity":"sha512-2LTONW6V3EREGOm/z29WujdcOsOTy2ZZWtQSJSLtmBFVqTXH1qo60Pdk3T99T4u7E544N2G1wepofDi1Dz/vxQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.8c6d6f71.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMa2kCRA9TVsSAnZWagAA524QAKTtbgW4Kzbb6xeAjS8j\nOVV+3m+Z7URi0+PQAZyyn8s1+CEHkzSbLtf5z/dcac84bn3SF57Xc/ubfP96\noLsYUgEyTqCYcXnERzC6nb0CvLZdk9AF32hFYSEBbz8ofBwo+hinVX88gihH\ntwpcnxDtJIpETapWrxLw4emYsY2lW5t88ka/Tja+4KH6K5WznulS4YjL5XZl\nuul6Z3lbDxCispsBH7af+6xDdXGEuZDHt3NPFi5GClh0f0dyk0lQDuexXL7A\nTCMzQnKwHjxnr3XXzt0p+pA93APNyHBQBzFjBkQjOvu0zjxfPRfAeQYyviE3\nztHG/6pZh9PTDLBWI4Q/v3J6RKrZ1Noe14/LPhRadBWYBAKjEKiwhQTaYAJD\ncq6nMsRzQa0ugfHiRYT2zFaV+NCYlMQV7BGkaBjvQsnh33FXEccB1uxZEJNm\n99FRN9dzT9eiFIWd1XxOD8HIWZguwgZSRfoM+SEJuLvwA9WbVuZmLrD+DreO\nGnNuAIgbOAsZvB5wZW3OG5E9dosAF/Won84lEu4AKtf8G1JkqRnbHyk9aTiL\nWuYO+uiRjhRDpu5P7llrCItW7J/kSbT6rVHJ42gVV0E4XR2X4B1M0CVHH4lY\nhFjtiQpc0gyiwFpKO/Ocq0N19JI0vNnmN5uXo6l9NdOr9SvPqexYVfgOTheX\nfZDy\r\n=akvF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHcH1H8/JSoc7jyIPzRganLWdSifkvng6QXR7z9XuRquAiB/dI63ZKIGs+1XzbrWin/0mQOtpgrkSq5S2k2UfZbDjg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.8c6d6f71_1546759588376_0.45322315604212204"},"_hasShrinkwrap":false},"0.16.0-alpha.1223c015":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.1223c015","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.1223c015","dist":{"shasum":"16016c65320c8186b529c0e99b0411a3d8f39d85","integrity":"sha512-GC76fn6QiiiviA/Z3r+EYPHCEIsxjgoyA00yujo0w6S9xuElATk9PPoytR8wrjqsxeDwa9kTr4qSgh1FSnL4/A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.1223c015.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMa68CRA9TVsSAnZWagAAbpIQAKJzzG7yDwdktpfnhfUX\nxpzEMmbitzc3+YsreK5eDSgdsC62R5d3d30SXD8HyOXpr9fb0xZVFSfcoBB6\nPUM4hK/jx/7kx87Wlc1xL4JoKn1bPqWnxOp+HoSWOx3K/xMl1voO/ViNM9gN\n+mOyprAkBIXZPqrzpocujwDGVFCl5SophOQAatvJM7y/Pmlu7vVyMFztxArE\n+f+OJfoAPCWL/8e8+//tPsJv0OI5ko5Amc869i6YOnnsID85LIlxf5LJZjMF\n/5z6IpNuIkGnt5LgSr8sXrUi01SHkAqElJ8BB8VCrFKBYgczY4I2WjSjVGcr\ncR/BLpcBqBonC4U2VvrXC7PnNazMWcj/hzZnF6u8F7Eboqk3/HEKHq7MX/BW\nI3qQNKb1Pr1QglX+6jfyZZHq8KSPfB2rAQLnwonCNQbbP58I025brxRAKsIF\no0gH5ruwtdINra53eNK8nxgM0ScX5hRROwPrxhxuBD80Auemx+PI+IllEs9G\npPdBSy/kYPOcj97+xWag4qZbrqtdHKiO+gPAcgASCuCo6BCX4mIkG0xIRoVv\nN9q5vLSg6TbJdh4kN8KnUb6Mlx374XVD03HWrZA1XjofFmX6H4Fv62T7hN7T\nmKzlGfXno9NWTu3V9lVth1DOmTc/FKNyzItjECYmoJ+JwZyPAOJ2JiUAKFqf\nxxRc\r\n=GQFG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEf0/iCbeKMWphVq7SNVuPwnjFj785crBKm1m4PjbJGzAiEAp2Y63dFCxpqMsYqgBRay6Gj5z0yotb2iUzNAOTNZuD8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.1223c015_1546759868126_0.41322488701609883"},"_hasShrinkwrap":false},"0.16.0-alpha.da0016b8":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.da0016b8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.da0016b8","dist":{"shasum":"9e1c44462c9442621d1a29d14ed1a13c07ac2393","integrity":"sha512-K7kmsQUkfYR9BIcZlwYyreAkCKyA/sqlIPjtU8PwlUQJCB8oYCrBunFn6WxEDHcRh857oPWkM1/DiGKZd44I1w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.da0016b8.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMjGpCRA9TVsSAnZWagAAeAMP/3nC3k+WUGzDnCUyCaq3\nEJMISJvwstrdUdGmC0EGnWpjfWtkSoalfZMof7ba4J9zcjZojX92ReDYi7O9\nCz3vMp3EnuS7kAjOXR6ojNCZDMX06XXwfZLKj9WAQmADlKGKHo8YtAD4ThTO\nHIynOXgQmm6q5247jUrSmLz53/Ea/Bx6WF8rQ7nfcWgisMCBlAulbaLb7JMH\nbWECGLACUBjbApl2WJsYXnYzOHPniQDa04vIfv6xYYnyewEAmm8J0Orjj9De\n+lt1p4c4Mt/kfmDdO9DbgB0hcwFcogNjvbCS/A1NovPutKgCYh3Qu1wy0LIf\nRYF16obcKeH7Vrvjac9PXsTIYQ4x9ZcycMs214trPTTvELr1HzFOsIkRVsob\nI8MVhB8aLsH5w/vgoXFaHiOELtqxiG29q7TM7HgknPwXVUp9IODoKtkcBTYv\nHLF9Aqbwi3sTsJhkU8w4uR6jB/LLSbtLj6r2WhS5J2L3/wH1aT1yJRYYMGQz\n71c/RMSQxGhFnfQE2HPlbnzTG23/pQGjyMyepxM/0gsC5poy6o9+4BbStL7/\nj+9/HG/x2Y/QSV4mJTWN1lKJpxavrNb1HiAo2EmUBRu9PdllVHlKqch4C7wH\nnrpKjnR3FCe3yebKyaGLWdoXa4RvMRmncUQIq76VV9eVqRhm/Rd3ZV3UnmVv\n5V/U\r\n=cFg2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC29lBuKiSNpBNfEWdQ4RbRa1Zuay7wB0I9vuz16hqKvwIgMle7cjOwkEvZURGDbgEWyxYk1msOZQBJkDV4IqPF/kU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.da0016b8_1546793384559_0.8675425634528724"},"_hasShrinkwrap":false},"0.16.0-alpha.c57df6bd":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.c57df6bd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.c57df6bd","dist":{"shasum":"20090fecd5eb509b3e7aa99de905a77c5c39a7c4","integrity":"sha512-5GNCerKFkqCWs0SaeOQaGplh0XZAZ/0rpChrlM4+43J8EYAafWgjyadl2x6mxykDua6UzyXurjpx3aO2b2KkHg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.c57df6bd.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMjHNCRA9TVsSAnZWagAArKwP/2eqzYK00CcGm/TNrPEu\nxlXHYwC4wlfPk/x+S5OJsGsdqKMcwGANpI4hcrYfTY2N+duDIiKgvUaiouqh\njk7TldO+srp/DJy/gdmT2yqpPWHa5Fy3Za9JFZWNS1mV8C7h8RrC8K3oRnAG\n9f5PguExiMf+Bfw3FIyJk/9s6UMx8ebb78tD77+Dh2ddbQxcqpcXGF4waRWx\nhKD070q98132jPLOCjVnTe1pgCnUDjDk59Ovdd5LGN72eUyRMGsJrKHhZFiq\nleSaC7yv6xaMHGtyz5qYInt+RNFSpULJWRjEq7C4+Q1eqwrKBy8oeMG791UR\nbqCg5c527d6RAAtl+mNwvQOVm+vTyYOJs5dcdQdE5EDYNXA8Y3hWpr99dgtp\n98hwFOw63fwoOIuVdNDyjEYjp9m8V32u+0iMW/6TSBic8SA96sKLXARM9yQL\n8vGojmCmE6RtDHMhp2lMLpkA6fb7gMNpgr2hCwz3YRklBEtjXKtIQ5LJkqbB\nqKSc3Ka7WAJ8aTtBrAsmsjP330gm32em1R7J+lhkxQ+EjmepXFA8BzJcDhNL\nTHHeoCFruXopwTaDmt4hrncB6/WJa7mCKdU4QPI36iCdkrfzU1zkp25SHwX/\nhmXKPGb1mMTxefoBlPOKF7uB0EAjOMQHhZQTKRmkUT2TRVL7Kocttin1rKQY\nsKlA\r\n=F2B1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/NpG6mFzYDCmO78DJ4Dm7Q3B4/mmwqCc+S8WF1by8+AIhAOoNiiRyiRrO2Td83KtGNfJrt5r2W28MXCT6VH/bgDcf"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.c57df6bd_1546793420795_0.7745564180715161"},"_hasShrinkwrap":false},"0.16.0-alpha.77ec33c1":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.77ec33c1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.77ec33c1","dist":{"shasum":"74fefc8d55b33075b98add13a77d841120a639fd","integrity":"sha512-ZP0HUsUam6tYEBEzZcJun2wlsFve//9bTl5QkA2uFx0wbtvBW1TZDc1O4hm1DoEanqci3/3+7iwU/EVFnOrq7g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.77ec33c1.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMjHZCRA9TVsSAnZWagAA1TUP/RspwgNcypsUWKbPb9j2\nljaCcuyKFIvMetrCSVMslCCuaxJa1SYzqa3KOytJ1Bcq/5GYCbd6MHO++rNY\nKqMc2sXPngsfOy4qqKrnhW9nJd02TUOmjibPE6VHSbj2t+gVR3TUhZMalWbg\n+TuWhUuH77F3FWXWdXNrB+T9I5rVK7SiVdBYw1eMRYxF5LEzhIU3gYhdTTk/\nXQQz523G+CecLUIWVQHlRj8eMP8r8FK7QbquYlLvoMubeuZVushz7IEtP3jn\nOhUkjX9zVbAc1YJ1KSfLytPdxzn6gjMN6MAXx5rAMMF7VZ7qEHeeKi+mqA9S\nB3QBijTGiO9rxCztBNyhFCkfg2ggi+CKWvNYfR8OC3XHfhu/S0ixQ05TlC8a\nsbFUqPRi/wHX7vOBXMWhxCbSQjsDCiwtId0hkaoLaWQ7sij+tBxB0PyiyrOI\n9OgNCi0rdOhYKzqPji8/uKaIuKD+W0CNXFjdC8i9Suj3Tc4huAGVCvMwANRP\nZ+eqSA6iAFCtHhTMAGSPgYf/H6YokvdBiKaCbALYVGFsLNSLLXnASqgB8iAz\n0L4ggBDV6P1TH2vRc7Nhyv+cESwbtdRjAM9hKFhtfeav9Oy3YhdNv86nUwyz\n20xvQPaW6xWIifIlmGRNNCpJpeZdCfC+08eKBL/IEVXsfIHhrUjStZSPnkTX\nVr7m\r\n=H3PP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCY7Wrj+kEQUojntHG7g2Kr9XaPyu/8ZKvVEQTWQixZRgIgFObMJXG7VMRW1XbQ4hLDbgqxPHQmbROlnZwsxzCC5s4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.77ec33c1_1546793432345_0.3992531250205562"},"_hasShrinkwrap":false},"0.16.0-alpha.66320bb3":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.66320bb3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.66320bb3","dist":{"shasum":"b6a10a79f6025bc60c1e30bf3dfaaee91326f24a","integrity":"sha512-xAk8EhiNzlIVOK5Z7pSQMNVoZEvDtLR2sNcLzJf5t/eqG/O5W6+bNGNfG62zPbRulW2tXuvlWuhX/uKxyzkGeg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.66320bb3.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMj7TCRA9TVsSAnZWagAA+HsP+wZK/vZRgZIG+FUCoPrk\nSxDtu0bHPxNku7hmZaRL2heYtd9zKnNbm9/YfeHgIUwEtgpNGTMYFh3ORZgN\nVb5jv+fLtUV24jeo5Hi3m621dsGm4fe4sYMpl6B6cTbd68131Bfyxy4tSNFS\nOI1BTFWa4KSMFVC0TAG/9ylaectht1mK9BM5PyfHe13X/ld4ZIG+IJ3xhtMh\n/lqqZewmEKja7pfeDzImtWs/yK8KWWzISmMmRwbZA9wzooRXF25RHzFPNCjY\nK1HyohAzw0DCUr9woZEzCYvhVcQZx6HgiomdDk2DxDWj7pgEOCiu+u2BO/cS\nfdKq2YqPG/acP1PR8p99mvGtaspUYb+lCUIvVTvmQq1116eUR8YgX2e3aFMn\nxVwP9BC0JK6qlTOb6RzTNIMnFlbhDh+rRWURrgDtRtADL68g7wBCRyfMIog0\n2fvN3xVXZjbjA3rnaU3I0Lhbv2hMbScKrS120xldId+O5MtwPZ2LPNKl/Pcv\n7xThlv1o09pcHDyu3YPws7AyQVWWCgQrt4uc9RqWERgfkuBwZ6ymxRKMN/Jv\naDsRPEi5GxLh1+f4X4PKQRF7+pe2wxPlH2PvDHZaDTndxIg4wAqQYVaAfybq\n5QetR5SKgMddzzYrBWosAcF5e723u0sOpGhUYso5+JxsAeE7d+2P7DAmfFcI\npOO4\r\n=xzls\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBqhqEUxKlz/eZC9YwXzYpJPtN3G670sILYy9LU4mE+XAiEA73kY0xUyU1HOkLhzp5el3ICE0lYJ4jjhAqL3rQhyOc0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.66320bb3_1546796755107_0.3448094973142586"},"_hasShrinkwrap":false},"0.16.0-alpha.c4758f32":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.c4758f32","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.c4758f32","dist":{"shasum":"ded64029e17fa66ab2b3592144f0fedd060fb71c","integrity":"sha512-1ajWDk0En9MziESNCtBQGbo0Cxa5GalzA64dkYNixiloSqI5duQ6EbcEJavdQ77DfcIQBiIKrRUpCZCg2+9iHw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.c4758f32.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMj7gCRA9TVsSAnZWagAAaU0P/RHc7Z6RDisTeYAQNiwU\nNHKrn904ifDKbPHPADE7dmhY9Uwg+++uA3iW1UzLOBsU4HgnDF36Q2cUNuqQ\nFZMEpHWccUwgPjxZgHqPMYgSdM3Iz0iSUnUItHpNSc6VMADXxr4FKsG+0xBm\n9BC9yxQNuhGkh3jI7b8GvCWhaloo2ZYDTTVAKc5XB/XITKX6HOJeOjgKDTVK\nqbfJpsV8LKkojv7ivPF59yyZ+na+3OOBx4GVN066KKtSkhixYM/OxjGSmMPp\nmj7bcDawGVE5m/RkPJCQsMz9U858UKC5rt/wS6kSFzVXaFeweqJYdcv0meIY\nkhwg/2Co2NnAhqgoDrdm5Mi8vaflAmCfzZoCExr1UIq+N+9jAsrTIlOVpNgS\nGJA4BoVBOpkcGfDkqSz89kJLuwkp1jO1Zc0UMrKw/LePftafcuWUigopl5l4\n/wIQK8gegia0q1qe0adHKfl5jA4++/fJFLyUW6MDgAJQlA348yY/XF75TVaq\ngRsInw8JG0Upnwfu8viJSgIz/C4I0dXkGB5vEfa+2nynkWJOr5sGmGKbKdZn\n+HikwKmpv/XHdyziAtOQfFoTl8rp9quk5HJl486elTqOwPS71nHPOd8acsDi\nVBcQJACMH/c5H5roTUo2cSPQmfqRHANpOOApLfWZAAf+YfXl8ih6josJl9XT\nTY9W\r\n=Zjcz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDfqimeJpk74H096NiQhhU+uUfnm9f9q7/fY88QEHxVbAiEAzxbFehqnbzEMHNJ/AMwQlyzUjin+QQ3Ciaj6XE+G6fA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.c4758f32_1546796767285_0.04827128289838334"},"_hasShrinkwrap":false},"0.16.0-alpha.4c0f85e5":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.4c0f85e5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.4c0f85e5","dist":{"shasum":"1504abb63af068febf2062a0c530ae06470a0215","integrity":"sha512-rAQh3y+ggpopDuKoijp8j6yNvZDPXDy7e6Vr+ZFWfzINKIcDLBrBo0Aaa/ooN7xoZ+JNlhXcH56XUyFxpjALSw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.4c0f85e5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMldtCRA9TVsSAnZWagAAk9EQAJFchZjsPUluNeG3EqG0\nytO/lqB9IHC9OaENJwwpnQigBsmGOXIakUZ+xZAHkg5RHNv6U0mTGCcmfTPP\nTzssZKygVykpTcFSkF4cxO9lMSbNnzuqed1g4mloqFUPWzNtMNzQ19blQOAQ\nJ0Eo0oMeB2NKPzkgCyEsA/iKyR9nWxkZ5sLCTqYa3SRwM3m7q90V1BX6yJOt\nae64Z0Vnsc5Sp4zxoRDaX19uK9DT7/HkCgbgRGZfmFQV2LE3cQQN/eLwNdc+\n8nYFdCVRK37Plwkt3OMmlrrtArZNG8PAyJHM1bIwpKyMphCDxlej0vF+nn0A\nBNZGW7se6O4/G1NyxbFIqgYcPc3LLHnNoBykrCRuy/HdVuUFocV9q92RJ9Nb\nCwBmK9hWE8B27/cbpb3mXucYr3/s3kqFrYADUhI0Ai6k0zbTk1Oe2fwir6cu\nSNys5Z5MH8Wipiq8nHrNySikXbSTH0CLClH826fXLee5KWZUug6+JDFYgIQS\nOTc+gyB3V+4kuPGcvURegKx/BveCPiOrq8GkbT40fB3YcnEElPrzPtn45Fp5\nhG/OH5cny35AFa3puWud2VULGGwwQwC7FlvGkQ9bP2G4yccD4EOC/RAbfLng\nTHv3PicdgMkQPiAci1MW85VROiiqIIqL7jX4tTrbgfeddXPYw3sZVukefiSi\ndCtu\r\n=zhpX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICZV76bGDAcNwuFK24cBYQb+Mqj3UHlyTXYDHvq1jjaVAiAOs7boorHjvJH1OsGF4VIYPP2tK1RrxZVPL4s7se9KUw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.4c0f85e5_1546803052706_0.8564678469149836"},"_hasShrinkwrap":false},"0.16.0-alpha.502e9d1d":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.502e9d1d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.502e9d1d","dist":{"shasum":"d5a5e3efe47f45058f7be52f3f304461cd179759","integrity":"sha512-u1WiXICJtoPCh4KxUx2/Azls3eXI89xjqoHj+gHni3J5C1gCp5Udpu6RfKqKXvuEI3dOFOrTk5zbTLYLPq8p1Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.502e9d1d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMprzCRA9TVsSAnZWagAAlfIQAIHzK9Rl/8Hpjdt78mXi\nm43Z8UAF/MtkQHgpF51Srszo9sypt9Vprz27B3SrJ+nNwtReeVhciJslA4KP\n4mUaipkAtka7NnNl+Wp47MVZ+Hh9x99OXagU8qjO/7umFlCyv4N8U7kg6wVY\ny8kfP9Tl9VqBrRNz7gvUhMWXG5A61OB7upF15KeZGXSAh01fJaHM4m/i0+06\nXWkNG0JqDh7S8n6QMj3mvL2SSn1d+N74Qzhnya/AjMOpD9WIvas69Quo/H/m\n+i84d+5iO/KQMOOWJrMuOF/leQkvC9tNCuS6InNXGVZeZZu53sbJ84gNgsON\neJhbpbEsM9X+gtHbkuYDgOqER3UKQnjeu/7SbShbYtn9ZO4c3Z192eUn4g4B\n/KCuB46DPkqbBSPxvoyqZNX0Yjdn7BdpF/LHtxbTwAu8gOSDBavzWF/Z24z4\nZ7fbLDk+eurEgsUDkKxBrBr9it5nsFuDdmgNAQKhz0IC0Vbdx2lEj5smxymu\np/SAMIsWRKtTM6xs8Tq6JG1jLMdcFv7qVcN/HNoGfOWI0fIve8IncUzHmC4A\n0NElPf588g8J/q+97I4AlY/CgSkQ2j0wZlqbvfcFU3NoXA+FsBNpYNmIYecI\nlzkpOzovGNPsDbyrLGPS8EftEkVDB45i0Ci8oS19djRPseOnV0sO0+bCqxC5\nZGIV\r\n=+Aum\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFW8Od+kwRgjf7rM0MetD6KmYKbYkKYgHI27Q493OWZOAiEA+0YigLEPOqX2iG+o6ybG3X8TPZUFVSSawui17esNmaQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.502e9d1d_1546820338286_0.19178912054455788"},"_hasShrinkwrap":false},"0.16.0-alpha.ed2a5f63":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.ed2a5f63","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.ed2a5f63","dist":{"shasum":"c6d548794f919c3ea51b28532f66bd1a237ef61d","integrity":"sha512-R+mXbtt3wJBkrhb5IRimWUQ6kDlDyRhOvAsI1hTi/UVLgEUD9xBPILOvejF4musJ7hOzaGryJ+7Y9WZdkuGJKg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.ed2a5f63.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMv+mCRA9TVsSAnZWagAAoboP/jvud9Z44Fkeph3TYhmu\n4Q4/DLfuH9T1ZxksVx3q8zKut9OihYRnf9A7fbNUC4CQAZnDxA20MWHofkPG\neeDGwxpbXmiSPK95DQSZeXBZAkc0uYeslVateagz5c3qAJ49wHdgATd9qIKc\nfbQcXLpvje2KIVCHgfO1Hmu5a/HzLGxnKJoPw/xndgocCDbyHXXhE1cI/ZZ4\neAxeUVy2qgjXN0SwOvjC/jaylu+9uOIULpwuZu3V2E9R/UyDLrL+eEqa8iUx\nyEuAMSh9mPBDHjL3DIKXLcYsGar2gJWEQqUZb3dxyRQzGPjGc9/qeluhtQFX\n4ejbmzXw1CI9GF8OQJa+PbGUgr4snp4bpFzdxQL2DiACb6Kofg5cF/+tcgg0\nFoZW5VZW5yWM4faYOc+IWhAN97JBOKOna3id0ql+5zlM6YLo+QpQ5aU++46+\n0RNM0R251I4DENho4p+HUymvG2/FG7rawO/ljP4p8X90ha91RN67P0V7nq9t\nWWgSEzvIxEdPIt3ZiP3Mtf6JZoFSwf28TViuCkcwWM1LpVxCUZQBw4qRWVVG\n58cCiK07/JPWZzyeMzABWC7gGP4BfXlEQTCCYB+EsUMRIzg1CZFWopM500c+\nLfDcBdDDbcVex8RP5MAxkzPwQW6VebtsckPZ8TkCbyJrOxTxlvDmkSKlV75u\naxER\r\n=oyx7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxBQggleZfRpfmQQK4J9qwv16zjo91lef3KiOL78Ya7wIgcIIMvILxitTHfLdaz0BuqjnTbH3dWr1SDFqDZb6szJY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.ed2a5f63_1546846117737_0.6241559592887302"},"_hasShrinkwrap":false},"0.16.0-alpha.791e236e":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.791e236e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.791e236e","dist":{"shasum":"f612a597becd6e53af1decca833cf18166f49074","integrity":"sha512-bEUHFpfmeUf2YWuBiM7PRt/27UdCmNeHjyWnyFRLMZXwuakIqG3ujrSHgHfeDlZV3QmwPHKGhhtsJ7ICa69C4g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.791e236e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMxEqCRA9TVsSAnZWagAAu90P/293qatZ5ufjjYYSD9Zz\n50Lxojc6JTDuJLdU5nskt2d1LlM3TAMCrqVJlGTgTpd6ZF/UzCkkcV7pKfci\nCdcQheD4WHF8nPkCKeD6ABWMg0y7OZtCpEb7dW27vFbqXKcAi+LqPfg9q/I9\neTYbMSJ/tf0OH5uRv3yz61KMtcYgEMjmkSsdHieoA5I6lqi2DOk/kT1dYa+6\nZRih4ti/z5hnIPD4uU6wYykRzRJl1sVuXfr+gUsL9HztcEI6qDx1bGmKp3ki\nd+HJDkovWWuhPSb6ipUs15/XibOykvAroI2oLLAkxMBXTVwECRIxKI4cUDWJ\n9u/vqbI+VtjXEEdZzZ0Il6Q3xg38z3pVrj71W+Y/gcCv8Iz0P4Jzax6DPB6g\n6KcpJW1q2i2RBtZIPaILIguRxxxM45bojTs+QzzCkP90VYkeVKamL0lvFj2C\nfBQhQsC0sHAOqQkWDOMl4SNPpqckfRfKnXMRFJ5rnkzKV2ECxMngd2FabChW\nxoDmtX6aJEcKvVNK8Sb8jvObrdw+KPtX8lVcr3CYOxdRbK2Y4yaDONWed6SL\ngtqj2ZBSriJmlEdhqNwWMZHqdYPmG47XhOvED7iC87Qle2KIWt1PqsSksaAN\nJyw77d1bUFGEXKRXeL5VidXWnmCDHprZDHa6e9oTafakFUgSMojfGbYRh/Xx\nhz9c\r\n=vo/D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBn+NjTCT/RNYAyVfoztd/IkPyk4ZbLWw7kX8pj/55aHAiEA7000FGIUqX67g2VNTkcvBqlB1uh5Rtdgu+0oI0kXe3o="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.791e236e_1546850601410_0.4435329308047875"},"_hasShrinkwrap":false},"0.16.0-alpha.9c21de95":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.9c21de95","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.9c21de95","dist":{"shasum":"43a5ee81c8e4dfd91c60a3f888c83a4c01a79665","integrity":"sha512-Te1+PZ4yjb0xqv0tFva1ldDqYMIwCLnl1gsXQyQ2xk7i5v9SqOvbbYZy9ns4/6ehf+93Iimnfw2a/o62r8chTg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.9c21de95.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcM6DpCRA9TVsSAnZWagAApmwP/i7Eo7nEEnyo5CBSpWYN\nzkOaoD1RpkMvR2YgW+/Hd5UrSs6pIvhxfBOmPjxMyohFjmY8GJJsRKgyCBaY\nR95MysnEx15QRJcO9yKgZG9ehx2QWC1jymDsL3ZjNA4/9OLDbh4JVDlsn/+H\nkZ9+C+Hwh97rZ6dGyJNrTxRrFYKgPeKkpYZb50YjhqjpNOhDv0wJvU8ezBjm\nqpxQNqzWZGr2fTDs42OcB/k2uitR4VXiOTxRS/Z12vsRldRW0qyTevjE2v61\ntcr8cVbkhhr3g+YPG5QRh9kKRaPRT+L5TrQo0kczdSgUz+HYnWBN8H0RCkhy\nZMWCNF+kMqJ4e1ypehyDIdPhHr25VXcK3qn2BNSUr5LHYfJDlqRqzbVqe6VP\nE4tkiXMrkzOQErVkKrUT6JbK6q/HnbrP1id7Cm2JbRvNgLA3ei+mswHNeMZ8\nhHtYeHqRBNQbX0YFqQfISxT5D2n1xGOyIwIXguFnMQY2QTcxCrGDkWpZaY8B\ns3PKtbKOMnFKYkSAu2TY4MUURPYKOGpp3jHurSJO2Mkd5vqfckCyqvXLhvG0\nYSlRGkYY/rAWTLGThWcQmQjnAcToum5vx/xbt5I9Nztv8Its9m9lc7Ob0Zso\nBiOsRcQKp+O9B2IJ6XahtYvBYJXR4swPkPjFWJ1EPjXNkZblwBv187V+wbwz\n1q4Y\r\n=Lm41\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBISwg+EfsCJQHPAubjSrg49MPO1jgbqGUcaI/LyvX4RAiA8uXSQa8AfYwlbgTphHfssH5iGMRd+AsHY4SqZLbRRfw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.9c21de95_1546887400872_0.9443952478047457"},"_hasShrinkwrap":false},"0.16.0-alpha.987b244c":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.987b244c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.987b244c","dist":{"shasum":"55c6eac3f268f431ce3666e59a061dfd5f89f8b9","integrity":"sha512-auSgz9OVjPFi5YfVonJD7MoO9V1IrFqAT8C32srsbRqNoqZ/tNBxD0OXDXZgBpVnfc6uP6DrwkviVVBE3O8BJw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.987b244c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcM6D9CRA9TVsSAnZWagAAy1AP/AvcAbLLiaTyJzYKo35x\nZP42XEgRovAeefN+Af4JxkhaaQqtbSDB4kDpvO1PaLbMbVh6MzP4xHoiIA0/\na5yDEit3gGIkeAu0Sn+L7YBhlOJoYPIYcNsdVPw17Drlj7si7Kam81yagPw3\nJLc92fmHo/nl/GuO3B5gK6qIOJwJZxWgGS7jXJsAD6/2tnUiIVYCC4E2e3KY\nU1XCbna1Dyv2fMq7d4UwdWSKtna8ffmN0hD4NYSE3UtPA1w+iA4Gi19PSiL9\n76oQbxpiPwDrDe1EPPzXxJm39W4sZtpABXdLWOdXX6KwIfp25cfOMPUOHwod\n55b0cdnM4K2QhhVRKm6e0YESWtqHvyFdoRLKtCuU2n6xgpzTzZjjrC40tSS4\n/pwSAyExMY8UnA4TajDLtGY5JvhbaxpW0QI8yfg2ciKLe0PFVimkNmbcMjg8\nfJ/SoyXv3CbnTHDW+2JIuEEI5gz/ZDm1E+7jE8vVFo0rmlGiVz9BSuIlxKJh\n8g9Y4u9trse/vXWQ91uJn1P3Y5z+KTvWdZ23WQvS4roZvBxnEeFcifa81k83\noGEzVMTTKlLvQUYDfrPS41okzLURrpWG1ZVoARMz5Z6wFtOWXcdX7fEZi3yu\negs0kHazFnDJwO0nKD6mM+J6FJgxEMuiuYPr4UdKUW54pppPyXgRlHWLFBas\ntgey\r\n=gKsc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrpdUi4ZLs/hy2APIZj0yITiVvJQQxrjX829P0oP4tsgIhALkqoFmF+QM4ouuL2VC6DvvJ9DR9gcHxcIprkEC5EwiQ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.987b244c_1546887420965_0.2826689344500306"},"_hasShrinkwrap":false},"0.16.0-alpha.68552079":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.68552079","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.68552079","dist":{"shasum":"89d6c3eb6004f89895f1b469d1dcc4fb378bf3e2","integrity":"sha512-ic1C+mbECRaY9m9FWmlWZo28TqSKgBYGVWjFGzePJ36ZQtXFmmBHcw0YwYcoM+F/dEOtfTcSLH0TJKg6dc2mdw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.68552079.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNm+CCRA9TVsSAnZWagAA49EP+gOJ3p92azZ01qez6Dw8\nli1UafwSANDYycMYWGxG2YWunXAerNLCZ+0UoFmoc7fh0cu/ncMGz39Shc3h\nK3Oemt2a2EPuFTS420Rqb1XiDj4HvRmn4Qig/eUxqj3kw9A40Uh0/L0YPV7g\nUpetx9CDN97Wt58vVyTS3E1BcgnHkaBVUnGVtZ1Az/jtXAVqVF5PqNqllswB\nYp0cHywKWBzuETrG8R7+5fVXFiTp4RrLCUGj8oZCN+ngXXRQ29BZoSW5TK7y\nLtV+Hxr1qj5I0NT7RPWIVR8XqzTMQyoRJez0oarTvhFHxQwpo+lcPvMge5wl\nSAjdgUZ1KhpXDNjkkC7/sUCQ8k9nKL8Iga6mLHk80CWZjfJNVCJHo8TDKY/P\naY8kLpLT0uJdlvPzlAld83b4ABxKbjlE0ol4g2iBJZ8MEt5SwEe7nRjab/kM\naXESti2I117FB8MVSw1iY13Ijr/h6WANC9Tbzy8Qacqq6+3X1SzrJEJdoFxd\nU7CgX6gmqMyrr4wEeJlE62O9YusAAaHIIrqDYTtEdJ9aAI5LSQD5aZASBv+D\nQ7x6mjWY2wXccHnsc+HcQgy7SVIxkkS8ViVcs3iStOHq2NUQMVOt8EWrsBzz\nSwzKfi63P8017B8QXmr5OVgPT4wayrOLJKD8OMWowxR8sR3sl4n7ItfNl0BL\nCivG\r\n=V0SE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJ8CGiimD9P0GBFNutJVHaPJWsWQ9w/FI7tf6eqeOE1QIhAPG0/4hPL9h9FmEw+m1XldYV3OAExQ9az1t/+b88mLLf"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.68552079_1547071360937_0.7471815788320395"},"_hasShrinkwrap":false},"0.16.0-alpha.af10243e":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.af10243e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.af10243e","dist":{"shasum":"dc79fe45903324cf357904119e7b8255a22f7d4e","integrity":"sha512-RCwavgIrksYl1ThR6Gwr1wvaiWBVTEXBPLH8ji9YHu4ulWxtcUprKXCSyOvNvgM2wsqHm6kkdJR6E8nb1jTSxw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.af10243e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNnsWCRA9TVsSAnZWagAAF1EP/3ABcM6UUsV2hlawe3fL\nEsPsLUjyBvVRvv9LY8AeR73ENaD2TO4R1NhG4hYP3bzWBwz0UJJE0FWXd0in\nY8id+4m/8gTb6LVqexDaoFsfn/NVOgfAL7LiuHbCSF4JhKYHOScp5u9PeMJd\n2vaUem1LvlD3Pxl1H37N7Dh/IhVpPYX+mj6YU1LMsG7RzPSzePcJseuhwHUT\nAPZRrzmnt/3zT10v7+SWP6MHWylH/7DmUnumPO3PNiIFVFZKbf7c7se+lsr5\n9Fmu5XML6rN5nN7naLNnOd2qt0eQ6wfPEf4pnT2TDD1KmcURME8mVuqeC6tE\n2lNCyDg9xuIH48a5FqRempND+C86gwBfcec7gPrxL+Ber4lnIo8t9x/SG2gO\nhABtTKKpvVuTp55rg7FEs2mqf94STyGYe+H/xC3QgDvO15qaI5nNUaLvQi3m\ncYI0idhpAgy7dglsY53iQZXXqrKTfpxnArl7bA98JZC0eX+gh70v2KE83KgS\nirCK7m7+nsc00vm0clmHP0izXTKKE8SponWRtpb3FFJU0V9d293AU6ilxadZ\ncN0xL/AiOOa5g3hWBO4tOQwLEGl6I/vuoej09DSvWU70NaOxVmdXE+VugdOO\nLtygFKEpTroWzulBqEcStkHiDAScAeF17AP0um9YdFQlXl1dJGHhSk8Ndodq\nAlxb\r\n=2cOM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZxLO+8he7MdIij5L61AnZeV2lgXzrj2m2AyBcPLNaawIhAPWOQQnn9kPQhKAONiqe6M7/U8JPD5juoZYBw9x0eG/Y"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.af10243e_1547074325649_0.7856162989183193"},"_hasShrinkwrap":false},"0.16.0-alpha.a099c8b2":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.a099c8b2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.a099c8b2","dist":{"shasum":"460a04abcafdc6570463fea9cb3f3e7e7f98a7ed","integrity":"sha512-imnZDktyE7KwOYVeAewetjI8wNyklaAlRUAr8wb3BHv+H2jveKUISG78563vyYKH9X+Ox5fFMwAO9Iw93Fym0A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.a099c8b2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN1BHCRA9TVsSAnZWagAA9YkQAIn12eK1JIUS/Zl2hzRH\nuNzLe9bGC5msZvCI2MnfwNQueVMDKEge6uFlLJ9LitElj8B3z9BeUtlanhdg\nljjKQaFhkP/UjZm4kRTF1yj+tbUYv60mZKd91hD5qwjYjoNgHnUYjTOMhTFg\nTF+m44VlvyzmcuRprQIxfDidi1OE/Qzh86qGZG2Ds0kc09fnr+KGsIlN6RE1\nhnK/nvD2dUgM4dY+k4O8M3KivYR0eI0z3LC0pmyJSN0NvMwFE0qB+JyuUvMh\nmj9g/O/Bbq8Pp4rJydTBQyyvXBxIun9AiNLI4A1XFHTR+wouGKHugasZJDst\nOLMF3sGNySxKMMZVFNap0rENA1cjO1bM9tNMS2ElUAZAimELpvTINoFjAuN2\ndvXNR2VM61tqTS63sbi53J/TFdP6bdfJF4sdcDfqagYJbn/D1GHQTQKaF2oj\nCv2voxlT1LgELcj/jvKZw+9p/EDtUmMMkyA66nG13S6saaMo9NdoED4mOpG9\nUAH7LKfgbJJRYwur6Ikm3LfDPHqzN6r+fETQubY90OmmHTxwewTvx9+H1n3J\nVQ+V3uQcjsgcw55wo9oY395XHtNsuIfZXT6TspkJ9i4LI3DtdESPTxTPubry\nNd5OJ+kJOIHpvMVdT44gjXB9wBmwalcxHZhOyZyf402ObWyLsnHjH2RFvwuJ\nT19e\r\n=sWK9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIbQ6iRVx/bYrrL4HMJVkj0pu1pgZnsTBBUWCSc7nL9wIhAMuajmNW3okpbaNt7jGyLmpC7vYDMFJdQelHdWNMJLlE"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.a099c8b2_1547128902909_0.1402751991466351"},"_hasShrinkwrap":false},"0.16.0-alpha.888a4e39":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.888a4e39","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.888a4e39","dist":{"shasum":"0815c220c32e05ef9e5dd03347e4e70997e774fc","integrity":"sha512-B2AycgW/04gjyBA6tTHvgYOiw5uxdjt3irdo7m4IIBXR9A7F1OAsqMJalRzYi5mimH3/ka2XuA5kx16YwtGzuA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.888a4e39.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN1BYCRA9TVsSAnZWagAAn2IQAJpqbuW8C8cahJNHPJBv\nPhGKrCnxzvHwzWDJIh/Xyu6mkD+BCs0EGHPTqzEsXinsvs4ALLMSD6oEsTc8\n+eWCipa9FvL3lt7dBFPZjYuK5lcFJ2gRG/ws2hKMNApkDZYgRC6UqRfqZweP\nHYOvfLRSChRDOdn3a4bKDt9PCPrwY9wW5KYz4BtH7sk1V0DjWjH2Pseg98NU\nfHFURvEubaXdQWh2EdWF5tArgVz+Jr6yxNRa9m0YvjBbgw7541o/EgJIl/Rn\n5/2ebF3yFg6kzobFTgxqI7ne1Pu169Jv/h7Py6mLvPpa94vnYIZLLOi6blXR\nSv98ijl4FxQ+FTu2TE+5U5r859GLaIdeFFKNnjBXKhtLS0huonFu2DPil2c0\ngSlIbso0PYNKSjzWD6E41vydCW9CXfMS5YHnNyRgze0Hlk9CEFuoldo/oQSr\n4GNeCl7zlR5JLG6jqJQgxev05uBeHmyllvTAcxLJzbyQ43WDN3MSD7qCQgRg\nhDJRbBgcKqsJqSCqq4egRN2o2j3sm7CQm8finaMmbfVa6KYJ8rLXVEp0T4A6\nWvn2nBUVO6z1t2/uZDCqK0ppSOO+z26PiMBn+dZZ6AroRzMWIvpffDYrKKBW\n7UqFVZClFVjD/Vp4tBfWimxpUF9CtfF/0Zfdl+Rzc2ox2tjElVz7SoYeL059\nlESB\r\n=CqVZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBN7XMeHyc5SnMUvwwvxnAE8frZhkbenepzFjQ2Gzsm1AiEA7qyOiDNmdcSrOKcVzlturl5dhCye3r2eEETwK7UDexo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.888a4e39_1547128919648_0.2900316591325758"},"_hasShrinkwrap":false},"0.16.0-alpha.2117d0f3":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.2117d0f3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.2117d0f3","dist":{"shasum":"cddc8097c89a5d16986c894af544ff1361902c9a","integrity":"sha512-f7hDeJXbUTBwTJr5KSyvZ79/VD4/UHyjqjOCo61+JqP5jeYbky23ylxtBjtnbT/wNZzA5eUazulJMQG3KROFwQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.2117d0f3.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN1B/CRA9TVsSAnZWagAAwgUP/3OH2ZSAJs+mrBN8UQJQ\nLPqbV2g0hUTn6DmpJn5tJzzjRslJIhRCJ/JjoY2BBLXLX5wiHIgp3iwxicrb\nG57/6iJ7aMPbmOCBzWiXUv+6VuOysIMlljhDmlox5XahM+IvZA3lPn5w3+9x\nvaWUiBCT/NuHRMafXf0xvq5uAr3DUrRxjHNj7pfIruZpZ9JN8MEOvJrZTevA\nOxhmExBsoH+CpeYMWUq+tszswWXg9zsYsggeLDfkB3rxrzV3aKskXas1jTVs\nU3BAOMVcPvEJNUqPLw8KAExGc5rRLDsdXdR92944/ZIlBC7xYLvf5NNdVubt\nn8bQXNzG0ngK+jObVHqm/QnKpi8kS9xOMd4vJPNl4GFGcfRgSOck/wpWc1CQ\nS0SET5BS/XPpKIisTjOdnl6dHNvZq+AlfO3ZYRSf1+9xgOpX8oaFRCBhBjzM\n+eHCw9jtkxWO6EM6rDXRHw4ejECSg/64HYsDduu0cD8bXie0cyzCAXPIKCjh\n64xCwPoGL08NJkJThZadWAPzwyfxnuzrjoDmOBCQK+sd3njzLJEMabXfiQBG\n17Z2NzNjOaXTXjcWMa2fMc622pip4qCoC6WA98u1hl0UKKEy0LVWZHRq9D2X\nrjK8lqwMBQKpZgQFyv98cn6dbdDIvw6GEUG+LafgpzpwAB+JkwJJJOGwyptI\n1xAK\r\n=Mnbv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFhqFcPHk+e7AVwX9FHz38U7xbOtXKF53Lgb1dxgl02bAiEAypt69Eaiq/SJyd9np9ChoSqHJvHUzWt/Frmp+TqkBOo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.2117d0f3_1547128959220_0.545852625495878"},"_hasShrinkwrap":false},"0.16.0-alpha.0b88eddc":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.0b88eddc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.0b88eddc","dist":{"shasum":"4fd497709e3e5a61cd340b1a180d847c2a1a68e1","integrity":"sha512-1SsAeYegPHoFcm0iIqnnEYKkRd4gOL6WNJfuD4qcyfPpKsjtgt8SXJzqziaKaCHNmNRCU+Qsd/g61wVg1AHMdw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.0b88eddc.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN1CNCRA9TVsSAnZWagAAFkUP/3BPMDLsXZELPDa5f2RI\n5672oznu0lTghNEPQJ3dAN5ftlEkWsmfF2ZzMRctq41U18fUcHHz8a4gM7qR\nMzUot7lr36F/c4vdwUjU7INVyd+6le1DGRWFHWWRJrSh3rxPCi8Lkua3PuPl\nPyB8VkocEAFIL2Kbiq9DcJ4kyGJx+jvpbE8h12pHjIoSr0vWc7aedKmKWJ0l\nWQ9GZRmx/7YQXDFOzzn+R1oUprdo8WGFD7twIzl1/LCjSALZeOB6zYw3HKaH\nSnQxca2wVH1xyBVtsLEYROm7lilQvylIMuolRb92CjotGb3/plAv1RtUs/7s\nEtG667Jjg3Q/4AcdkttRp5qWFPB8raV90fdTi1elut24KNAFRUxUOIP+tSQa\nG9ByE0lsbKCo6omZaEWYjyQ367ZvXmrVPMuesOJyXfXbF7/dHS8Y7hxpgHK1\nLXdbYmtdQIpwKkIcxMwREqNkCJ9EJCygaX0epxU/Jhc99ni9PgWfrkEVJHcO\nnrr8cYVBuzWw+D9Mk0tUdujkBzPGpi6rGh1hFG6EZnxHHkkJTe1dr9oe7yY0\n1MG3I93ODCETxLd4z522mNQhS7Kc+Whg09F0XY21066MrPMjcWfbN8tvefMw\nM/ttVsFmfjhr6yKYEMAW3Ox+ktCcdaXmAnXvXmjyevWumu4h6ITAL9/50lf6\n0KN7\r\n=UDeU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB/iZjXBjnucq62aOKeEhXCqjpm3PzNUhC5hXpg0XvreAiBZGPp/bhuG24PfsaiYh9OrhvugfQQVi4YXjAMVhzusmA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.0b88eddc_1547128972755_0.29713282465310376"},"_hasShrinkwrap":false},"0.16.0-alpha.f7cd35bc":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.f7cd35bc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.f7cd35bc","dist":{"shasum":"bd36cbd0433f940ddd007af797e47a75f3d2ab61","integrity":"sha512-dDXRX183DmLynyub2An0eDbynws7XNzf8b88OzWBlZPzxzLUL6KsjbFJf8RlwsK10wUkDgPeXoQ7jW5qmx6iKg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.f7cd35bc.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN1FRCRA9TVsSAnZWagAAhG8QAJU1xVj0ABm9TC+ANS46\nbufO5R2VCOjTbEtt6RIl73EdVRpiNJT3c20QtJn1ELWXQ/BI9Gkp3YpnzRjf\n2g4cBgr1Rt7bI7mnv513iGRwfUydtQkiHMTAz5Jcjr80DLk8tfLDAF8ueAw0\nq/354yjzQk36WS4KP2kf8VDSRrxbBsHYUmUCaCxmjXvOqB5RIiSbfU1xr4Xh\nU4QNI8uTwDMfIVVsZ3IMYcJNJmYcaNuE+CC8oym+9bC8eL4xlUoesGC136wG\nVj//Zq9sa8Lf7LoZOZVbeV0gOwgOUeHy3gg8w/Mt6IX856H33jm6x6l8i8QN\nfhdX5Bg7cVZlblZPIb6ttRgAGOrKNn+CKC07R9rgoKLCJl/wQXpFxKx/8402\njbGp4UUbgSPqkazQnik2cRtei1WJRzIQDI9w0JIi6wpalMsiVQs0O+33DSw4\nAoC70gkyqbsdxwOnfZ3cg6au5K68mmoXibSn18krYsc9nqavaBHohB/i2A86\ndBjlZSlGpVEuNqaj439BqpM5HRETygpqXUK4fCo3qaOwfJLKaayLTSPlezaX\nPV21xRTFWNJAd9wH5/blb24wmexfM7B3kgRNIWcDA3ZDET8HNAUn5bDDbXLa\nGGweqhmZrPtnWRTz5foIIaB+Ak3+Bwl2vv4rzGmNAnaSFFh5YTOheUlVyht0\nPB2N\r\n=aku6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID2GFIHoux1jk1EoRUp4N5I+0xDOYR8bSF7441JiNq9LAiEA7W7GhdexdY0Z/WOSyXoqsWbWAzQ5cXN2purcqTsMibo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.f7cd35bc_1547129169320_0.540128666469659"},"_hasShrinkwrap":false},"0.16.0-alpha.714b48b4":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.714b48b4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.714b48b4","dist":{"shasum":"a5bd3a204d1dc997df060af0b183e0b22a6659f9","integrity":"sha512-a2JXsyKKzyVtOk0w6Qzg5RftWTmqCJahhctgRwRTwtKeXx4mnIrvAJMagrQ0sVZnGlY0spiuAHaQ8J4+8+t1jQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.714b48b4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN1GYCRA9TVsSAnZWagAATG4QAIx6Kidx89jJB+BcOBCt\n0iQ3HG+fFi9WlDCciAMV89VQBGDKwIo/OwDybpv67A8dhPHaY75P3lFr1fTw\nNkhbW3kNmzn3AdiSihJPPsPYbv16eraMQfTvEDT/SowAJHellYEUtdDwDPQH\ngaP7ckbCl4ldaK4Y2re4MWqUqFixTyRe7ESnUGcp6DqqSzxm9nPGcZMnjTdS\n8iaOgeRPCa6sQF3s0Z1SV3zy3LY/LpSLS57m2ONZeHJPPyCNtNPdKG07ljGz\nYkr5QfcoC4wdPy7By0D2ABRYYuDoJ6pb67O9gFGZNM8TCRmQvP/IaPxGFnZg\nzlJG3LPoKqIA4RYJpQaM4JIMhpdxYY95grU9h2xo3RhiP6kxerY3f7AdCB/B\nj6i7AJBJaRKNWteOVXF90RYHtbRTdO8D6j9IyQXSIh7iGcaWln6PI+IhDb5k\nuFLrW4nJFH7oltIWJQIXERnQ5pUZ1/xXMTVmruucrpN/2cCSrsVRBZJ5UNwh\nvoBJsZu0gEwM4YCqlmNTtiAgqPSPaJgP7DEk3BbmqrlzwXdbHquvbL5xo/pX\nreZj89+mSkgnQO0RGvcE6AKIPzAFlRf2Vv5KVgUb/a30TLUKsWbNiQcnCFRY\nrg9fUtBHwzchrs7fwjHrljZBOx4r3nffWmDVnjpmm5/abZOWicemq/O/a3Ln\nhdi2\r\n=D46p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCs1jDpG8PJXNSwYjHo3YB2LJFbVhyVKeNH9yHCHJFpdgIgNTYmNJ1l6cegJYix1uJ3Lb2FboYepoFBw/h7034G4AY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.714b48b4_1547129240286_0.2309168955209886"},"_hasShrinkwrap":false},"0.16.0-alpha.83bca28f":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.83bca28f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.83bca28f","dist":{"shasum":"cf6369cbd19a573122e90a6f010147683be355f0","integrity":"sha512-/xd9E3lHxgKo9vT9q6zuXgnqzy5L12GSLP7+1/bgnKqmSEqYgV5RJNccRD87vj/BjPby4La4/4PQfkrPa5N9qw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.83bca28f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN1GgCRA9TVsSAnZWagAAHL0P/3dvxrgQE2TxVpTutnlK\nhb5SJ4lqLcHRTOR9dg4eKGs/uxV/rccEKkjcAsMJDXMHtO3/02MbqLGqMB6+\n9zyQwIRz1/ksHSPoHTC7DoOpREUQMgv6SwTS/WROYfztvDYdMgLXWEJZ6X2d\nK0ELgFQWtdKPv3Sb5PB8NL05dF6f5sqQ4TTIT4TsVcZVxu3aUD1x605gPPFW\nBWUxfQjPSTYit+D/2ZVPh+OI/iFbKZ8LXSFT26SM5IIegvz3xOiO55z+qV3c\njREOrZ9NyM3tUY+FF5PpJC5b91UFppESjdDEfZ+8tNZc69VKQFa88XiklpAe\nMfvYWwUgx+oxJQdiPkT2Fw3u8KFgkMPrU1QhW2kuwYBFjJTJjxduwKsW09px\ndeIvOUt4FAQOF+n/HgZTcYOzxpJy3Eckx6Cm9DVhb312LP5egqNhT5wTVEi+\nzre6bcpTZWaWIiDiJNA4ODpBZrDOjDgabDI274sTwn4jK9nUOp4q8VxLbzMI\nAM4NPScn3vFcxPMbx64p3rYjuUr+DekrUBDgqrUBbJbX1K1W3tVyYDDm76G0\neluYmYxKirV9cnzv7Feq1GVwjP+bZ1pecLjvremNiVlyndUFPmezLkTzzG87\nfazOJJsAC2Tg5Fdr5jJsiutHv2d4rLX15u1sCZqtGGBLck+mkyJLvuFA97kv\nbN4D\r\n=AIWv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH1hw2ewNZrsbQs7ojy4//IqBRiJsEyv4WkADWdoR973AiEAu0LbgAYkM/G9dytJZ16WJfYagPmPxjrBx2YdjpaAuqk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.83bca28f_1547129248084_0.41115611625752924"},"_hasShrinkwrap":false},"0.16.0-alpha.23aa2d8b":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.23aa2d8b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.0","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.23aa2d8b","dist":{"shasum":"62806f486835a501d609bf208487ab9ead64b34e","integrity":"sha512-15gaa9Zy+b/kF42isd+i8NO7AMrQ11aPo+X/kv33x2ZKQ30gsBVobY5NlZif9KfU3vttTYG1qnvoGYnBADiB6A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.23aa2d8b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN1GwCRA9TVsSAnZWagAABD0P/15pJvufR9rM8KCZlfOx\ni0jVNWjjiTJdbo6Q52k6AsGWOKOo8iF8ulmJOdFt75iZ98p3g0ZtzyMUbOqX\ne/bXZZR2YxkSCu5lf+m6pkB41AEOJGqUU2vq0F4POA7IgPVa6UStvP0SOpH1\ndBpoRF+aAkPsmUPyJCAOb+m95jxDD3cF+NubABHWYXUmA8NgG+o/kFt21bDi\ntKJ6Hu8E8I/SUOklxzuwiZtcEKaK9YrOQ2a/Q9rbr/edTlPIOAUANTFmeBtI\nx1k6DPH1ryXDK1vSWNeSIC5P5qgKS91gfy5GM6KQREk8AzqqSwIMHchOzGbR\nkl2bK3/9eBQSD+9gbirc8IA+YV9pU+8eM9hCbcOujNj2c5cfETYJQcJkVksw\nTvV5mWZdDYlEQ/LyVo2E0IzgjsWz3wotkE2fezqoXIWNZK4slJCuTGoEQCp6\n2k56JWpxH/b97sHQ4AUeuHpKegj4c4D9CqCy1OkYsq+2NyHfd4Dq0wEq5PVZ\nXHg0ZR+7oVi6gc6ATgnE0sGfJav89pGXuD9p7r57ym+HtyOC3OQ16+9gfDmn\n90JJQyU0f/2bysFc5p4oh2hJcfkXlR971racdDqvxSs0Y0Rfcp03ZH0yyy6/\n0sz1MMadrYCvDnUxzZ/7GBVs0LjVjN/7UtoI72paT9Duokb8oJCyvy7ShfDj\nsYUK\r\n=90ah\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtpH1n0G4FqbTTGmvnOwZAIasgmKQUD1tITEz+oIweBAIgP1SPzIrMJjv2gfiRPruyh+bryAtaqQcyYwgUmLfizG4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.23aa2d8b_1547129263571_0.7748562307774285"},"_hasShrinkwrap":false},"0.16.0-alpha.c842a8bc":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.c842a8bc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.c842a8bc","dist":{"shasum":"abe874b99a9d91d910716053c040cade047680dc","integrity":"sha512-I3UCCZQI8Yz1I+D+xONgfBVTcjuRnE2B26Fa+inf6MTxbyo6KYpL9U/oPNV1nYn7oC3yFf236yeySL2XQlNUfw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.c842a8bc.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN1JrCRA9TVsSAnZWagAAmmsP/A12vv3gd0FGTqmVBT7i\nSXOsWjyy1DA431YChvaPWTEYOhchZCoHqBVKRdra481/fL+aJsiX4i/MOpkD\n1Yg6EskMgTWDkiVd572EUc1uiGOKESoul7qaAcuDwNsMK4wpiMufHmloQ5f0\nvI0m3Sd6APfnayy5RSyUudYo+KGlnOK+ReKOyvcQx/Mq2RGMSBPC6MWLEpy2\nmbq7VJN4rA7NbN+SaoOt8jj/+y3nxieBmWlM18E6sf5IhU/l+q3alhYCH306\nX5myxC0azIQF6G5C9syaa6Up1JJgCD7Iei1X63c8NyvGZg6HkBTRlm3DR1gE\nhsWHIVX6x3bX9zzD4KDMNlXMV0uz8GQ/2Kt7jML/d6K5M0qc7/Cq43jLzyRM\nuCbpZMvCdom/I9ktYX9YbggiKuWAGax6V8LQiEOp6C32TVDKx3DIMF0FuciI\nzYz8F7bo9vwQB9A9cC7He5TfkQZP5qfimtpCZKXJZjYRFScTwasTbM7eoKN/\nwoE+kz0YhCi7LohY11pA2dgdYAGrqtgjaN9bdSllTWweam8Y2jopjAB0rTRh\nT+fxjb79W7vCvNwVzjjT8ACFWQTwx2avGu6IpQScyyf8jzA73mGg9RCataL+\nx9Xf32L0hXK9HBkYazCKX6Wf/yFThvIh5BQJvufReL2oBhQ3dXwWH0nyYaER\n18ki\r\n=G/YU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5jp9RZiHLYVIn7ja064UOu5+oth7wdblbjrjj9E+yeAIgYvpBNqumK/86AJk5Bedm/Jo0Wl85dIXpyHDgMMhdTXc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.c842a8bc_1547129451313_0.3877389871172503"},"_hasShrinkwrap":false},"0.16.0-alpha.f9296680":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.f9296680","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.f9296680","dist":{"shasum":"b138eaa2724284e05c3c346d2b4013ceaf4223b9","integrity":"sha512-Qsmof1VKIjgdzq5KaJLpAGlK2ur830dQVwjRDgP32PT3A3bPTlQMG32t01aPBkrh4IFIEXvf0Rukc63HLB+12A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.f9296680.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN1LICRA9TVsSAnZWagAA5tEQAIacf+uKp5XszdFBysP5\nf7/5tDx/tjFU1uE1amwPgJ4Xas0wjDfGbkkrfXFmgBWWePUwInZ2XbjgliUQ\ni7p2k4GhTKRYW13j1dfKjU6udOx+5sdlhCwh/Q4xdiKsRQ9zYCZyWTr8b9Op\nsoFTORVuzj3rX99CGrcKJ+xjrAITjy+htcCFRu/vQNHcA5oaaNxUjF7tO9ez\nQqTQMa0HvanwELcEDUlg1UVpCJ2InpFHancbTOMMSnLFam4qhqprFo8l7/HS\nngUGEYPYnk3wCIgTb9vw1bDw+b+Q4Pv7TYvWnVEizbUapCNV9nAUWOqpKTwH\n5MUbWEumcZEuSMhlbE+BEmgsvmVFiuRXKtTnaI1FkV2KdIFCMIVEIKElaB90\nDzi9q4XVNNC74ERTnQCIdodziGQmFkZt3u5LfdXxBVm2gn80+0MgeCr27ofj\nFqrscmqb3EllJbqPPglIinfsu4rx9+0UwiVi59ftfg3xe587Re7X8Gnz4mnP\nR4gT+BVQyEK6+xBvjtrDlfEdbQpd2exqXZgAj+e/9HZ/zb3T3VrjkLRMwcWo\n6+sfFf3xuorTykQ7NIqTtHVienTuAnvdtXJk2wKLd1jeZjy8o9bak9CjHIir\nrUahFYFSytaM2Ku5gocJBAQy+ZIYSiQI4gcDyw+kQK8S2q68WIVVDa25pCTb\nbTBw\r\n=JbeR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIErLgKs8ny282Jq7LNs9zTER62qFcGBsK2eYdOyNOKmqAiAjaDXIj0FhwzwZTo6PJlbFZvTWQa5GRLx8x+jSRvLdHg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.f9296680_1547129543878_0.5584193942079854"},"_hasShrinkwrap":false},"0.16.0-alpha.69118a7c":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.69118a7c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.69118a7c","dist":{"shasum":"e42808475a5c2b16e6839b0e23964fbcd8ece7af","integrity":"sha512-BGw5ZgGSvnO1F93srW8dxjoP5MHEn8H6GnVTeVemHxZEUao9qVP5JJcQ8RMZLqC/uEkw5r5oXd/iY5z8bnis8w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.69118a7c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN1LWCRA9TVsSAnZWagAAzOwP/Ro4KcezzxkjJGAJqPYh\ncq8Oly+KP4dncR0YC/SXktVN9FARpXMLV6OO8G9wq95cVxNr/riE/6NiABT6\ndsYCCMxViLT9LOLri6/B6cLEVx1J4JkHnswdcu8pno814ZRzjl2jvOxd6y18\nsxfQEa9WwQaVNa/ZUIJ1IV1dp6RLLUpfd6kmfjEBjg/3gs4neWce/AOwAuaM\ngOAEnYLwSRy33oaNFZMuJajai2HZ9SZbWXRZNGBoAGqs1PqB61OiX4CV8b5D\nWPcUA4Yk+vYGiwPOHVEYpkf1EFBnmK/YEjRmc6UbcIo1aHnGc8ZyJqp+EcMb\nR8+5zLYuEKzIrJXMI2iFgDikSl4L0meuQgLh5kn9w/FY4WGS05jIA3EUIxOA\nHvLViwOD+rIu4vFRxmT5H4Ujw+MPqNLMwGC+/YxcfFV8ggVeXvZt/IUzmDPx\nafKh2lS7jyMwcmeBSiziX+t1GMqBJNcSt2hYHICvTtd0JbDNACBhpEs1BiNW\nQjqazIX8fELYaOVJN1V1vIXyVSKNn45bWm5aUnroCU5FpGc2GaaaoX44XQl7\n44k3ordeIMw2Uxnt+Lv43nQePIdP6rttTz9VYjaq+GyIpRhKPGm4Ovp4p7Kx\nSujfUwkr3fNgHH4aX6nB9pl0epZ6B4RyRaxsccP0/Wec8ShsrUPAZ4KyxgEt\nMXNH\r\n=xoj8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAzNKnDNjMMWmiHq6uPd1C1CktlOoeIKRqGGK/c30BS4AiEA6MMxZnFa+bk8Dg1/enc2A0XwErSASj9tPNVb2HIMG/M="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.69118a7c_1547129557195_0.5551024415341757"},"_hasShrinkwrap":false},"0.16.0-alpha.dd7ec313":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.dd7ec313","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.dd7ec313","dist":{"shasum":"8481d3bd2abb4ebf5260417e73e273708e5ba251","integrity":"sha512-fpfhSs7o6ZCQfEZCcMzzxCCAjP2lHiHV+QPiNYDhMXtXr9aPxobcmKLWi3f0lJ0XxdFrYhFV+0y40Q2QQ3dClg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.dd7ec313.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN3Q7CRA9TVsSAnZWagAAlZAP/icZGTzCv4jIHo/83ktF\nozdUa3CPVJGlSMXLwITjpOzZcY2UrUGktC5bEcqhWG+9+hJLwbqLiporC9Ah\n+ftPmsaQmIs09+DdJW0zlLri3cs67R7Icf/5EuMjVFC0209RbmcOENTCxYG+\nNMfvSHF57v81qzAkKa9i2UK4lp33XPzWXJQ653R+QMsXa+p63HiKxeZ1h/yc\nAUUTuMoRWYtKowk+a8qiHYgVoAg+bRINk45aQ0vNJ1IHpNI01/7N5WQhUWl0\n9CEz55vZSxPiMimOxoACT/yxnqWjyMDcOWIWFdpqu6Ax6i6qRRI9FTkSyGu5\nFkKLhNmcDw/3cZOljl719z+E+PAsVYx/WLiBSWn+CEvp5cWBx8bxIEXK+Bug\nT9SE+IMZhL9ySj3UjhkKdhEhfPL9/PuGQnNNJtEQF/kSK18mhJbpb9JKX99T\n2wHa6rX7yl13Ee/OYatmk/gH3R/JNxfQrGDMiazEiorH7a9vZWh2A7t4q8Uq\n4/tMWCo4I7Uz5KlM+1k1217HzpVsIpIr7RRL2BxptGN+tpBrrYFgs2NBDGCp\nT6x71hvdpgeBRiXl08Oa1MPp2u8x5k9fawLIStevd2s8RWMbuVc0vGgCl+CR\n79Qpbv34CONCxndixIxpNf8fy+QdSZnL+kivRx/B4nOppQQIyxdHTFI1uaBy\nr6cS\r\n=ke61\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1xKovphk+A3ZLdy2nAEGXxcP8eSt6kIYDdfuMqf8PpwIgPz8UlFdxI8HzOMLU/y0Kr6+9ul7Dwy4BoDdYGIoywsI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.dd7ec313_1547138106433_0.6820125414664471"},"_hasShrinkwrap":false},"0.16.0-alpha.dcfbe606":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.dcfbe606","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.dcfbe606","dist":{"shasum":"01c81ee8815308f2000b268a8506155699151c4d","integrity":"sha512-ojU6LvGoYqlxGlb0LmNsSej2sIM8SDIbSYEbcSyhN2UO7Rqq00FxZb8P51T6NBoQpUR48+fr1vkmee96B9w7VQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.dcfbe606.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN5NZCRA9TVsSAnZWagAAtPIP/RrC8N+nZP43akhBCdRs\n4ZTKQu8a9CTFG2EsmYX60oKYOkTlP+GJJCd9d85yYUyaWSpZPzE3dCaGkO+1\n1/JyLMB9pvXswIJabk81M4ahlTa9zUcI7lrgSuDlVeCKytPKYzRppIk5H4s4\nwKVFMKnndjhQEOmT8drplCcY3ql6+XLGq4M3DKXfOWLCICYstEmyBtFXvtx8\nQByftgU5jjtRALisNqq5pf3vWvOuTBmAvF8ROLgWEzw/tSUElhHhESZWBIh8\n7w3HbGCmM+B2cEQJFS+T0pZEcyL/tNuXfdzr6MNXPOWRnLC69fn0Nu2px/Hh\nDmBMwaPcCd05cN0e/K4U7ApAzMvDhIRoBkBVQTvaNwc34JNRz3HH90/b0uNk\nX1D4cuNJbZ7nSElZnciKjJffe57B9wCBvAYXCBQOdhGaKtuhevPWwlNdhAVV\nBqe9VzfRPrYGknIrCj9d2bPjInUUfYqjWz2QVxOu60u8sYNBWPJFZTmo2oEx\nfVHvkpl2Y7gVGMstuz94i57YKI9o8e2+5JEY4uG8UEHugM3718fENpPvU1Qr\ntJKl0AeLl7B7nOD5b00nzopNUiWmtPoMT2M9+I/k7LY4TMGfAYK3HDDiy+Ky\n7xzJ9OP5lLO/VguhABpfi3dAeezqCsi8VE2IiGXGez4t5WFvY2blzNmEIRw3\nVRir\r\n=2lzX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID5W5ihv7gC1V3/dsL/zpKBDgzYyXKSz6mxNLt5Scu+JAiBGAaQEE2KBJkx5x3AnDcfhRlnDQevcW2QzzBb4sY3A/A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.dcfbe606_1547146073237_0.06059761988055734"},"_hasShrinkwrap":false},"0.16.0-alpha.008d0d70":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.008d0d70","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.008d0d70","dist":{"shasum":"f8cf2a69cc2f19bdd715c819d72b83bd02c69850","integrity":"sha512-E0seTfKoje6Dw0W3/kq0WCXOCCVpkRv0ARQvscU+0cY7tUkw9MUPD1c2OZ8tFs86vkitYuCGcdHIQ4tkbdZkyw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.008d0d70.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN6YcCRA9TVsSAnZWagAAtU8P/jOtlbiz8wh/u21+NwN7\nW3Fz0DWTzd6zVxpXpyyVKA/3kNXzM5rnfsuuHnE/WFQPECnlPMfCuR8vQS4M\ncSQSE2aoO9U4WX0gdFU4tWaqBNlO6oIwyH2KhZ2IVNWbTNzMJ+QnOp0x2GZB\nBM1q0ogRblO9LYqtqvfuaAfFKQSeXCPD8CZ4GrsBUnJtD/kDMA9Uwd8W1VoH\nob74yBrM3zuOYDsAKnri8k0RJo8iPpyegIptvnLe428wqo2auycalY1dqC9m\nUKQdEIJoP9Fz6k9tnvChnWfzgRd+88EDwJpvIAbyoUlxCDHsQf4ynhnlS42+\nEVS2lP7vJHFosZlJc270WAgdjgkLfeYwvZZChNepp3N02MGP4V85zGPZRi3a\nXLPHT1rXgbUjG3fSNXoBPT3g3b1On+yhAZqVCGenlNuGt29SPVMcNC9qVNo4\nS3U178OBHgz4S0jKAyG39x7DA4rj34m7AB6Qwjjgh8NHgMWzV3xrB7U6SQQ4\neVca0JrdkotES1DXgNUf6dVBMIkOVthwgyrgLrYZBHjmautWbACOFyrZENgP\nZk1aCf9cAQb0YAUKhWEINHLo2G6SolxhS0dLe9CKlk3JDrD9NueAccw5xDTt\nbm7CZfBNyHw+TOZcvd+c+bHmiovzMLmqlt+m6GNe2gSZwSdtZyhGIBGdLY8L\nG38z\r\n=juYG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/ulDTakqlElL4QTLyAqffRfLkJ+IYnkP2HFgVoLK/ZgIgM0WAYQzfnrl7TfwTSe+zo4mqdGdPJ/aVY6Qb2HcxEsw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.008d0d70_1547150875565_0.03622283122550063"},"_hasShrinkwrap":false},"0.16.0-alpha.1cc46ae2":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.1cc46ae2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.1cc46ae2","dist":{"shasum":"6e1bf954146886f10a2a7ad43597d8b117da0f72","integrity":"sha512-qOBA2XetH5AJkvxdPO8X6VpbAh7jpO7dgCp8gPJHpMj/V/EtLTdAre08qnq2SUMmSN1PI0d3Nq/APZop1VX1AA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.1cc46ae2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN8FzCRA9TVsSAnZWagAAFRYP/ie+AV1y6h9gho9RWfYU\n7HCI7BEl+DSWWA18CMY2S8xddcM2AacBp8w5M8rgZQpfu2PyXpS7gxPhnWyn\nrRViYhVhO4XFUZTIDD88g76AK/dUuBk/EZ9XjAC0s0GFg+hQtItIruX/ZCpI\nYllfWjkROd0lHROOdfbylREzHU5gDtwKESvEXj+ZzPPTGgUZNEWJSmRYBLiw\noFDZE/bzy9JFxWbZcUMYD+nqa2JJaQ/KIbREIxYT4s9Y6iCZzrUS7610Fun8\n0fWZK91GDEjzP7Yu8ufpJLIbKiC9rza/4r+GoQtPfex9CJWpnIaGjWcZ43ts\n0ai6Gvoek16bSyv9U4q5HQfBjs8dyeVPL/YZGhHksaJS9aTr5LZw/g0ARNfw\nwCsE2T1gB3vg8sHXisPL9/0JfIbuFv/vmuV6Z4XD7D9feNN2ydStkRSc7b7Y\nkrWxCqCCS8J3J9t6ysKtvNg+60vVeSUFV8Jh8DrAwdr1aVjDkb0w3IizoBS2\nHpNx3IJR1af476r7yOgELIQFCPkIb3V0gqI7P2mDgIkc5qOA1PNYKJP4CvzU\nvNOiDQ6nSLgMV0yLgaSmLAgA3T91BK9GOvkHB8wRkaBj9ti8WxAKt3JYOaXU\nAHRRI1WDS0XOZvfTWbFmJH67u6GYZwwAIVRZ58Oz3Cpp8Hv/oyhU597F6oFw\nXU4m\r\n=9Wnq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDnv2L2X5ArKicJBye8zRIVg6As1WZIqSLgPmJyTkFMfAiEAx9WEjuIPmzUqTuJoh991Pyuf7F6ud27X3IN3vYzKZbk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.1cc46ae2_1547157874846_0.49203930303666144"},"_hasShrinkwrap":false},"0.16.0-alpha.c750a4aa":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.c750a4aa","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.c750a4aa","dist":{"shasum":"79c33f34006ba20a44f9fb9c4502f37846ab3418","integrity":"sha512-mpP9LJf6EugKx0Nu0LMCeiEsyA1kArkj1+wyI2soT3vkDjvCUkHC4FINA4mzlfdoMFPtTVI7klUqDN2atot0EQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.c750a4aa.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN8rYCRA9TVsSAnZWagAAvN4P/1uRS+LzSZ2JwR9Q8gYE\nVxbN+SOrh4CxlDikSUGGZt7HZ2mEHFwLL9Qzwedgmj+1paMB54DGNYa5J/V2\nchEqkc8terhBvgkpnwqDY+bJEAflfNAXoIw12FAGgsswnNXSu5p0F6VGk85B\nRMRApEKCjcNKa2F57BbySHt1DtN+bj9/1oUPPYBN543zi6jXQOQaDOiD7pPz\nHhZS4Hdi+sU//Ef3hs7LZrsCR2tpuAA7wqrLf0Mnqstphyg/iOdm8Ew6vCqH\nUYa9u1nrpkEd7c6nu69vLZe6qpfdlFOzvGz21GFCJ2svdq3l7LDoCqdGEj7d\npEcdlPWxUTuQP0TocbCpi0EmCFp3grbefPNQnf9QXJO4JUbhdO24cp1iACmJ\n41mx6yGb977LGETHtUcdgABFbeL12plxXeEh9E3/3pLoSMld4vHaqPV7Xyyi\nDClxGWf+YQAjieqxshAuUz/Uzf9a6SIx9419tHjnM6CKzPCCud2b1zYIQMEz\nFMqBUcFXbgybEyStFahiJfEjlkvon/gR4G6YAzDBfQmsBeJU2VnZsbW3c8V1\nfU7ev2FuY20goKhJgpUm2QaCUC5HVnO0ci/vBy9fVJQtPNV1U9G8rgA3JjlM\n9s2u4z8PcgMfakWHdcJPQyXwxzwAU+0VIip2FAd7gXRIEohXxjqMdgyuDd1J\nJArS\r\n=OPHt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG6sBanW1IwKax18/FszZNpBnhbhzq+47ePgnh1XWn62AiBhb3nTqKCrTqWcYlV+K38MNzAmp07H/Hd57S1Cn3HrTA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.c750a4aa_1547160279376_0.5343303651739544"},"_hasShrinkwrap":false},"0.16.0-alpha.18a96883":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.18a96883","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.18a96883","dist":{"shasum":"4e11460ae5df9cd3864752519c7380db01145a2b","integrity":"sha512-QpTrr6sdkvRuLZu0oQ7ywvGq2BHTwVx9GUHEzKXr5QpAYL8U3UywzYgeaq0GkG371JtPEDlDGQ0yfaRGPDL10g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.18a96883.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN80QCRA9TVsSAnZWagAASQAP/i4jnuffwy1Sscn58M6t\nmp3CwnT3plascX433txfYmpXF3M5FNCW3yinEjCrKH6EQmtKpMZ70u+Qav5I\n5do919Y5d8pzbmF2KapDZFl9gY+QdUOBEo2SM/F3DoNXsnmsIj9Mi4KklOTw\n5TaEOBS5MVvXMS3/cyxYwdcl6USyTZJ7+VTvyQqmzu7iu86hWBCBtxYBD4bw\nBRfivljwXoOvU0EtiVWxkBEqFFAEpEIxaw9zVa1oGVfSyQpol0XYoqBNYiU8\n4RAQc+HByurSE0lNsGps322dhSg6LE1jZVlJ1bBQc1F6U+SxsA3zo+i/PxFw\nii+JXF5W5RppfJMG1R7/IQrqlnEhSIUDEkZoFvURei/+uRoMEQCt+/z+cgvb\nsdXsoxXrfZKG+mLCm1yGHikM1yXXvMYATQKE/cgZr9AHTb7eOmqHfjhPjiom\nxSqy45lO4z766YQv3lYucWmu4SIXlcr78sbCFmuV2FTxtADI0j8/0wiSB9gz\n0744V6Sf7NZMI9w+XgVpKKf7X1N9Y0FlYxQ+Wn8Kc69YBZpVjYEXTIEKmta+\n5vrObDdkVvmHZZBVLbGasPteIGAJvci7KaDzRNWsoaO5EPUne5a3j8HBujKF\nuLPfzmG1Pk2FxzPWXv3nCTMZstCxQ0Rup21swe/YEmr3QoaAsweL56vJ4f+k\nlPWg\r\n=22pI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFCjIDOV0M/RM5/YGjNtYWwiqiRQdsrzOec/fK4XIdIKAiAeoP4vS0HYwradtwSVRN6E7LLW/DfMiTra/KsuKYSRQg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.18a96883_1547160847427_0.8589554042626177"},"_hasShrinkwrap":false},"0.16.0-alpha.f200c85c":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.f200c85c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.3","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.f200c85c","dist":{"shasum":"b19d4d407cdbd72be947a945d18a69fea28a7fd4","integrity":"sha512-A6QA1f0d9Zi9RmfOKdUdWJqzR7CH9MRre4ED6+su48lifvJr6Iv+s3rVRe34dBcY8OKAday9HpkjYivEIlF8Jw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.f200c85c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN9fBCRA9TVsSAnZWagAAaSsP/A72a3pMQJyzeTzyfjIR\n6NksM1TWgXOv5ZdZ/SyizH7H6zcTVc4eTT7r8nHxtEGsY2oEEVFvSmkrN5rs\n+xKk1bOxQ3GMwg4yfug9/b+Xa0lfYFt2kpQOvtw7iwe9lDTfPz7dJ34LdtVq\nYAzbmYFJmGAxckeMLT4C9zD7R6yY9WvnA87dI6yQhElQGl/oGyDydZ4fWJuz\nNWR1OW21+SDqtH32gftJwrYiP8q+OjgoidbOYgLVunkTWSC+swFjbQJz4o98\nex2bZp/ZHVp4JF4M6eS4U434i078ShT2bugBFtkmBUTPK6kiftooK6uBpahc\nsHia7c9BwZTAVzljPz+TolvGNmHmIxQDTseXGqkxDbcGbXzvnpbja62waDGo\npAQPKYaDNO97syyFkfo030twSt/84Hv2cIgBH9axS+RWoZopWk7IUqdQN4G0\njuWNZlM551mB+FR7vCnLNusAdEBKXhIzNjEocnn2kVWwXB9LIy2i7s9htnaM\nh5vRY89Mn0+4M6oHHX8cok0byxe0UHS2JTdRfycV5lmekipurM6/GKZfKmcj\ncE0xPnv6WE78zBCEHRyZOzrAWS+WxtRO4icKk87G/SaBV/NmyGeSWX6kbKkU\nBTSiKKWqdN9OUoue7XdiZBoPTOy7xqUHgGB3OrcNjnrghZo9MVYBu9kcJ9WN\nMOBD\r\n=ghbN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG+85FumfVPZK/6DNs3uKCrbQP5M17KWqDFPTSARBG21AiASYHWpxdj/K2VfXK6x9EeGKMQ3tCUT1MPbkH01aYdNJw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.f200c85c_1547163584945_0.9962455554547491"},"_hasShrinkwrap":false},"0.16.0-alpha.1e1d005c":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.1e1d005c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.1e1d005c","dist":{"shasum":"5bd38de96f94d8b07eedb05c2364c7324ee37db1","integrity":"sha512-4jiJ4SO8njWXglnMiHjqM6ecv+rqYfHN6Cp1IF3Y8yz05bHJ9jXmMJ2Duzv74nzMQ+uc5Ml5g2fBxZpAY/O10A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.1e1d005c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOFGWCRA9TVsSAnZWagAAfsoP/Rkj0WWLgBMZiOi6sXq4\n9D6vpFLeOo+IYVp6pZaTdDm50/wOPSefTcewJFPrwdhd9RjYuSg0DUck3i9V\nQEl2IFdWb+HUBC9fJFZtMF9Fs3g0FjlkNOOlmuWHlA4/pneH3odfslV9JELy\nEY46tZYVWJVcgKI1ye9s0WRhjP/1oraLcfyoui/t7xNQDaV4N4reJf2tsnTe\nq7OTcfdd5aVpvfgAaBn0XIO6+FiBfFAhF5gn9TBdBZe63TkA6DxjsIdief35\n/pzWgUY6A0khMyd4ScwoDZw3VBXd8mgx94v+ZpVibZADmXtUBPVFj+MpRMkq\n9YLtnI3evZlZL5K9VNq5aFkbuhw+S5SvHOA59H1z/5lSl+ZzY2JrY7C+8lib\n8tVXa+WyN/sVrr+oxXwTHADo0bs1zeOIpZAP64Mri9a5cgn5H9eyDdkdyvYh\nmIen/UzZvIiDuN51RYGFIe5OrO+O7uRrbU+5sMgKNlZQdT9/Ec6nTmRpM2NF\nwa3X0Vq+dvRcJ7TzHle1LHwqr6cge+l/BZ0Pdq6ugwq+2gM5STI0CMnaw/bI\noz6olMOS0NOBRcT1Yj6bHFcmyFFwUQPTH24OPDPY0TrPMxde3Hy3FKSEFEGG\n25B+KoZztIjaQzIIR7zoyLxSndOn+XVl3cIycE0S2KB74M14l0X2cb3o5nes\nZG1I\r\n=FML7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICzfOYMUevnnp2fL1+D4VHPQBgYSxetku8/HLvhJn9jAAiEAoUJ/pZ+1HKD/BkVz4E8z/OgkzQaSd1yQqad/TcO4kHw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.1e1d005c_1547194773120_0.9384866860200107"},"_hasShrinkwrap":false},"0.16.0-alpha.897004d7":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.897004d7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.897004d7","dist":{"shasum":"d335f3154a1dc3115863db005e771dcaa9192d07","integrity":"sha512-8bs6w4yvv/MxtrVJvrk/gccUbFAL2KnmLiINvxD4njmAmd9P+dorlK9m4XjpXYtRJ6zGOqux7Du9iDKJAU4hMA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.897004d7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOFGqCRA9TVsSAnZWagAA3TYP/3KPsiqhzXZCS3QSz4RK\nSH3S9LaCwvg0TCLs1KgISeZkS+OgvGUOb9lxSxYpnZ3i7T+ewWj5pElQ++Wp\nHjcBPe7daDiEdgSGI4c8KThtVn+Jx/hen9Eq8PzGrm+jSHcTinc9ym7iBGWX\nVB8weaqA1OC4M8CtVCaZAy3qrUACaPhNUsMyUjFO8Djwe8dwCgViUbC7YJC5\niTYzdtT3aQyh4WY1BcFUdjqroymaBQgycT9ggzOUNzoHo3lfnpuPfebGmrY5\n7RDKXis3f2mYbBt55xzQ8B5F2LjP/Xs1BMiyMsdzGHtFAwZif+ETu5A274u2\norIHMUa1RTgnwbD6qYyn4ZJePbOwnwJ9inSNb5lB6nN/NE01otalkJcsmsTt\nnZ2gyV6R4t6T0yYe6AbRp2/vx4GIZxmjlEnr/JytPF9eoEBlOBj/mijnkvR9\nLQ9bBsVekMDb5qZ2ocEXwZlgvptKoyFXlLq4muGA8l7Ngq81r6w53YRwS355\n0i45UR3wDVQ/BYqCJBgo8ZPsfsVcEQ4icLaVB311Ui0xUm8BdTZdb7QFizZT\nI30+A9uVsIPoBJdNgaN9Z2wePnUgguLJvOBMtXqW7v/pjH1zJM4fi7pSuxpZ\npoyuYEt+DRlG6U7dKimrg1Z8JTNzHgtcEk5FRIsqzM6k8a0hrkVMr3HLQtuq\nhcss\r\n=j6Yd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJ+shao+WNuScCAsIDVFPZlhM5Lo8jOOhGuD8ZDzrbBwIgQG9c/54e6SBHUUDEle891hVteRjdr+Ldk3kInXYozA4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.897004d7_1547194793402_0.4183113681737862"},"_hasShrinkwrap":false},"0.16.0-alpha.80cd9b41":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.80cd9b41","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.80cd9b41","dist":{"shasum":"97453d9165abd9b162f8a8e482c0448a04cd1c41","integrity":"sha512-X+Mx4sHSoR/yms3lgVe6twEygXSPVhCpbamFYLMWtCYNFtLPoialDMN6hhJL1/awIVzvpIqLAB2B6vE8EikPBQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.80cd9b41.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOFG3CRA9TVsSAnZWagAAS34P/jfaXJn0Le8fugJdV5Xu\nZ3ccA++oYnHN+DlldqbUfLbQPIv1oQr+Twq3wd3Z+fN0K0txJAak77qQ4Xgg\nJ1CtPMgTaZKIdtAgbCGcNCKjK4Yc3cmvU2JeLY+X5JEvwdkIAO/lqRAjcSKw\nfVD+pGLgYetC2/hB13u/OKvLx731Fj/gy7+Utg58arzGQ2ptovLbczSR+NBe\n2MyiKHtu0MQPHbY7FZ8gt/x0OW2qr6J0KxLuiIMg1ZBKJ+3sooS8TDyMYvxB\nUnIFRtv8pqEQ6ATZ+FnbyWPHd+Gj5YtRZByGRcv0FRTiazyhOi0ZPRnonzlQ\ntI0/ctDGv6D1RiDV8RrdYyelnh0VtawoyOA2ovDJ7XxHRoVda1Cxlq+GYN+t\nR3QckRUB8+seQ22yEhdJdZb1opd5LVvCL+uGpp7IuAPQMkM1zRL4spkqk46d\n9Hu25igDfXsSTIir7i0XERqq80ag/VsLV7YSQYSqH3VHsrg/TVFIXCDk5uVx\nzC5+iE4Zy5escuzby2I8iG2ebPf5QivLojghw7oI2RagZN74d3tqcgWs5tbT\nYpzvb/Ev5t6t9bP9tAsycckoO52CA2pjr/EV/eZ5GzLLYV/yUnTtMjMbRD+3\nQL+glQp1yz6xza9E48mdUYbYkhMGi2ldIMpixVJ9YEg0Kht+Mhp58Rbc44/8\nBI3r\r\n=bcwY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCHzMGNDTCsJWr3wAfLvQWAwEjwhvubbc3BfjnyuHtT+UCIC8xPjiCRZYojsQcg8zn+fTzD66XGsV+aHcHG1HsRWvD"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.80cd9b41_1547194807319_0.5518996880601827"},"_hasShrinkwrap":false},"0.16.0-alpha.2c981797":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.2c981797","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.2c981797","dist":{"shasum":"1aa07c5717df315e7e9dec71fcdc8192152c47fb","integrity":"sha512-MhzZESPcnIGTE8jNgSKLyXYcr/3BdEgkWnqxvcKiBMcP07YPVEGcIhULVXijUCmpsBoO2lfpB10vELYAcnw4eQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.2c981797.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOFHHCRA9TVsSAnZWagAAnqwP/R2JeIzuCLPcmjEDONgZ\nRJy++66pkk8gHVaj10S45Jd7CqDSdmusiee5fafdchiLnlU5I2vgBFMtBWSD\n+ODnqnrAbJGiA2UritAXViBHjGPmuhbqaTgl5wQcwAluB6JxmOOXuJLaWdl0\nOIJ6/eVcy93ssWGPa5aXUtLLY0f5fmGK9n7Jw3Svy5wyjvKaDwvde/0Di4xy\nqs32dWqc44jmakVwSY5aKKB9/BNUDwRUZSJ60c/YzsOD2SQvnB6gje+uT0iI\nH3wNYNLexAPN1BpEqIHQfpYvYOhYm7pFVsrGt62WcTLESc3QcAYIz/SBR/Uz\noyok7SZv4eJQh+wFFXQEj4mYl7CY7MuUw2Q8Mr3rNueAu/Jo4UE4HvYA2EF4\n1EErQ3L0xz07eldg+L99b1tWEbFZyz79C/FJKtaKeUn2xah8AcyOkIlGlGfx\ndnOdMeivbPZWqYIuOf9yuqrn5ju48w/F5pS6yEyM8NpwmVjAnfl5uUlumrhl\n+nFrR7Asj/c6El3OUieSpVWoP8lUd08aQ1If05XnZOmXJa21r6HNwRQJylOz\np+WKZhOtGYEY7NYWeQRSIYuHW7jj8TrGoTiO5KvXwrKv1opc3+cqpCKOftH5\n/Zju+jDDfQYeWGOp0c0BfMNLFQRq1HvK5zBJHYJZckZ3x051BzlScpP2S/6Z\nXbCD\r\n=+o4t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDta86ADa+NaEEO1hxmsLJKeeESY9fgH+NeWQsMMevWMAIhAKajo8RKZS+aGOZ3g6nyH98MmpjHqEFymWnD5M79P0GX"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.2c981797_1547194822930_0.9536066669816401"},"_hasShrinkwrap":false},"0.16.0-alpha.7c8c8456":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.7c8c8456","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.7c8c8456","dist":{"shasum":"5d09ec40526b9da20b12da0c9336b359517aa55f","integrity":"sha512-WW4klMj3ArGMaRMjaMpEMN0MUTc54aW1lhmi7a3bVGRP2VHW3bnaOIlMzMfLQfNSOjyaM9qRoYEoR7+m3uxshQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.7c8c8456.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOFK5CRA9TVsSAnZWagAASHkP/2ng+VxrFpFfwOYFa6OM\nopZwniZfXkKJPfLfN1j1cUUi+QkWrRwHwQxVmAkoitE+iLu4FXFRTE0BcFwI\nv6RkXDiA6GBfhBg4wow0XPTxMFtr6IQ/SfflQdVqPewoYVJi4Xve5DvGUlHM\nFxTnFjDWgAaJ/vH1fi20mf12faWSpAQCfeaEHrWRffwGnU+59+LsBoMbSyA7\n7zUKc1eOCiE7GQswpH1SirOuV3tXQxUGW6/UdqDmxCPu1OdDfBJn/hQpFVmW\nUi1D76zT9cU7/v1bx9LIKpEeSF7WVjQETI6zSbXMaASG4NaeGkopmnFMO4xt\nnAL4qM0zXuMdtP6euFZoaKD77Tho4LPOHlz7dxPlEXcB2cx5K2gB0NrNVmQr\ntIpCCm7fzgWf3FCKjj+8ukBPxkcDg1k9p3ghvxH0S27iHQ7bzxJxgt1NqHpc\nv1yep/KgZVd0OAclN2h4MsunczzhprInVB6hbXmr/bDkzrsZ1NazVMn3EO5s\ndcA7AAeGAJbnUfd4zxM5NSu4HKdZ5x8m8Gl2eDEICkZzsfaquWmGQZsPfXOp\nKAwh/BC4Y4wTSQG+GbHsb6WVmCUvkqtlsf4kArInGcBU6bNFhJPzPHh9JTCY\nQZylxnmrtPE6ZkPim9iH0eCm7bds0smf750sH2IrfBQxIw0d0CVkRuUiLj5D\n+dIc\r\n=pnSW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHDdmW2CrNB2PHZS2n/XF6YItNit6f7kmRcn+6PxpcOlAiEAtA3u9EKmaH9QjOiM9OU7qy2Xb9NLYO0paRWSXI1NO3c="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.7c8c8456_1547195064975_0.37366178971717035"},"_hasShrinkwrap":false},"0.16.0-alpha.236603c0":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.236603c0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.236603c0","dist":{"shasum":"5ddfd49b9659814b6baa066079a38e8b6b832415","integrity":"sha512-zhcq11IPocsLgGvz5hci7qmoA/8Y8qvRLyemci5j16vbg65ImRMi2Fp2iU0wYCVioZttiBMeB2uu1RPa4PhmPA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.236603c0.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOFLJCRA9TVsSAnZWagAAURUP/RtF9xGUgMr+b7wpABAO\nC3KSBLyjSnLNWrxiFgpU11HHR4y5yFOJCg1GpoRNr1JCxww07qve/bLgig6Y\nvfd23bEXPcWpnIqmBh2XzQD1G5v68zhg8beFGeoKmuC3ZneYBk3YzdLo/TAt\ngB3LplL7xmn2sg51EQQHtnjmz4p9MjgQ0lvPekewe5bCkcRxIJijjeK/qrKQ\nY4cUEAip/v0OhkYUMqpDP4oZ00YQU7uR9kLEevgyQSlhF3vPuGLBp3w0RfBy\nDajMuYYmQ9WWysSGd2KZQjcJ1Dc/Uy4JJI3B8FXr1FFuuuyLxWutkpoh1sl8\n8aPNZ63tLyY1C7rVfU/1idYt+FvKgM3guxqqy1+UKWyYBTFd11x4mR6ZzccD\njAwxFwRnBlas5AqzybotjAv2JfXl1HfIRMzn0vnek4xXw9lxKLFxebbgCLY0\naeVIpIgBu7cYYbIdim+1cdcTFGMjZXY/GiJhtuhhKtwCVMXbm7xI6q8xj3BP\n6fkuoy2aPQWPr/NHv6U8J0/6uxvL+Zj9iOUdcmNdQuajpezC6l5+wl17S/r+\nMQBlSeCAHcgGTRkLDqQ82eyyPdtlOlvdEvjfJvRzfosdiCT8KgFHwuvFuxgJ\noJAnHum1Zr8yWePc0mAMYsmBlp+wpko+YNGQUwJpevlAO3sGZlzRv0cf4RZ7\n2e2H\r\n=2s4a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID5L5uWrDxmUlRolayDc2LmNT9V5RgK4tbH8M7PwGeiTAiBVrxVZ/EmI7nCP3zTtO0i1MMXfYeDeDCDkPydaRkXPEA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.236603c0_1547195080747_0.5613726942949135"},"_hasShrinkwrap":false},"0.16.0-alpha.fb3b0202":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.fb3b0202","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.fb3b0202","dist":{"shasum":"b376f3e41989e25bbd496891a9f773221a67164e","integrity":"sha512-ua4qbsFMavaC8JoWPHl7XvAkF/Mxsgh56PHoZ5GUXp7sE/9gbM0pSnmTYoyfP8WaGw6wZ0HDaphb4ymn8PYDDQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.fb3b0202.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOFPVCRA9TVsSAnZWagAAtGwP/1WcLuv3QwsL4fTEnkoz\nXpfQ9y65sy4dBxw5K9oOyMWhPDyOHIZCioasWPR3d1dzm982GaOy4UTn+NNd\nMNZjp12CO1QcBy5+9yWBXUhL8GHJhl6Rq1/FJa0gbFhwqh4Wenoa8dOayEN3\n89ewWbCFQfhNkNfJf+Rzaf5yl0QM9kzMOn5+7LImmq+Ao1x6BUSRDLfSwIGu\nUwAE7IzejWnp10yVBPXN1Mpt3fuAnXghZVrhc2eXJlqMyBD2ogFl3oeknrUq\njUbqPgfcApzEZJ2DDr6st5g4+WPMUfPlQxPKHpFz8IQH3P8Da9kDYMXOpn5A\nL3/fDFGI8un3o+cw7/JDckll/R6lDh9hraZxGp7HOQPS/ugXoyk1CjEwSm2e\nmqQLBhZr8ohAKr5jM291Six/b5Pwy/gep8q/hUkn9dXMqiWRC3j2Wb9JqERV\nqpN2x3PJzrvyrlE39G3Smtko9Dzli7zcWPPT9WJ1drBsg4CBeS3Y7KFH9zLL\nI9SIKXKg0HBsACH/5zNbN3Ju8Zdfh6d4l50ezE0jMgFUgWq3RLREXPNwbSnN\n7HBQorhTfatsB6soSe4krtZ6kKoOo5Z4Z+4oqCDzdksKsq3efLshxecbVL1N\ndsxrEYo99GIwbmzDYChm9JgOx3WxGEMFEEIas/yBMk62EODcIxZWCdj67Azj\nmzMy\r\n=laUo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLBhWIlQQ5Yfz6PH5iBYXdet0C9a7T5hdVOTo1naXXswIgE1zFgq8n0LUmtfKfXVL4dULa/TH8lODLk55C1wc2rGs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.fb3b0202_1547195348436_0.6976089871304436"},"_hasShrinkwrap":false},"0.16.0-alpha.c41191db":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.c41191db","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.c41191db","dist":{"shasum":"d9794ca8d76265fd7baf115eafaf6b22904d7e89","integrity":"sha512-dFxaC+Wk4/sBaiyzpZiogVmgCzyxTTrpQk98SNG/a5sNF4bqZsVjzEEQcPOnjgt4X6ug0+n0kccTKGBxo1clOg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.c41191db.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOPBdCRA9TVsSAnZWagAAPkcP/27DMAZHmRb30oCIso0j\nFtMIqg3N8JeQZrR5XVkw+gpis3Lgrw6FSAtmltbSmugBDsonjjOfsK8srFWj\ncyPrpFPdxInVLjkMi1smdEL9GFzMYRQgQ52fksoxLNv3isuIdxup/ZXxryEs\nlyjHJAqId6KRGry+J5FSA879eZTAUCu9DfiY+2mVW0JQ2Bt8cL0lye6uLz9R\nqdHRFiWddtqTDiDg0nLYg9Dgi1NlNFgn1JRgb5sRJJFCp7cYDo/iBH7Ng9lO\niozb2jgpNVZEaLfePo0lsigGsenkUhtdIS4NylIbbCKwkLejJreZlsLCCLB/\ncBO6/e1JlMtz1uD5Q6+jKc1g85wYwEWUUULsfOXyj0Kogs/ZXhTVl0Oeh+DU\nqVUqwT71KiTRlzl6qWSvstNOfctZ6olcqfH6NuyhI9PK9kVXmTgBxg2ZEhT7\nZCSw6fgjQ79UXvhDYmdrA6Qv+0FZZ3fF99b8K7osKkTO36aah6Pc3tNhF2wu\n7AV90ScNCl7Y6VVlWexEYCQADuGFDcXVTVPQbzPSJcngp2dFLLW+VX27r4v/\n2PGBpauGiqleLiL2opci3VRb2bdoE8vX1yeZfVe/9L2gNoPjE7v8is9u6Vof\ngetO7D4nt7YOLIdGriB50355yKH2nxbAt2DUocAPmJiyMUFx++40f++rYO2n\nlGBA\r\n=XQSS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDtlOe0uU9L6ROLeYFBYtJmhOQeLUMmnb6jR3NNjnVJHAiB2RKba4sCEyFGMt9yhGr0HhXfVjIIE7Tjwg7EgTncgaA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.c41191db_1547235421083_0.03664772521288895"},"_hasShrinkwrap":false},"0.16.0-alpha.89c7ce9c":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.89c7ce9c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.89c7ce9c","dist":{"shasum":"9a910475e7f9543d7a13c13d5352b4bf2c2e7c57","integrity":"sha512-Cid8smweI7pUNWH6dPBE5N5rP7q+1/KnsafMHIhXrzTw9/MlQ4yCfoBOYthBEXVY6Dl3MB8/KeRMUSZWFo2rEw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.89c7ce9c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOYe4CRA9TVsSAnZWagAARusP/jZNkStmQmwJ1P8fVtt7\n5MJYLuwG1W5TXFbHLxgY7mtcXHj5YD6VVVOZF3WIEWcT4D10xm7QotnWRlqk\ntVnpEj6OpXs3OZlynhgpxX3HtYEBQHY+6V2CNRKXQxZ8mdvp9BadHOPZb7cD\nTO4aGc0Os3WllQn6ajzkI79NUu+rE5i4E8O573WN/mOGE1ed8ZmW0Y4kuvLo\nLP6F3LF6IOZuTY4bEPm7JuWlPX9nOqZRr59DJm8Hx7FUvQQj8tpDU0ZFSyAp\nIPUTpJpsKsbBCOt2Du5s/B7kNyYcWa46ahoPkPLqHlnx0G6cw86z76WL2h/r\nbAtd5OktuoFR9q7tzBBD76V4oHwFoIlT2IbHT/qkDTTrentt82Xx7OnlPaFF\nVyGFWZTYEeRbcC8vy70p2Z4qopUWk4sdIjtSobD4abkvHWURpAuHtJtIfwLT\nEiiYSQJw0wdtLDjwVVFSjpIof4JVJucObnah556KKpmPWfBmYg+t8lR+428C\njfw9Jtm6qgC1pHb/5TCOkGYTVwLNWGF3KNu3n+XAZSGwweXNkMXgjgVvv049\nlZpop5d0mI03MEVwW8KO9vf27lId1TGGMT6F74C2C0+2lq2vYbbt7hMi6GyT\nGYF8jr/P69aUepXBaPcR30j/aO6fwkxsHouRGTZDr6ZCNh/C3BgP2wT5vdFb\n2eeB\r\n=ZOws\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGVHZMkoYSuMO7f/E4dbPMViGoit6mw3vv0dRGx42KIgIgOfEYqWgIZYfPWljlDmdzCkPQqL/pm3UXEkJyp0TyMII="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.89c7ce9c_1547274167632_0.23441455683237655"},"_hasShrinkwrap":false},"0.16.0-alpha.d489e262":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.d489e262","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.d489e262","dist":{"shasum":"c66f7e37dab240e160f0250b06f8c092eed69700","integrity":"sha512-WSOYGfbt2Kkghnx/FoXoHwJSKq9EBhgxg4d3/4PgFGS3zUEGqqft+bWwE1cYU5qhFJeQrqEmaIyvc6aEPmlobg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.d489e262.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOt79CRA9TVsSAnZWagAAivsP/RN3GPOw65gApLuSqSZc\nijpC0qsTX90SuFI+QEnCE/H3t0g/CmjpshvkrF+VWBVe3rOvhGQj64jgqc9k\n0sal3gtkfqAGGffZz3CSjDbhNzAl1VH8/gEXOPXTgvnmVgzutobWJW5GIUCN\ngL7b0H56cxkYmyN920PD1AqR3HdmuDTn4hoYLAoQsO7/W1QIMGoPnmE4/GnX\nfJk88aIqOfXf+CVRXpBgzOgHxMNRx1wy6WhyLuyKeIPtC/xf15zUrE8U1uU6\nHvy00YXBW7tk9g81ALBKqWfLbpc5B6MmpbJAExNMGv8PVYntKW/M5r00yIgs\nLrZBXCagfoOckfWbm+VbmpyFUv+Osq0rjAOwOhOfz6v0et5MMw9uQGC8Rga8\nVJTavhQf8eaMrji596OuMMbd4/T5BPp/XWErJNGmb4rqC73xhxvY9rnDFizk\n2juKlIvY3kqF6gRDQbt0vwy2qOGFdFfyGsfOXrxcdoNWK9hd8sfVmoBdkwZ7\nF61+VxJU9GBP1WgXcPiqMnVL0fvtGYvEwWVdOnYiUydP8w0t/hlv/ZWaIxbs\nBNuqzIqeCn3mY3ZLwp00HaS+/Jf3cqRUw1cXNfrxu2U6fsqld4hbLZy8DtzV\nJpw+l463H6Q9MM+PvLeO2V+yzPERRyt3ECaTX9feul4KYziuj35d/Dqk2fMF\nOvCu\r\n=YPSB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCEd9J5+Eqg4gYRig1XQYSsvkwpU+HfssPWKJnyXptAgIhAOwQT7uJiL5A5HN01J2eunND9Bno9ljJWmI9mGkdnKfI"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.d489e262_1547362045291_0.6393898780932004"},"_hasShrinkwrap":false},"0.16.0-alpha.de29ad71":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.de29ad71","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.de29ad71","dist":{"shasum":"83a06c31c7a82f0ca21ce035d3779164eed2f902","integrity":"sha512-nIxM/c0MNl3Pi3ersGscvUSKdggaYESj0YxO1jwG4VQeE58C90o2sJ6tsLoWycAgrMRSqXvWue3lZAaJRK60NA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.de29ad71.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOt8LCRA9TVsSAnZWagAARyEP/A4qdK9TKSv8DuyTttxi\nU9eon/oF2Y14NKfzigJEeIhEHloHWg1B3rQjL/QdXh7ryK62LsTxozgZ5WSx\nbRkR3sBl4CViVNwA7/MKp0DjKBNQleBfqI35EO4d/cRZHjZFlVbtMEpaMM/4\nR+COYA0CXOaYi62PCLci1ZoiHQXrcogBaPWTRoIhNeEYAK5WMd9ZCc8XXNfk\n5fwnOBE5S1uA3z2BYdoHBNK5xnnGBxU0DA6HMNfGLEuI6KIALE8OruhBY3ba\nF2s6+1nPHluwysL6TzToozw2E/RQSmuB+gGMVtOPduzvPGgSH6iR8KGzLRgD\nvTWL3k36C/ARIhhhAn4DWP+jhl/PLOxiaFVPK4yTn704/bxeulTPeWu5EKbW\nAa4XLVepco2TU0MS/OAuUDW2NORxAmhWPDYY/LoDa4C5VggwayqIjmRZToKk\nE/ha8bcW4PlZu6Ru4PNpptKl8IX9OYKpiBDmuTGKmKp0tenxcePOHKIhmiRj\nCLlAdiN2WFiWBoz0Wyaef8j1+r4FHjJHdsbAnUxiGy1bygswF9GVYfTuVwli\n4DBJ/fW4vygVWAv+f4Mle4Quxyz+RTpC0IRuy+6EU4juAkFAURJmXZamkeaz\nOKH4EKGTil/qvYfRcMzqeSuvRpptTSdQddsTzBx+B9+4zOt2MSRA2z7sI6uB\n7CFy\r\n=b0G7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFlSvpU1I1KtzME77IphD7sGCI+nM3Zj/CWGotHS2hhQIgMgk1njA3b/PXA2Lstb/euKgzZgzHnFelVAo8D2Ga1Mg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.de29ad71_1547362059126_0.007628060340709952"},"_hasShrinkwrap":false},"0.16.0-alpha.64d88de9":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.64d88de9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.64d88de9","dist":{"shasum":"8b5756c8dd64aff01c6093553d0d75b74936bb75","integrity":"sha512-wnhya9cH2nAZ+H3LTXrHt1FUfIPuaAzMa1Wwx3b8+rIYnnyjLcjkUWGvq+ji7PTwC8SZ+UK84DH5HOHcK6iwYQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.64d88de9.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOt93CRA9TVsSAnZWagAAR/UP/iT726TX/0M2EzG8P9jM\nw0VXeAEm3xzsC6EmyZyGosYc7c+AcTSYI9XDuLd0grVxKstfgsXSRsiIkzvm\n8rfVvp77kGxC9E15xscDryCFfhqjZlaGusmAb46PilVZGvEdSHxpHWTIK38K\ntUwxGLfKTExI9xA/lRSqR4qY1MHAEXAs1PuhrJjWbOIZ4lnDvSUypOvVS4MQ\ntPh9dvg+RjKEDiVDKkpjFkvOtE550S4GX8ZV1zFif5ktoDDFBVyEfbl1CXZQ\nxsFgxZzMggS6tQps8bt93ocXGELW+day9gAvdK3PkOuag/FS8msShMr6xNLz\nsc3Z9L9YIe2hJ5YF23bnkEUVjOAoWhedaagFdU01svmWST8xcutBez0rIhJj\n065Lv/NVxhq15WsMQhmVXM/ff9cbtVjkf1NIYCCTQQr5kw+8sH3fsNtZ+WXR\ncHdCbQrJjm/bjR+HY40ramrXMoMDQ3+7D3SZQJjkwzD0XbsP3DEJEXFGcW2g\nX7cmw0VaDBLQfiPpycCuWnCmAh0X28Dh/Bn86IJnSJUKklGqrpRuJsSdCP+R\nRH/SS295SVHb79JNa4ly/pDQA0QOLAo2gLvS0RGL+ES03nQxfqC+8K0FG0hO\nUbFTbvVfftOUER+8y5clvgU/MXNb0EBcVzxzawIv/qzAGAgBZ2LDlQ57fRH2\n4pPT\r\n=9p6K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGlHAz1kTRmdJ2JtXQciFR4TO7PHiUP3s9RHKXYt4gTpAiB3/N5UpvdlrZwjjLt0dBznBmhS4FyOAN/bqJ3ffUG71w=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.64d88de9_1547362167245_0.2814994252167451"},"_hasShrinkwrap":false},"0.16.0-alpha.fa5adb16":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.fa5adb16","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.fa5adb16","dist":{"shasum":"eb44116b37b904e010d6c74dae17ad331215862e","integrity":"sha512-eriBqAmD586WUkcN5GI9Ex3UbjQB8luzJ4YwdcrVewothDiCpfzGsfCTVyeaVvWhWGP7CUBGIVOKPpM4+RZ1ww==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.fa5adb16.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOt+VCRA9TVsSAnZWagAAhfkQAIzUbWU3z/WCAYlxftRN\nNjd/wcohyAr80JSHExYBHf+33LTlB0kOJU26GYV/6IFi95GYgtM+46LkLcv+\nt9ueFYHwznbtMmmQUed7wFo0oFARo3nWLSt9il9a7kFN8Pl4hULsuKem12z9\nFP6tA76WGjmKRq90SB0WO4FUSdftYNTFOsp6wA5bNpotEM9aY3a0zGhUHu04\nXluVyuChnQjT70CGG6fcRN4H3C9FQOivQBacXtZ3xUXm7eDnl/kqNXyeA3Hj\nBXvIKpBa3KGlXpMY4FX+Dc3Q3HoXCpWVxokypZSVu97rFZTaKDNL7QTl66re\netqk0YBnhoAa1FPOQ6eFz8i/UYTNvcQQ2gEkrRlgkTV5ypgw07m2nTMyugfe\nWY9QIogn6dcfc0mI3wWyYGSANADIIPz5r0pjmXeOSCB1H84yi2IJMRbQpqGj\nBfdBu9BVuJkj4LrThKtrF+VFDmi1ttTMDeIpw/PuC6NjF77fbrR2DQRX58hN\neFeF4EUWUFVvcaakcejDbo3FeutgtW7GP8tQ12oiRH1c1AbzIkDVwnf93l1S\neUPSBjVu0coAfLcSwTlfJ8x1U0lfpjx0PbTE7rY+MUioe58kCGyWRh4ENyH4\nFs5uKixFoLn+i23gGOoO1IMcAZwAkXo14eCHC9Ije/sp+pOFNogjKUBVWZM8\ncW4n\r\n=+2fw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmNusYG+YT8jSx+AbABHJ7AJW/CtX7ih++1BxXiGNLHQIgdGkxkjsjkRA2gJcaUC9S++q9bUydZw0qTba07Xe2Ems="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.fa5adb16_1547362196414_0.5423990708410689"},"_hasShrinkwrap":false},"0.16.0-alpha.120c754b":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.120c754b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.120c754b","dist":{"shasum":"5e1551cd6b066169a1cd6bc02fab27bf4d631aef","integrity":"sha512-O79WKz5VBwuucQ5oK0EOCm7Zsj2wMqejXm4KyBtOVTd6LFju0ycRfKsSNkLMrzS/Pn3bo2yOq5RMkm6xgRlRsg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.120c754b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPA1UCRA9TVsSAnZWagAAt+4QAIZM/xxWqwZg8NjYUnSB\nW1RJgVb22sw9ZgzsljdsIyPK8f/iw1nZ/a2rpw/kBB4Qtla4RPFv+xvkIYG0\nShr12iHwS/Q2uGgtbrDq+GpJVKcO6kHt9OflX2FTihFJfEuGkqU3pRG4L/nG\nG//yjtmROwG4bgA+QTJh8QJiOh4RkbJCw4dG4RKr4jrBwBRy0Jnh9Y/dV19d\ndswLXT6j3gda1ieSDC2Tkzvr1f1shA9g57mbABbMXymeYL4P67C4nUI0ummS\npCod88CuCLGi4WO+CFz4jmtdh+uFmrBunqVorQ+tt10Fe8q42Zav8U8glz5R\n8URxH7cQ+fs3AqaxINLMJIlM7UVFZ5FbYDOkP2OH4ONIBxPD7iE18HLYQwXp\ncJ8A1TmWFYWYO/QPcSJ4zNZDtCGtlEdOiRWw2xO5SGiNOLsfevPpdJ2N/zco\nee0U5FsWYbm6/p8rLnRbiHP1vJquO/knjfXc4l6+zMqJwQzSA0h5MMRiInUI\nWUxNfjQa8+ZhDLKqlL5c1pg9uDxYxwyxaTWk4w82Eo4HM5pogrrrD/gTht9b\nBQzJAeGKbnxdqeJIuUTo7V1GoGbTJin1jalQdEoEGtUr9j0Nl1a8I3GjVgpP\nfnRcFCSyQw5fAvCVwHmArcW6G/32RTN2OI8Ii0+KbZq8GmCYAoTWubAjPi4z\nDYa6\r\n=JVog\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVym7rlSGRMS3HdslFgLQ9Xzfnwe7Awxuzqmfce5Gj/wIgaRSIhpsWSkB6Za16q9OZ9/YswxlpVzo9erKvXP2MX8E="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.120c754b_1547439443676_0.1695419609299842"},"_hasShrinkwrap":false},"0.16.0-alpha.bae9f87e":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.bae9f87e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.bae9f87e","dist":{"shasum":"360dfae13efb957adaa8a4442250182e841ac802","integrity":"sha512-TTQtfxVFpTpmV5O1wnbKACz8Ge9fmCa/8ekm5UXvMV4VxcqCmKn+fDRedfeDlhX+AtzPpxialHHOjvcWcjT3DQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.bae9f87e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPLcTCRA9TVsSAnZWagAAI90P/1K6+h6tXa4dv+5IDpaF\nmvG+g3MJnMZz1WyfEZQKbjcgCBCphRcmoh76IpIP/z28llFC2thO2FCGxlZw\njXU4FgOz1tZkPx9KThR28XnSMTNkg9LqiKezOPNrgE1dVjnC3cmgBmf1Yl9X\naPlo5eILBqxlnoyCEozvzZTvaXlvR6sdh7oK6csw40ltBKH6xDAY6LvvAjDq\nGr03TgXHkmA/USvqlgS8Cq3fZ2Bf0aIS6A4c3FvanP7Na8UIA9I3qfvI5ci8\nPjlLYCWuNdf5zyJrjJl1rg4dTqOKwQm54PpqsDRc0kfJOoiJcRP87aLr2tQU\nZ43ln7Yt8JhGtYzSMPSIII8D7vvT05h65evsD/CMvtqBm/K5GblFVGoAqxaY\nONsXmdeJZ7mOoCeyvnjOaoYUsRVKVG1yfj/2h39RXAcn9DYEpuTHQ3PZPUuD\nRUYgGXt1QPr+XXG0L3RZmyAYE5sE2wKg4ocrMnrkoEoQ5Fn8pkjtCNM7PQ0v\nU0YyINehOVymtXnNB/tVIeEn0ZbVSGJrX6HgEMDqL7zeUwyeJo8Mg1hfhT/V\nAQzgj/gLK5hpG/QSSRJzDnzrJJddxVvaIRlxXKNTKdvBmu9SERTW57Ujd/X7\nKFCqbm6W8gF8fv/2Hzqw65atPyxMF5DSkl7pvgVB/EhCF4cceAmDlpmEZc2E\nJW4G\r\n=V98i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJHBcRutI7eflBg5OW5lljiZkrdh0zMMdZMrcjHaCOAAIhAMNd5W0n6wlXR820pouJcTgvObrJfmU2K3FR7b4O+hPo"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.bae9f87e_1547482898508_0.17502857160832574"},"_hasShrinkwrap":false},"0.16.0-alpha.fede21cb":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.fede21cb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.fede21cb","dist":{"shasum":"7acff5e87f26a8b09b9a40af80b869b3af2b36b7","integrity":"sha512-llCcOCW1pRbK9o9skks9eqAScn+aefbSLVnxvpakJnxNwVq9yy/hEt+2KbNhSAPVAEHSuxA4q0JhvRq2wmCCiw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.fede21cb.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPLc2CRA9TVsSAnZWagAA7M4P/03KqusO9sfLNXN79asg\nHh0QB/GJ8NzQzqhJEPTJlDLMFCNnUzhYLGRZRNQ/YbQ0yHzmb6uX4L+dhRBR\nZwi+rhmjQS7fa6gnLE2ONL63sgLXZdqg2699dwyWTslQv7WCK7EBKtFhOl64\nNz46Cd95KPR9pkAgIvjywn2m4SAVPTxRjOvwK+Rvmgk0N22zDjG8EsSv4cFi\nYjYH8c6FiQgtIdepCr3MPDckxd8PMK8x7+3bnzNyZurkaw7s3qQOFltQIhtm\ns1ljWrRmVdtnY4dcwTJn7bNUCjjHH8rtLWvP2ra7TAK1R3vXKR2TX1TWWSxO\nHCZSDz3v0afwVXAIdqhiZGaxYrPaPXPjIKotKMFqLRrqi1tXjWMI/4Fl8bJW\n6bEkapDaTEvrUWu1JokFUuqZLnYr2SGMTASM1dq0Lr5W+KrhuFELMzA9AFTi\nwRJimd9kra0cMz1tRtgmttRWJSDZi/y0WleZNt6YtULi8vjkMW3bwpZbUjZZ\ndlLkKNTpb8xKKwGUFjMlIrDIJaQs2pYCn2lWaMqDyKTf52ZdUEeXzc/NJNje\nlNsfqD1zEegJn8CXd9R4B+zYHbL0oh9C1s+zb+q3jjAwjUOfr+MXWmXKQYPU\n08Br/ASZTbRaIGS7Rk1rzn96gqWjEdeuemypD908CWjLo/KKHr68vVxhCY8x\n6u1Z\r\n=B4rb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1fP2aNIAl1Qe1UWvLOoHqCQC7Q6TtFwTFWD4efKApewIgHftX1j5cZBdvipJIzSNAaQLc9sBlUhaXkxzVXl54sOk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.fede21cb_1547482933313_0.21241011639093643"},"_hasShrinkwrap":false},"0.16.0-alpha.166a8cb4":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.166a8cb4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.166a8cb4","dist":{"shasum":"a8e20322a4e95c6a131475d0c04b80a791dca61a","integrity":"sha512-sgreTQCvimS9tC2ftNSGTNJqYNWqqH4dB27rxNR3SloLytnhPXWDoirX4r0W2fAK5IJBV8VKn21jMPweqrjSdg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.166a8cb4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPQexCRA9TVsSAnZWagAArXEP/AwTejwKVbfxRRrA3j/g\nlargcalsdmV68L+IhDf2grbkUMbRZ+eiZJZ5sF6bYyPePkpF7m5uhFg8rkoN\n3dAI2RqKHFwit1J05G8klehUcsgNOHjzlxIW+d/zjg2oTVR9Bvvuaxavmac4\ntDbEtE6mIu5S8U5IBP0LJCtyi2M4YW33TN3oOOdjYQxoSZeP5Xn0++diuSuB\n4DwmtblTdjCMxW2uHWx/uoahIO+NjguGrjnIUEF+ADM/2ZTsh0x8NHUW7JUy\nZ4jfAhPytB/sl4M+Z2m3obfT3vbz/FazhQTGbqOjAYoXjbSsGrRVzVlqsQLI\npmw9LhGM+gBwpYnDtRrug1rG39isCbrMdzoOUJo57YTRnsSYhcTok7ZfR1Y5\n6tm3taX9I9K53BdZSA7k+kg4GdSzfb9Jwn39ZWMyeXWJJ/9h4GhV2vII4nH0\n29aMU+zTW1M4lDoJ5P844L/q/zOeXCWexRHZJPUPpdTHJCDrJLlC8Aw3FO5K\nt4rHreUrYeV+A8Y+rm2sDNTkxrIu5/JiZFe1mMKoXQlHdZBRP5ArViaH8ho0\n96EkzVCnlfLqBdS1vSlwRYzEfF2bSTj20hqZwhdoNoZ+kysvKXJlq/uywZyG\n15ensVbQ/49FMM6KlbCbRp91+/LRSCuid85zSWWC4j8NhoYEJCQOA83WwHui\nZMLI\r\n=555G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlqdlIMjPVdBUs5aDajEXFHBi7Rx3mkoAZQywRsMvaMAIhANw0tB2C8GrAVc8khCY4TdVwa8ZMi2s1NS8HQfBX/2tY"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.166a8cb4_1547503537206_0.3203776517115988"},"_hasShrinkwrap":false},"0.16.0-alpha.9ad25519":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.9ad25519","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.9ad25519","dist":{"shasum":"cb7ffe684d3d64c845596b9dc1c0e68f7f0bd12e","integrity":"sha512-uav3n1sSKuHmwu8G9tTg/htYYM96VP/LveMPtUmvdcAL1jzcJv8OlPDAuJcRPxT9iJK1ZB6csJvsdS7g95tHQQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.9ad25519.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPSK3CRA9TVsSAnZWagAA0gIQAIoeQFFj9lzLMTsgy/Vp\ngjICKhNnnXVUmRk7wY54E+JU6oii7btYq+Xrdi1V7BvGKxtEMC4xJxtrW4Qr\nzSR4poLz7c0QfhDQyRJNtuerpfqynKJwoj+ZS1Ho1vSX8dyY+8Ibeb6/O1Im\n8WJK+/hK+6MsNW1XP9H/C2X0m1bmhqMN+404D5t3TnwnLoitdQmYBN6vFnu2\nB2zoHJA2uOVxSg7LgO8f4P7tbWcYL6Hpvp0hmsgJ3VZlf/OUo0uf2QxduLcm\nLkoA+c5Vu35RuaoIKH5EXfjaPC4UG653mL9TJUKbMCFpFvwtvdqTzxt5HvS6\nNB82dcCIn7swURuhlTDWci2lQTiDLArPhPzx1Vf+61NaQJpHmDDm95sqQyFh\nbswYiVY9VFfEl5egz62ERchScEnpJ/tTTJ7As2nbANSsXT3Q2zgdhdY0Mipr\n5KUcbxPsi4M+oZK6oqkZEu8gxcAp5DpltuKmNqzHNM2qHVR707wkt9c3Jebb\nazECpCc8zSJ7ltzx1Q5HRlq5ZRZnGol9wjd1bGdpHBKIowCh52BNOqLY+lLq\noj1m6jERJtzHYnr0j+a0mFU/kS+GZ3vhPTemgwqLOtSxqDbRs8P25s1oZ1VX\nhQhFZIkqKmmBY40nQRhLvo/fMePSX7RbtUv605C/VKUjvtg7CdY4n0NS8++n\nLXGz\r\n=1ARm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCq1nr1blYfCnxzGUivWReEAzKi8OLw8413l5vD/jXHkAIgF84aozRQ6LxaneurAliSq+l8HdjzS7pix+WWsn19uqw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.9ad25519_1547510454263_0.6371342713319958"},"_hasShrinkwrap":false},"0.16.0-alpha.166332ed":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.166332ed","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.166332ed","dist":{"shasum":"624d48e29357361d809a63c95225f7e7f908b002","integrity":"sha512-/8dpKQIVEYW8i7BkaTvKbsmXvZ7jWgxN7EEfD4/ZmlnCr3SC6Gsr2PAh+v6H9/laYnIbKmoeeenmCwFb02oAwg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.166332ed.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPX7zCRA9TVsSAnZWagAAw3wP/2u1KQj8u7368mOP75d3\n71yFSHRZLCDd9fuS47jEYGxFMChluVeFSkoQH0QMVS43hn8Vk5UiBiC6BuKL\n63e30eqaXU2pCkULnT+YriheLcKAQHbmBQQOncaudimY6kUip+Md0KkbWTxT\nVt/Ux7E/a+ZLrSh1UOplpv0XVyNnxie1Ii0N9nvL0sRP/5mn1FyagKjECG8Q\njCr717xbkMed7B6+TcQL61dOc6UNnbC1x+Nnu+z2/86dV34j34Qrnmdii/6n\n9L0cK9iQNcgG4YHcLoBPukODW5wffiJfSzJrNg3svZcbWgje34mpUYB20VNE\nPFaEjuiABRATPHqa1c6s3At8Jxk1Q4Dv7Do1ZbtntKk89YgFwGaL4/ulP3GZ\neXdBapEA32rkLObMWThilKx2xz5yMyRZ9PmiiVDSRn16C6JHWur0q4aJPtWJ\nrq4fFOgW3SwKqlZ+BcjxLN9vNWhkVHUbgTSINB5sQvcRXvufVygNqAdIAQU8\nYjZHXm++yPif94lZpjGdxs3F8KPsD5i448Fov5KbGWu6gb5VGGdzB2YPAilu\n1xYkev+JTrfjZFE6K8omIeHV7jhSUTPKp2ME1q9zKpzYI2VXJ+twljWVur+p\ngIutsR5E1IzReCr9e+Y/L811Aqm7i049ZY192PoSyaaFO8JkeebTOL0zHq3a\nRGCx\r\n=DFXr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBUBzacqXHg0/lyKaJthIiFjVYR36O6EO4Myj4jNeqd9AiEAwSwtGizutkBjwOfgN8GjazuIhrEdhB1tt2dAv1aNXuM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.166332ed_1547534065838_0.03787857275688489"},"_hasShrinkwrap":false},"0.16.0-alpha.0f53777b":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.0f53777b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.0f53777b","dist":{"shasum":"842ae4fe8b0febde194897b631718fd1fa7d47f4","integrity":"sha512-gyiYKL+S0yPhZWPhV6S0txnutjIMNzIjgElA2cAQqHHgkT8QTo5VOkNq6TRgU4G5tU8F9JjMRWQcCJDtb3w0xQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.0f53777b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPX78CRA9TVsSAnZWagAADhwP/R+44Flz9MQwxZNWTBye\ngwUEvv7x7F7DoqEMeQ02eHA6ev8HtyO/Appbn8ZyKv673gfbo9mVQ/NEdYIT\nicdG6OF/kyoVxxIFkBWpooQ787u7QaVmhrsSqE4bnfAueE9uKkpSIOEvsJOU\n1xwfhJ8TekVA045aKTTiJ2aBCi/fgNVu9o7srVkc8mrcKvdC2hkeUaKC8YcB\nfoAQ60V4hWViZ2+UJnQkeboK3/oYQU881BXquPGMJB+BtDFviviXwRK15vDl\nuS0FLKcwyds2JS8hyuZ8PwsEJWAhBUI2LBiW08WHvTe2a3ra2os4tHtULOZe\nX5yUQHRqYOtWkeucsU62RSmyA6qz6aFOYWr2tp8Ydm3/apFez/Hb3G/nI3xe\ngQIv6MJOvUrMCjYh3nud+PNXcz90gYn85RTFNx9iZSFlJ5YXOqhHyw7wqrUf\nhb3LzDM1/76hknua8xCghf0I3dlp5O/gs9vqSCgVPellfsnJpj+lIvSAGzVP\nHOcUlkkcaMSBZUfBTlD7wPDvwY/Djkir/6A19xn+SgDWGFzwpoEtJ9sm2/Y9\nogKNwblySP/2fscnKbdXNcfEF2u8eqVSrKKPpFYJiJz8lFMVvKOfCXp8nKYl\nS3HNOe2L5U8l5e9Qfa8mVYRluP6fQVXZZXg5eSkifWszLnmcBz5LAp6PKpYK\nOV2N\r\n=J3ie\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDd12U5pR0YOxcDOnE53JgJ8j0ihviNC1QdwqZIB7KB5wIhAN7EHsNpujC8iyFyKj1glThn3+XDNUlgBkjn1/1fMTyv"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.0f53777b_1547534075384_0.9019464244768496"},"_hasShrinkwrap":false},"0.16.0-alpha.b599ac6f":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.b599ac6f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.b599ac6f","dist":{"shasum":"8f49d910443a2c294fb8850beb1d4fe638d363a6","integrity":"sha512-dBsdx1TjPY2AI90PYuKed4lB+uFOYl+vBTwwo120aaqkLoAHZvm3AZCETDkg1D4fFlrtnWL/jEzeOo2Wc/8Giw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.b599ac6f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPX8KCRA9TVsSAnZWagAAeVkP/jFb2wqRRRHvKeG47Sd1\nUUSMw2wXZYhzpjFh444r7+xGiOaDTXegE/kJZW/BheKhcl0BjVf8S6TqD7N2\nlnI3SVtKz1FTPQjlZRDbRnKDx5LhYc2zyEY7ufC7XWfwKsYS9mwjJ0Llexfn\nMAbISKnLafP5NwSp3vKTFJm1ChKHLrWx1VnxBYhA7V9yHUdRg2XyHnE+QLQf\neOV5wYvnE7Rj1ZFJeL3DtqDfBs/fartX//P+KYyvVq5ifKmeYCpiKPRiXw9o\n7z6EupIAdMq8YiG5CH+8muXLQKM2Z4BmWLlOdHRXGEb/3Jju31BsXffaXgiW\n5rvlR81rdwLvnSFkpcKpEo4cLgzBA20r7tljtnyGxv1pegWNcbUha00zQa85\n3m0Ff2KS9HJfuzdWyhDZQnbgIrkycOXf0Q+H9mbhJMPdP/PxUgnsGi0oaacW\n09Qn9Vu1Jsqqg9sxC9Io/pTkWAvtHmPe6spYiqlytE6NGWiykcF7p21iWSZR\nZ3+hnQWBPDF7SNXMKQNd4R13gDPwi2bN56ABlkxKPm9dgXKvN++G6GMz+mX4\nYHFnguol/4bDC9WaqTc6tdEBw5OJ9eonGqPqNu6ilG6hh4dWzpi0cYhkkY+a\nbZDUKEMYyCq5a75XyprJWAOFRZnJRZrpWbLeH1PmwoXJ5bNCEybmoUhPEgLw\n+ube\r\n=USQh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+xYGIOQQ8xk2VV3Hs6vZESijo3FzSayFQKqti06c+CwIgINFYSZm8IKCUoIfuUgpUb7CQcYWXbd3Zr4PhwR2XsgY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.b599ac6f_1547534089741_0.38119668402287843"},"_hasShrinkwrap":false},"0.16.0-alpha.328619d2":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.328619d2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.328619d2","dist":{"shasum":"03e67fff1e8e6c6462f20d903d516c334264dd41","integrity":"sha512-1AYL6BW3Zud0cVzSdu7ZF4XvPn6SGlgFnsMAcRengFAP1A5SE7hGGERvHQI7GTBe7rKgtnwgMD0IAwJqnpLyJA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.328619d2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPX8ZCRA9TVsSAnZWagAAJ88P/RVzKUm75ONX9z58/Tzj\n5W2Ei+Vpyt6/sutsEzv+kArppKg3YirF64vLg0OernyrSWPaoAQLxdWQzL9w\n0FKL0SRzpCul+y1UnhU/oGyRD0QyXqFwbRWyHzpu9AdQun1cInW3OhosYJTk\nDWgvXjyEeU2YvFy4W/ihmUxWtkaR7br/zhxncbpeP/gRZ5sPD08NBlMuVDyM\nJ0wZ3zPL4R+NlgoQaS+iHqjcMtfoJyv8U8K29iqZmiKF/Sns/UnulPeNlHMt\nxqTUHGByBuyRFpgwjAwTdLQjVWEPjz5Nj6GIu3rL2yYBTi57omsYAE4on5f/\ngab/H+pfy0HYMMWxJz/AQkhtO+ru339FiQ2iNacYJ4b9KrOEtHCru3FwD1Ue\nhyUF6dXcdI3uv14ygfWeKmdLpN3b2U7TOrC2QLuC+rPfeA6fxS1RmCtkvgQB\ndawKWFaZYh5SKdASoPNk7V8sDxuwLijovyeo2wcS4DUGHPI5Daf1eRoWfh8R\nGLA0ryD8YyBTr9hrd9lO32t+eyj+E3T2kgFFZABy4Th8Uc6FGSXGwuXXGiy7\nlixKH1SH/LS6mQvaAk7xWoQs1L25MUw3meYkhgOJmNxwr5OiiT68kRuXDnjH\n5/7hpHa6ytEVPZQtZxHXKuUCHSUYr5dPWAIhFtyk+/71RNRC4Ih3lKSwhLu2\nUVek\r\n=+/YB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICc/Kkj20J6LjUKPN1Xcfp0Qd5R0mPqPG2T7/R245/MQAiEA9l3x+8kJfu3eB9fqy0VXp8avSBc8FS0qrS5gJ/dLw80="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.328619d2_1547534104675_0.3767429256271957"},"_hasShrinkwrap":false},"0.16.0-alpha.ef7279b3":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.ef7279b3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.ef7279b3","dist":{"shasum":"5738299ce8d5651d4080ec0e3727a6f8859f6b77","integrity":"sha512-08Jb+AHZZTzImeEnRggBOJE1ZhXS4pi4WbCIsfRudeUF60OweKXWT1KZG4TBnNzO8430D93Y1KY0+pyCbrhRaA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.ef7279b3.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPYAFCRA9TVsSAnZWagAARfsP+gOT/K7+L5rBgi+TgX8B\nio6yhMJsGlGEZAsH7XLFgu2ty+v8JxKHf/2eaHhQmKzEvlLv9P4cupywkFLL\nt/REa5gWTwUjiIWTa1vMwSLheHq57cvDsQ9vwlXWV78VgFiRl1XsXrIT7v/j\nvA7HWS+VMSjoejVw8i6+RpUx+JdcPV3dhzEi85yYBt1MDdWYwQwSsY9i4nAA\nKSu8IR3zLoqHLMalNxfVWvM+03LKAmooZj/3B0MLSnUDNUfjwx6sQCJQdeBH\n1KKynnvqZ4Kzvn3XVmye78qMcbizwaJyultWYbNApHmS887hAsZ4jcAC0mKR\nJt3FT0GJ7DozWsyQ0b88Is4p7XK+kTGl14SO2KGFYJ4uaaHfXsahAau33qVD\nCftzhnhcuzuq3O8fdiwwEKevqPgOIv6a6+XhnAu64JClTMWPyrnb7MaNW7Pz\nu3MiDateQN+aUvD3hVgYDYHYMW8jZEClCFi1XzkB43WN7W6bCWGh/AejY3vO\nHgfEX9eyMsjRqXK3kZXONd/f18GsMg+yFMZ6IEMDlYAM9uFYtPJAuUK7Tvry\n3xgNtVyH5O8iQzt+uBZghTaO0oGFE38nZWqcvBVNXAktfhLjmBtj5PDlxUSP\nOUKTAgajmyto4qM7/4s5UezRFtG2FKaY0c9UT1p+7laI1y6hTXG7Nv5gjCw1\nHPCn\r\n=/g73\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxmqMq38PEUTjf61a+qa/Rer6XJE/j9qHRAb4Q6rjxbwIgOZgTynnS+qP7QgLnQo0hHmX9u2KtNuUFRkoADxpIt6g="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.ef7279b3_1547534341222_0.11795256963305567"},"_hasShrinkwrap":false},"0.16.0-alpha.800a4f84":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.800a4f84","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.800a4f84","dist":{"shasum":"9fb188fb31d3013f13ab1fe651b49ad3d5d756b1","integrity":"sha512-A+LzTX8J/Q5418DXXa4awJdFEvUPceBahrgBeUX/RHRU+yGJCMwBamWfiXQWltITG26/AdUCO80n2Atg4aou9w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.800a4f84.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPblmCRA9TVsSAnZWagAA6v8QAKIpt6k09RoKr/qrEy5v\ncjXo1gLlJm0/q5qI1DVgFtol8q9ho3Fe2CkBsjRrOx9MX+xPIMYGBRYw0G4H\nlTTaCSLhDXFSbNlq3RK4Q0rdhqWm6PLjxocpa2Zb8LcNj5lSZEMoTXt7fV6h\nTSO96e6io7uomAT1NC4FDuZHssObnWbQX6JOYbSJb/9QEzrmiFDRtXDB7VWR\nvWWGzzjF51dV/Pvjx0K+kqUFa9e5njF0UIcxPpAMynLNY8f6EMf4OHvumnPj\nDKdtyprdANrr25x8T0aud9H7FwAp1XPuekLFLpfI0V7wDG6rh1TgMzNNAzsV\nV9kVdyjy/tlONJa+cimNiwC7EH9iuO5CxRRrfj2s/hv9oqw0TxfMi7VvCBrT\njFsTMf4Wq/62GBixfxgCI2/IgJWqEK6nJC20UwerY2JcQjn6o3tjTIdwjdR7\nz+Lo7xGx8ECA3tUA2zBI1LsMcD3hERK7s/WS5cUy2CbGOUSVi0taeYYFGpVS\nDhNR4g7dSakHFVnAGNx7Pe64AkMUZXfpvji0YCveG4ePbzTL58G5cTo0bkV8\nORvxKnep+V6QE9zdcHGAcCiRAfwtXPajHm+d0ajwLiHAdOeBzo+1p3QHLSPc\nTyxSqJamTTd6uHol/A60vErJ20EDq1zR8ocUHnAed8A0/qqDbBWyEvY3c7Uv\nwiOo\r\n=iarr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmRz3TnTPdZ+Adu1pcuDdD5HRFzHUVW0CODLtfZpkNzQIgHPHyFuTv6vBsDB0SRuQR0k713Zf9XJR908wATLDYdCw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.800a4f84_1547549029608_0.17603666325820777"},"_hasShrinkwrap":false},"0.16.0-alpha.335c3162":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.335c3162","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.335c3162","dist":{"shasum":"3898e3dd7f48cff47f553afd60c4a331e2c6afc8","integrity":"sha512-AszT4+A2siJWVnYR0UagbRVbwkzTIV5wJm3ch6Fe36CHwV9J96u3MPuln7Hqo9FOG1AggmpHjHBIfaXDntmCpA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.335c3162.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPbquCRA9TVsSAnZWagAAXgMP/iUezpb5RnM1xKvXa4b3\nNgoPJCm+Xj2XOn2yZr2R7FvyRb894nwmDeawK9+VxkkO3cTerVOjlFWoeg3X\n7BlMaJ6gpgoaOh9/VUn+zNcQXfuZshT2/iCpKyQrpaPYD+/pTAAQlCd+2rav\no+VumrcjqcfCAesOtWhfmupGq5pFYycy1IoTQ0ZVAPuOL1kN11irOfaTCaws\n8v3JoKiN7HD9WovVOS6WVB7te4ij5WFPSWA2Ga0V8xt2L6TX/rqA/w9aVCoE\nIUPJPgeYkEEot7OHZ76cdSB5j12dNE2Ms0Icno1s1zKpb7ewLKCN0xLpRxV4\nvTtG6paaBrqXsZf5KaqaZYi+BX3CV5gmeh5B74Ae5LV7F/6WqFUbLuZx4gDu\nnmZDK7cXTOETVskTyFzoZK4G53wzg26siwpjYqhSI/PbaoO1a1ZKNT0BaDmQ\ny0Tz/QkyU9ZxUsmQj4p1VDmPwiS1xF5xnGlIMslvO2fZz7ews5ZPiMOUdNRm\nbSvRm7Rk2pFwS4LvMilsQC383RfOwuU1bIo6dGtV6QLVUJTyLL0kTXU8gmti\njPE5O5feN7/q9LC90UnKrnOerrN4PiSnmUpAyKq3e7xwEVodozP1eMylCBen\naptH9rrKQRHdeoxoJvEq9TGwb1Teew5+SUa6MZ5i1q6QL/3/IDQcoZfYq8fq\n19BX\r\n=mQ9J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrmgwVunM/0/BMK42KxAK57n5FTN+OYN9nAqBgX8IL0gIhAN/97ZKO649lSLcr7TCFWr274amiT2LKaeJdwmMZHQl5"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.335c3162_1547549357520_0.8255198525877205"},"_hasShrinkwrap":false},"0.16.0-alpha.4a0017d7":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.4a0017d7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.4a0017d7","dist":{"shasum":"53bc61d0dc7cb11bfaf11bc5e29d4e90550f0ee7","integrity":"sha512-edDCbjPAxdNgjWBzKEltwJnmBO5hezsFxvPXuI1ZqY7T3wyXoCyaGmiMAIbN7UpHJKdhzrK8qvbVT1LaNwnnRw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.4a0017d7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPbwuCRA9TVsSAnZWagAArQIP/1N2L+tbb38xDmqJvuC6\nFcpuOHA2pk3k41hO8Ze0K+GB2fHLj4HC9PoknaiShS+plZroUs/UQy8Jy5Jn\nCUDVnzWyIi64rPVtXUw7DinC/MkGQrabI4BMj3g/u8tLAp5saYkP/Y2EflyM\nXUREgok0CCuAHXO66YLpqFVpyReeBmvaqeWD/31R9N/r7iyaSqTXOO6uLV2c\no8TvEnY9qy9sFDQMz+ZQukM1MIEnivuOAI7jxQQ1bLtMCaP8FVAZxqN4GXi+\n75FnpVuk+naUjOygURa1vLWKX4d/5qMkGaaTeyEGnO32bHhv/8mqMI2TcYae\neKzD0VG81zbphq+AU6cR4Ofv/PwQP4pqlFR+a6I90KZXwgoQ5Lb7zMZpKTs0\n17VaYAhekfka9XOo2hB2a0CSNkZqA4jd4rTraz724cPitOcMyZD3J2s5hDoX\nD6Sqr79lQih01EMcZjnni8IvbNj5fQEO60dbZJ0ynmN6PQxMmFlSf0mTEN6/\nj1W01XBfwuoVISppurPT/YKkfF+ZsrCfIWP2IT5/bThM9CQ7wajSekwsLWa9\nZjWm2rY/gIpmZer2Nk7eaVBgLPaGkBwIN5Iz1ZF/cBuXRoFpv0GoSuNjkjIM\nCT5MG4k/OywM1AU36G1BJM+PAivtrcYqv9M0PnQ2exU0l76jpbFik9Y5NXx8\njbtn\r\n=q7xl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG0C0yMC+AWi+F4W6NSNqRy21wVPvYMHecTpthNs0vAWAiACJnGqdYWjIbxEb3Yt/ZajJLNVa2f5PT0HNpTPqqcy9w=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.4a0017d7_1547549741884_0.8903455619177696"},"_hasShrinkwrap":false},"0.16.0-alpha.877ab07f":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.877ab07f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.877ab07f","dist":{"shasum":"b11a81f7de7236c3807b3535c167136346d21b2d","integrity":"sha512-hxgk39O/w1bs9FsKvxZSGF2OBTxH9SeNOxooJoIL96HHr+KCxqPDXQfVqJ2aGaig/EdVDeg5IyCS6bulYTxL5A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.877ab07f.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPb3JCRA9TVsSAnZWagAAtR8QAJhSJUKDbq7iERWsJYRM\nIjlTKReyfAX+W6JeUYaQFcveoBLs94NQPo2s3JgN5BAD3B6NNfEb6gJBbKPR\nY9vEFo3noRrunigWmg4Vi00f+D7OsVj5vwk0ypGzdIrgq0B08ps+/njwgwn1\nT+/bNfAdD0yFes6yexoAaHdl065omAo5TpaPUF5QiCInNXZyS34BO8QfoYbO\ngftOWpb5eAux4mQdOZhYTajhP9AqaMjnlaWx0Zy/uIQvzum5vSxcD5Yj6qvh\np4RLZPBsjEs+nfMAc0T4uZKVCaKLEPQRLGHiYWueCsKL2ww4gyyVTtxPFb+a\ni4SzBUwKlmxco3HwzB5rfHBoZLQO+c3ObogR4YAX3uMlCE1e9VN0x8tK64v3\nF9ciClofBTGlTd+HBAtHNhFsCKIzsRNUEDqKbfqY7dsBiroTqPNzmvgLgVB+\nikjDO7vT7HoxvDDWtkpM50xJyoKaPPOSy47Xd5/g0Acj3tf9tbG/zmi22meD\nx7MBzrHxf8AnVq4xdh02T3GgDuniaEUZeo1brPnBQXfDahJxHuGav+wnw2Ll\niAljcHSNO99gOmqv7omFDkA1nVFGBIEciYPHFb+gLst6A5qWYFFEAMrebxFJ\nRweuayHwqb5w1LC2E8/m/4hRc3RR9t12eYzYx0z0XwUDBNnIBYQRqVjIJNrx\ntFRS\r\n=d9Cw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHgECnrfxcMwoWBMWpm3Y9RVN0idgnvUfe+4wv2SG4SWAiEAuk3N0Rwpm7VCIyFcZ114Ln/uFdo3kn8cOSwe57R0NNY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.877ab07f_1547550152784_0.6925857550470211"},"_hasShrinkwrap":false},"0.16.0-alpha.1ae79418":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.1ae79418","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.1ae79418","dist":{"shasum":"e93f78a1e8f4347d13268e0b8db038c099554588","integrity":"sha512-CoP2AmX8enFO2LaCH+XTJ5RnoBZKfthPkWzuMYvlwWA2GXcnfmhrGjsnDA3n6b89Po9IYzQ8RaRWUO7oUIB/MQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.1ae79418.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPb/5CRA9TVsSAnZWagAAvWcQAJD9xtwliCBheNqrdj7A\nOuvAOatCMLFeVYfXB+UrAWAmj9rIB+XvcZPe+XKzJjlaY1UfEw8n1wFYOwws\nzkh8F7fCbD2jfUPdK4KqoAOPWtkmfRxjVrj7zgVS4dic1r8IoyMDVIEcR9eD\nEWDa8x/ABf8bn9gbQgxyQIk7V+Pv/re09Y43k+h8Hq5EJbQ0ylvJCTs7X0rs\nAc3FWfJ03t7852/iOUAdXzotyqRq3cuO0mzTMB0uHLgqYeJQB7sls8FWlulF\npbeWv2oaAUdEJHC3h/nyxzffP2g7q0kL80XaCmtJj1Ui3HoFkppfVDzNpIR7\nID5e+8fxABPPQVdXzkQf9X7RHRNQ+vnG5FbkIhky4TZKQve1yc+gS18DEK8Y\nnzfKNS/8EuWEXznCwWP1GuZwgim+Iq8HPxY2XX4xHfjCzMLedAiPs1PSDkIW\nuXztpHRaztVA8ouaCRDB51ScbzPxOjRxmbon1LlWOnIBLJn1RJEFu/OjAvog\nWWCF04F4w8//wuovz3HuBIKwfP8KT2o7IIXmaqDHcblVFTX4uMDCeIqIHcAH\n6exnHH1dAiZhIdBgfbAJIrGJ+83Kt2M1Pq84+fIu9XXYbRrAfZ67ePplRX6B\n4pHvR5wDUrIfzbTvL9PARVgK2tHf+WI20P13c7hPYaPkm8UXR0awSBQe2ihR\ngpDL\r\n=xXEN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICnz2uXZ32wI8aejK0Oj3DVav3lkoAVQSiSKmiU03xudAiAeEx7US6PLWEca8p5A4oBiv29WDWsA4kNZ6iq8NACpPg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.1ae79418_1547550712781_0.07226035423394861"},"_hasShrinkwrap":false},"0.16.0-alpha.ab0aa902":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.ab0aa902","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.ab0aa902","dist":{"shasum":"595cb3fcacc5fe5617f31d9065486772cb2db567","integrity":"sha512-vWwvcvEpFExJrNn3osX0/DNTuyqxdCzwBDVPUxIt+Z8YoPlKgmq4eJlvgg3/TQe6z4D9orEcUqZQwcgiWzpQ7Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.ab0aa902.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPg8eCRA9TVsSAnZWagAAaSEP/2+BfBcf8KG5bRPjBjPO\n4jUS1hhSrtV8QpbjPGfW8hfgbZCbF8yyvjtiQBt8TWlfT/sLBdKTzW0+qwGW\n7BRdec9odopIGuXD1KYxHie1mNBtYjrfIGw3U3nNrAmTzQsFIsx6bZJh2V6m\nZCyPCdqJVcqm1bA9iMvaht0YuvrZuyK8YRMyjtRPZbt7SqnUz48VMeJPL1F/\nMgYDvaEYnEzw9H00SzTBWmBL5S/Dg1PuEgvHdJjPqx2TvmcaEWL6qQauJSMb\nUYtFqinEtPM9jW0rBaqXsa3NWJn2XluIQTe7LoXG3pWsLIJGwBCrE4JhBJNq\n9ryMPYEdDfCSjX8cMJiPHv/SIFTds6e95C5I8vsqweXH1rici6EAftRcIlcH\nP5gHDOMHu/c4v0D+9PqL5uqw4CGtpx16G7dakCZrh4/5ZmgsoQ04b2izF4FR\nCp4RktRluGeke0Ong60D7P3nBKWxoR6R9U8DdbTP6XFS3l1uCskLk4Od+Aaq\n40WP85j+EF4OT+Y6aou1BahuJXeAf2tcHnMYcDTdLa+0atPqLDO5Ej5S5Pb2\n8an44LcwF00Ag2A+WXvMQuY74PtnKK+p1pMe+ivQp3A03y1sv3b6UEtbUZxI\n3G3Rx3fKGvCGPX9utpb8bgV5GlmLmj3jmdMTqZvZQQmCJP6iJJs9jWnEdgz6\ngOCP\r\n=YfOB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+ncr+E8QM6vlcg2CNvZGT8GKjBnwNro1V67BiweBTXQIgDVIwbOD9TeOHFQjrvwZowQOiLOIp8Wv4uWP71ub32sU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.ab0aa902_1547570973753_0.8950535758109552"},"_hasShrinkwrap":false},"0.16.0-alpha.88766a35":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.88766a35","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.88766a35","dist":{"shasum":"403b381e77d04a78a3496bfb7ef0a3fe5b73ce80","integrity":"sha512-74a7gBxTC/oLi3QNEiLb+PAtzPawgsAyE2s2DYzXT+wQcoIjK1VlReo+q0OhAh9mcVYB4oFiXzHzj9vY3DHrJA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.88766a35.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPmTBCRA9TVsSAnZWagAAUZoQAIrPIqxhMMwfjGxMJexq\nBpCdCYK0LQgMv2/GjYn8VyuRtit4/Rs94aBuVHmLZb5bk9Pfm6/iRNPGKulr\n3YYz0kc9mBbynUz6ZsjXx1EPlgJdkSQfaKIoUfwvC5L+hFdIVLYUaZSFIOSB\ngPluAD3n2KRKkxI4xi1pd/z5MsoXzy/4B8IMJ5r0b2zhxxPCsmzd2D34Vh2P\nhfJFRlFqYJ/BJn6CtJaEdGVN3v0y+gZe38wRcOqtdyqN/Fc5sNB5pbhd2gE0\nTk1cWUUo1z9ilYi2S+5h2l4PDJdmJp0s3IGtJ0e4E498YSLAgNOuo0FBuN+O\nuFHH9N/By4qnvleW4nYdA2oplKC7bEzLvmXYDWg9mESXd31yQpL/IHf6duYt\n4J148x0s6wPdMBSJp9Xz7p95t+pSEVyvcfJU+nNx7b1LSTh68vlgrWadDvn8\nr10iYhtUsK1h1e1x5vvBvcocnPfMHRLFlVEOEdBF0mUPssNK3GECS/iBkGWA\nDE18Wdg6DxUjmPinDmz4P0I7laB6qhzX1wFsjn++xaM2s6iVFzlWAElM7gDz\nsSaggrF6DrRB9gqiWnlVlQrQSBP7rbOToCQeHJ47AQCqsZ9SfpDxtzxGiesq\nurLo1pwzLbZTO8jwBvoRkN+nnuN2ov2+jOVcU4FORfg9XLyluko9UETHOXUj\n6Obp\r\n=3ntu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDSSRW76prqCoofGzviicCgcBGOeZg+NXOWKQxizdgUVAiBTJJFyHL1CN9R7iwmwwS+L/ytlA381gdP2TeQq2HCqSw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.88766a35_1547592896444_0.4756942484280793"},"_hasShrinkwrap":false},"0.16.0-alpha.6e31bac9":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.6e31bac9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.6e31bac9","dist":{"shasum":"0141fa5684505f169ce7f31d24ab3c225e42678a","integrity":"sha512-MV6WwwyN/Ex9ljsTK07jNXhcIkxnt4wv/+ylzbb1WJ4/9xPKjEOY+7ax6EUL+v3PoJJ7UQQrIbvHktW1740yZw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.6e31bac9.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPnCtCRA9TVsSAnZWagAATUgP/jZ3hkKpWnqu6uJWoHhi\neIQgj9L0SKDGj4CmjaUjQbGFa4iTVtirBxOGXPXxoWJo0s1uY/klTig0NgzL\no9srqcP82weEl3ii0/FEK6s45AesuZ4eCNoDASSggaZGd6DyWd1z8vLE08YD\ndB/r0y+N+tHx85DdTCx2eKN6ZMHS2ajtHf3d15nBPis8L1SzlXxIH9CRARpi\noFgssDF89pK0OS8+crYLSk1fcYvuR2OJYHwRue5OcHOOzIrRnYrS2Pjqvu64\npzjDzvo9sqXhALfSJx+3CqQgvvQmbQJASkYImtcvHCYu88fe7G5fwzUO7Fn6\nss2oI8Gd47wa2F3TZqaLUGd3R0hyHk6Dowh8ZEv5mGVhsnyQWUj25MonjAod\n2/PNQEkP97NsOLTvVddDyKXHG7kDP74abJXlZcLYTxLNBbwXJcbZwxGMqEZD\nDc8V1rN1q20MitHxjR/Fxfsvx+WSh92f3ZE3yy05OLuza3Jurc6juvysw23C\nV7M6zWnc5kwnSH1J76+SrPiOobm3lqb+FiQJE5dre8+it64cdIZDQXAK0Z3f\n52GDvz6YpzOa6M+YI6HE+muzOloworG2vCX/odo4TMfzCmJNCDc26xSoGZbh\nixn2SupdueW5eY4aSJwki5hweaFIzb9jiC7lIHN0hQK3zDZBRBiJqZ943igk\nw0Gr\r\n=FiZE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWKPyT2rJwNIjAniv1/X6HvyY3VOAE7aQEVzt1UDiXnwIgCkpEO+XmeA7Vdtm1aMhD3E25KTXpiU/q2+z4E/BU6oI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.6e31bac9_1547595948415_0.4969393104209323"},"_hasShrinkwrap":false},"0.16.0-alpha.426d2e96":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.426d2e96","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.426d2e96","dist":{"shasum":"e2b2d03c98b1823367a48695cdb0b9c147ecfdaf","integrity":"sha512-qZ6a4/4axxgsF/GylhuOT/QoRu+wSSOUvY1/WArjA65MsCdJmbgupuZxIaMdoGqZKLgcaZR9eVBSfrRtGmz+QA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.426d2e96.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPuraCRA9TVsSAnZWagAArrQQAJnTrjupB3yXtO0SHAL+\nYH7cyrjHNSFCdX38beJwUjQ84iarn0qCYYYm4apPeUOrKPR86i6Vl3WSvGur\n+iBjRQOawF6WyfG8M2XNlBKcNgZA+qvMaMQw/OKNCqbuKAKRitRj/gMDH+Te\nF/IWoSw76Rw2imUEezSxXikIFTUKHhKZZ5bUe6lpA9DRDBwER9XG4GRXwjs8\nLXVeS/9CPdQwp+rbuMK+tyo7TXrgoh/PYTWqblWEIoP6a6NjCD9BotV14tJ7\n9Xi0M6GIJIV5WeUC8mrm2LJut0Gr3c+1FoNW/TS9xTU256N+/ZgTne1ffbxx\nz2genNnU8AJAADOnckjZGPe0P5Kcfj/O1TK+oeRYgVjQt88kTAZLCU7f1Vmc\nDVftieci4izyxl+Z71EpmvMP4bpEt1xE9WJOCoNSXKcNy3QkPeCauzY3VBbc\n4COBYm5EfzykpDvweBssRrAaW4r3UxoSojbuBIxd6Rk/UvZD788fvg1Qmsfl\nX6MxHvpWHaIsgNMaoAPXu1DCrInHDTPy9DxGD36qm9QT1IGdsm93DPFUXe5R\nCvRqdxpdC0kRp5iRN1EjQQdortqIfH3KjeIU/aKFGADJVQCaKEdDYqCWpM8+\nask0XzgbVUc+8aNWl+2T2kjFUMC8EUl7voz2zc+M+2DdN/IZC9AxtXfsc124\nHBKx\r\n=5BSs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCg9NkDDLvLwnPMgvV5uweqry78Njd1QhxJKpPZ5A0PKwIgC+DpA/N2PqtSTltlCFyLM6c/yqGl4MnIh3423nTTXic="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.426d2e96_1547627225422_0.2825002520291844"},"_hasShrinkwrap":false},"0.16.0-alpha.9868fdff":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.9868fdff","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.9868fdff","dist":{"shasum":"5f3392fd5579ad4fb7fd0e6d4857a83ba563584f","integrity":"sha512-fnNX1RPs/UcHHZu9VvYnkvdn2zoj80cGmt7koJBIMa+nq0sJTzcLKr76xkU3zreclpD2p4VPmKBeR5HSd985rw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.9868fdff.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPusVCRA9TVsSAnZWagAA6D8P/RXlYeGDvrsCgvU0r96z\nRwXhGVkUW4cYgD/x3kWs4BKXrOd4jxMxUhw6RoEkvBrZtJLLi0Br8GXQEA9i\netb6rqrn7myvldYiXoXto52tbofN/CQy6cu0gFt1L38MpRGqHr0pxaxRRrn+\nhvfZpDij71whkz5Kfl8rmekuEIoVGcKOEa/BNFN0ti/hZLc4sItIP8lz8IeG\nS9kUFR+Pj6wXJE3iY0iK8z+zVbbiAPwf/BS05tdUTihaRfDFMXm3bzM/0h/L\nV1/TN0Ww3ktAyrsp6w1vTiYkTBYzlWOrU+p8AT1Di/uhfIDkwiZOU8RkByUC\nn1cYWzROJ13hJZoxvVkaRugbT9MsGp6SNJQlLLl6g8cVPpbeLxpjby+x4fU8\nP62kkdCM4Zgn2SAjLEwErksf4b00XRogIIYMoVzutTFXq+ls5Qml2fYygyea\nDj31RmK+PraLLwjewyRAdobslR33dEmehFuKQIg3oqitqXE+2TmKob5f5OW4\nbeDHM4TTdme6a18ehxS3c7Fk8JAzr21E/Kyhqdx/5HAO+BscxMYb2DjOGM2e\nGmgkoH1GUguCKAl9fPmSWKynZ7bmecjmxfAD1JAH1Fi9Gosem16B5DEEiyUR\nGZBZFeEPCpVVtC80Db4Kb1qiSMnILQxwgmxPaSd3QOfLu4ND7RbXGzW0Q6ot\n7KGs\r\n=VKL+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxvzQM5SLTRq3tA1BxQgmLLC2IF6OSIK0BIK+uukt96gIgdxTFUThmg8f+K1LNJEG97UsrbxRkzmwfQusy+Ar/7cg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.9868fdff_1547627284606_0.1809262794264992"},"_hasShrinkwrap":false},"0.16.0-alpha.c8f3ac85":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.c8f3ac85","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.c8f3ac85","dist":{"shasum":"b8dabb565126a3b2bb9413000b545db325640002","integrity":"sha512-Qce9xIPe0YPjziUy0+2m9fBG9wfLYezAmUZ5fxorH2rWsB1ZanimlIx+MDr4HjndYxFAWBQfsX5hxogt6/suUQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.c8f3ac85.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPwHQCRA9TVsSAnZWagAAjq8P/R5jCYjLnX/oahGKZuJw\nxIXfXOZPj5X3v99qOyolroUECdmunWoSGYP8M6saVBDNjCTUOIaF1fAG6LWA\n6Vj3SbbtYb31XNxK392OrXcQqIQozRYyIpo09XK2/DWxu+1weg1yp8osTTKM\nSc5l2d0kXSmkWzhbsPNQjXPAB2SsNIOCz+/ROgbf+mi4occchpOppGr+OTAh\ngcgkAtlQnXhWzHZWI5/jZ5S1HLoIzNqlZFQ8n/6KyuCJytpXHzGn+KMhyQnC\nBqGOipIbWeJtr/8sW/gF+0sV85ALt5JAkMVCZLMEJbcbDQdRutDDgvqJbtuO\n4dPy9nE8ilodXTkxp6gn8cmoIU8JhgAALao6zJ0Zde3uUeA2Y03tY12GqJgH\ngFkb2DXsnTpnKUpPnW+BxYQPpBuVfPHZKZN9XK0dnBzzSi2Btpd2cxnIq5K2\nTsI+JjDcguWnO5DUBI4t3hd7HljTuBKDMNm5YyH7CgOeyPZfqaZheq7iYWka\nd2XOPbvj1TwqDKlkSBRTEqE9eNbHE1NfAb+7146rCbq9WBQyIdoTeHffHPF9\nz+964oQ2432j8Ha5bMoMCeTVxiynpqhFkEl+EwyDQyvinierOxZNJNRVs78o\n+BLN+rkMNkEpLXgFqO1z4k1jcF+DokSGCRCqkE+OPYhGJtAqRWZwAuQ/vs+b\nuA6B\r\n=U44D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICDAwIatCWTOyHDQPBzMKO0fP0L2is3FRE5esT2g/7D1AiBpdd5TyesVLLs9cnSstV4HLI8JtTzaHrXTuFcAXK8BLg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.c8f3ac85_1547633103782_0.7844240237827591"},"_hasShrinkwrap":false},"0.16.0-alpha.2ee3819e":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.2ee3819e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.2ee3819e","dist":{"shasum":"73e1edc4cb5a7dab7be955e3fa3599a7aabc017f","integrity":"sha512-RX1VKTlbs9//z9YOeTakrngfHj0skngg7AIjdjr46wMBYK4B1OSPwkuOoglzV/TqoYrM0cCFoD8CXWBPsVv5rg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.2ee3819e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPySKCRA9TVsSAnZWagAAkSgP+gIFEPvjXD/oS+68q132\njal8zxPJkjkDscoJ8ru/LFxquSteLB07DnF0qX0zrFOa8aqtp0w1sbMLiN5i\nO7T02ZYwFyOrxVzuRT3jc2QYaGH2AX3Qh65hqFcvvO5O5E5VhEw72D7lDt+s\nf15VYnp3jTovJNI0jW8m9jkbYQUJB0taxC2QLBmi4tSxhO0z2jmnFkc3Tqlh\nmw8yHaN12u6YVdHCdvAXYvO71g3PQORXfwmN7r1D4vBj0Lb6CdHyagtxDp1a\nzeIqpnMOljLf8ebwc/0Ihh8xATu0RW6ooZnyaU40vTCMhT/KrpNXi4mYYz3z\nN4YLge9adPTPyFlZ8iWnToQtkX1FcloNR1qh94yLQiae2LklRAoly3zXkMe9\nm2om8yTBgmvvcFKf4WLq7E52MD5xpk243nVZCPLGm8yIAPuufui6E69tMqAC\nZQgq739OmxMlfGhYfsXJM80LZL0pDOISwxqbouDK3sqjvHoB30VW0Zz/eq88\n2rnprUqVL6Qds8AfGYO52c3usJdwdKG1aAH1NjT+eIfed4t57A3R91GssqJC\nKegUPikJb37MNNgp0KUDTBoWJEeYbit49281E7c34coiBtXlL8jH5bpVIsg3\nQ/8hyXJRLxBuTM1qX89z8j29AZxapBU/y5A57B4Tc2bDj9QTdH8t83f4NvCU\nD5lm\r\n=mxJH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLQuZ9uatVGOZV0EDDSHN2vVx+xSBz9CKMIg+EBq4hbQIgVaGm9hlU/vNFI8sjJgTO8/2RE1tBHSnOstCQeeSs/m4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.2ee3819e_1547641993920_0.28645315334472876"},"_hasShrinkwrap":false},"0.16.0-alpha.d9f6efcf":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.d9f6efcf","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.d9f6efcf","dist":{"shasum":"620811260873dc63ec2f9de7ecd84568e81b1e0c","integrity":"sha512-R8ZVJOhEDcDab3wbbWkjVzIQar8EcZscbNfiv/geLPh3fsN5D7mNP67fmQsOoOAEhPH53Q9YDPwlghXM82HG7Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.d9f6efcf.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcP4MYCRA9TVsSAnZWagAAvI8P/R4bINI1liF//SthaVxT\nU2xUxnc9iTJIBDybQm/XBv7NvDtnrPMqBWvFAdDNas9OzZbejAZbhVkbQ+M6\n6qpGrmo0k7RTEkcIBJ/DlRjohodqNt8k4v1p/eM6Hq0g/lkysiuOQHF87sdZ\nW34Zrho7UQ5YhB+5Dl0ibZrmP/7S0yoilhdBbZ7x72TKhvUChtEd7JoGqhUi\nTlUIm9WlGzxu2f/nt0b91tNWBvzx++rZV1QZs7/zwDdXwiIV0lAf4bQLNhDC\n3UUyPtN7O93reYyw+wFEBgEpAI+GmOSN2egcXzdMCxavyv11wKwNEQkrXkh4\nz365E9WgKRPCEleA+pltdyUJFfD0VElcMyQbvXFZRzFAw86KcIJ9C7NF7Rtx\n/wv5nb1WqzYhXVx4rqgW/mIk7bpZQLJ9Rd88T59OWn2/4ZcWLg910Eab5Q1N\nXNETTqzhiao+E5bbJpy1FiW+jVaBCUCcDOynw7M6nVEF7EDg0DczR2Aq336H\nK1d32pQOz/pOOpsJRFf8x4tXbQb+VtTstU2ilz6Z09z//3vtSau9L7sx0eQq\noz8pn91HiMJxwNLDIrPl0WpiBepKqVZ6GEPr3gmevvKfdXq1c+LltEsV1kBl\nYJG1S+2YOcseTMIIwisbczHNAr9DDX0iFcDd3NqOeQhObo6yoboZxzK+58m7\nOuqS\r\n=4dPQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxmGH2q7J5lb7Cq/pounyplLnnsODTpM/2TTj5EJMX8gIgCfQxQJSOKE3yC9cSsrcVW/FrL60k926ap8IHKfaQXU0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.d9f6efcf_1547666199396_0.8725678291855783"},"_hasShrinkwrap":false},"0.16.0-alpha.cedd99da":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.cedd99da","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.cedd99da","dist":{"shasum":"9e4813fff2340341380ab0d366a9ed8bcc546315","integrity":"sha512-cVroX9xC3asGqX1MNcThVaZPZyrHqL0hazDv0zK+AYHSx4GuycQjrLvJYQVK20hDuXWNpvpJLub0aZs1OHUvZg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.cedd99da.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcP4a1CRA9TVsSAnZWagAADccP/1wpr+/GZG4Ue5fpfsPC\nnGFma62w09WMcSTA7IQeZhoHnqC4X1J1YYooFzfTWXRDXp20C2I6pNZpsl6+\nG6Ky1ytk887hgksKYyTIiA3snNrRRtLIePndSAVdl1CXnopuOa/bPsBEnjbu\nWtR6jINgpwyAmtIk6flRwPBzA1AKqw/h783FQv14Jv8RxEbFHvzLj1usgZ4/\najSLXAMLTMBO8g2RLr1XHsz07mysl9W+K5t5Iexwgp4QK2qBOAMyO8Xd66uJ\nEczKvEW5evYzlVTJvsqIW+wg//ccMStAhE7V4x2EWRd8Yp8oLcHSk9mZa5z4\nQBKYKXWj0TxFYsgrGBzqrJnlozdOvyKKMp/k/xlalLGkaja9TRIkxtH0LAos\n/7NVfsJxPl2loK11D4FQ2jE2efHlzXIhhSCuvhkVI00eCcf6GvXNpa6kB/W2\nPcFqaheXDVoruk1z4S/l30XAvRXjrg2L5Y/+TuoygfyAIbmpv8CmkEjTWikm\njd5QuA80ogwdXNoL/eqTNJiE4H9VgojlyJhwt4rgljM9vXuDyxW9ZPQTERqf\n07OHthattTkSt2Uf5Xf8ZZAsucuaLuTRsti5bCFAY9EqK9QoD/F4cY2Vp5Wo\nhleNAc0CfN+G2D8zu5VmCaEJV2p6mBdrDJtMmnCWjwE2Xw9AB7NUDjYuz/TV\n2p2d\r\n=sfFm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCaALzxrAhZLdquvGPKsjJeeHq6ath/LM+cJSCQ/owZNgIhAOEu1EqEIHPjBEKh0rE1ilo8lp2u/hQJza2pcSRq9cHw"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.cedd99da_1547667124358_0.3248207889483743"},"_hasShrinkwrap":false},"0.16.0-alpha.7873cec4":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.7873cec4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.7873cec4","dist":{"shasum":"2a610969a678ccd9f1412e49763ba035b89988b2","integrity":"sha512-bWaCOVqPdHnCthjknNT3UUjwmtqXv3UIOKq0jTWEojr1y+0KI/XDajQFLiGucaUjeUTW64/T4W1Uzm6OoOkTQQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.7873cec4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQDFSCRA9TVsSAnZWagAAEUkQAKOMrw/dI6ludH2uKkkH\nniEfUsbgMOYekIExae/tRl7RtFPfFoMMwmUR+X3mr9zRwYXnCw5CL2MnnArv\nAn3IXyMVyAPeKsNW2Q0B5zzshs/A0fQab0bu7ILlaU8u1uB4N5ftEkBZ3ohP\nIzUVyw51zCI3jGqtk+O9NHh80cM3pbKWDUOJZhnFyrDmTpRzxt7eqcvyVslk\nafJyR1yD5DWGiznxjxaD8j2N3gMabGLozDw9q89OcRECjk3T0LpxyqIezsmP\n6Cctwmt9vTuDHA26+Yv1AbRnura9cvUs4lCdJoU2qcOJGtI6A3gmv/fNP+Mu\nUnsv1UEMVRzXZ1JwCQU6nTGS9pAfrOqy9CDmkBc3xgv0Qy5GwV/det+hZacw\ncnnRkVtEbwAlEd2ImYzjaCfrwKPuMCmM/JrX8A34ldoi7fjwXuZfnLh78yCE\ngMg6+yZiKaVDVBtRqdI/weP19V0GNyLVLhs5rtCNh0r5l2PXl2TDpHOEJi6z\n4ZZFdYq90L6rGB346kuV2ttK+T8z3Bw3vYRDCsFVjTzJLqFis+eWdJy6b09Z\nXoaLxUZlmbbti5zBEUpUGqqlzzvpLMV5Br9F6tJ5hMjLFtnHf78D/Zz6EjRL\nZWQB8QhXY6+HVPkNimoalWHbxKJCK/SOrxGJO9UZYet1yGu5ArGr3EuRBEIE\nHquY\r\n=F58Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCuW82ttPhhayjBoWGi0LkZzD2KW6P6o+gV0gCe9tpQwAIgF3nd7XG3uI66XTNeSWcSwdrlpAu5LUUtASu6PhRc2w0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.7873cec4_1547710801372_0.005650143829599941"},"_hasShrinkwrap":false},"0.16.0-alpha.0957da87":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.0957da87","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.0957da87","dist":{"shasum":"c632b3bfb321dae208cab6ad3708d9b91cbd53ad","integrity":"sha512-UCxzfXgdCu9QsVgWnYtvxQYakTkpAwhWjLo61Jkt1BY/X5BbRu4VAIRBxSv+TrzbN2SAq2vnBZXIRubT3YJiZA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.0957da87.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQDFkCRA9TVsSAnZWagAA2HMQAIVSweMYqe24zurBZ25n\ntEETlMyzSixeqpWT1ZeCw1Iw60iqoroXo/gnbOrsuPZzoDi6ppG7halPN5Yq\nvTW9ZYLMv2uLdSAe54G57ZKMdPWTbsT95OXa0VQ6Vp7MF3HU7mjYuWAZTF9F\nnSg7rKYJZCPyF8m35IJAP0iYzjCPgxP2jwt0QGn+XcrnlAa/9i2GdiE+mzzX\n27oYYrYsXDBuyXwRVf7U8WYCT69hDxUOOXAl8QlWqBd+nef7Ui2JCy33HDPH\nNmJTProvEfQrNeqvW9P73IzHvRdHj4pOt4usZVnaCwYKtcK8CTV+Id0/ac/8\nWDp4Ny42tJgXgERtfcNPYm94mXFkNfD7X0Ea6MmkI6szga0QRa1iv/Aa9e0w\nGaX6Ln47qwOStl7Y/X3wUXN7gs+obG2316pEAvv/r6w2AwSvdvvm1agkFqwo\nTDTlySd7G4FisUXPVZf81HSPP7BxwzWguR1b3vgypdtL0VsHaCs79joIgc5z\nIYl5p40eY3FiCMLs2dSVqPY7WhnJidD9ZkdOVE58+uMJ2YdPnUpZPdXmeo9v\nUY0Ez3X9b9RaxQBZuHPY2rTPCUQO4WYx7XLipS060LWwEodlNBgRmpddP4MV\nhn1aYsdYYBQikKf1QY+4tCelOcJwA9h4gql57PPP3mgHpp5RS443ZuU1pPag\nrNXU\r\n=YV/p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH0skTOooxJjF0s6hoWHIZW3YrD5ns0h5dS/oKVo/tB8AiAPAQtoEaRhYtPiUC9Bg6B/c9V2WF9RTZl0geIWaGjYlQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.0957da87_1547710820240_0.18926586744331853"},"_hasShrinkwrap":false},"0.16.0-alpha.86f1aeca":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.86f1aeca","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.86f1aeca","dist":{"shasum":"cb58c44072547e8f5930371bd2591b7adedec827","integrity":"sha512-0QbuQCFmazOR/mq9p10AMun3FynTBEMocInz7o6MPH8WyP5DYmcAjR8VU3YvFgmhYemexQUNotPBqb/qXq5TAQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.86f1aeca.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQGfaCRA9TVsSAnZWagAAvukQAJNXiHrZetISstWHu8o2\nfX5aAv/JXi0FERVdEvxTllxlUqoF6fNxRnJn1omEdEBOSKvMmBe0a96nDeKO\nAVgIH8rzkv2Z+jO6KoXJeNLqotgF+P0oaKHJQVkynymTUBa9ZkmRq5188q7T\nM+L+G1feKtZw2YFPotEko876Q8yoZQpnMf9QK5WzUL9tHIh/I7cvlr8LY1Q6\nJ492OZ6zcus48pu0C4s+s31DPJR8P1ZPaUT/j3QjghhmI1Oh0Rm0WCvvUxP0\nlBBtKjzU7jxSiLzrldSfOC0CCjIdg8ds/usRW8+JeGRZNFhB18UeW1sh8ktG\njNS//JgSX+OPiBsUwauq0B+FwDtn/i7OztSnCNy6nbAdN4PR3O3B9SGndGQk\na0YZTlJIoxEHl3Gx1qwc/APs6S7EP62yCuxucwoz/MLv/j0wkb7i2QGe+3At\nv7NJZ8UdGfMb54yGmxQVxaIfWOreP7RnTS0WQzfPEJgcmG766qGJKtNO4Xh0\n67H/ug+ceCS+J/m+/2PyZhQLogn27I5wdwjCGxw6duKu9K5b9STT0pqCgQiE\nqj5Av6FmNuXt/X/E/2FKyA0YT1R3emn/bDF+TyIIxQd3ZOupsDOZzR4iuawo\nLPqTIxVe5NK0ziJ31z42YKOskpBe3W6hY7dAuyvXUqKaULJGXtyGPB09hJ3Z\nJHNu\r\n=5/Wa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDootwXZ5VzojtaxqFiPikW1k8FOfVwO8X9+DpPgL3A2wIhALL/zVCOUYmFWed0n/OkHpPWhAOpIRSPrHVlEbX2bAOW"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.86f1aeca_1547724761722_0.2767709242539611"},"_hasShrinkwrap":false},"0.16.0-alpha.475cffc4":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.475cffc4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.475cffc4","dist":{"shasum":"8bde0b750dec7bf5eba4347cf26878143c03b58a","integrity":"sha512-IRoM0Op41ykEPC4+XNV552F+mlhYJ1xj5JqzR1SkYXm/gq6fhZdRdynkxUWScjd7oiqloJFxKjYHWz16BH6yjQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.475cffc4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQG6PCRA9TVsSAnZWagAA72cP/R7vtSiXkbb7kbZYxwTK\n7qjhfsXZnmciloNqwN5MWFREyl7mDUAQfSinrook7frjCeB/u5ekSj/9I2nV\nqCW2mAPq3+ek4g7G9TuOKTlhAwyFSQDBF47deVtPPwcG6uHFQM4Jt82RIVAD\nwrmtQY4ne7r4tG0k/KfqhCYrPHIFFjjrIX7kpLJIwuvlZjPoIiY1VxhrxkAM\nVNJnXshQ+HjBKj4IqevSA5wXtznoJRDOm+7cf7jQ7Dzl4rWIVSupz8qUeNk7\nPamGs8GUy1epEFO+5/rZegvIPAQQtxsldcpIJC4UTPecgY+3kaourG0Oir4g\n4CRK5YJrKAbPOAX559qA4Mfq6VSNHdO7t4GXCA6+LyILQSeQ/FG12EP3Gr14\nN22aCyPoiOn6e/VOlUBhdJfwqM2wKaIQsXXoN8+UF243w1Dg8AOaBLxWTyRf\nQ1dp0g2bm2TFdCBhzit4XNKP3kmBWn6Ehz2wZPO/+VDIpBptHxOFX2/fvLlO\niFARg3I7A1NPYfo+p+k5m+M1o6UEgNhtxfiLzxAoeEU78XFoxmWZ1OglJQOv\ndCXKx58W+cv6GyvD0541hZDjOgxV6OEsqIiMWYYio9WIeUjK+j6cMVGkRxYZ\nuK+WJw5uZpuBRNjv8RkBFJise8QW08ULpPU/qPAxACtCxTjDLJELUFBEA6f2\nuH6A\r\n=MWEz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBm6vjHiZNBa4oe5EXvmt+BM+3SG0efI5xEwixV0NmQcAiEA7kSx+vEhKbDLOY/V3YImO30NPR157uDljhWM8aw2TG0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.475cffc4_1547726479284_0.20258497982391765"},"_hasShrinkwrap":false},"0.16.0-alpha.d2db8520":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.d2db8520","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.d2db8520","dist":{"shasum":"e0998aa3718d391b72469afdee8bf2bdb3f65a0e","integrity":"sha512-AdlqDBo94i8FZCy/n/2fSn0LsXwOV298LNvH/P1MJEUVe0alzqclrIcOR5mNq0lQAmPXSSM5cUtbRz8VffKEqw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.d2db8520.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQHMWCRA9TVsSAnZWagAAhCMP/jtjSJj0l8xNgj1LLizV\nN3mkze+ZDjF89WLwSTs/OlT3jpPwD5pPdyHET4mpIOwI35hjj5Tz/f7p45DZ\ncEZWXWUB3n++JUGjW3aMmx4MQd80Y0WhyAMRkQjld0+S14DWMRXs9rv6zHGz\nkqcmq14vYofCkWzpomOV0uZNhhGMWnOphVpTmuaruRJDFucfbgsfGzJ7QlJT\nwUewQ1XPIQ7kaqGScj8zUduZWibaQbmr0LsbFyddn2u8zrb/NQo4ktBA16OC\nwUI/cadKX7bNV1VSlWdPqgJr1evysA4fj32va/uQ9hNy1zUDxmkgPO7bWeDs\n87TbLzdNVshPWv2WRn1ju5qQqRy+ZSqOR1DQPzcJ6PAxRdPt09KUy4ovcPek\nWjXnwoJccRqYEg1u1RVZAiFT8Lrhu5kCJ4m+Ya9zw4dqHqPcf94ojWFPW3Fz\n5Z17Hgf2jALmHCnWx3EVqifDkb91FACspQyXDTmPIgASjrJP5avsh8NX1ElE\nRMUdp3FnARCJqm5r4W/bIfnyFeBxu8xKltYTk75Nt3BMnqkZF8v8acmC21yT\nRBZLxaulUigP1rhtWlnvSgWewsyHclf5WGcPoNiFdF1p/mpaKBCQ8ODuGXIJ\nsO5SYXtyM08fcfndinkxm2Vxw/QEiNkwnDkTE+UZQ6kV8g8yTHmP9WFTz+dG\nY6+6\r\n=ovr0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEZhZig1pU7Hl2qAReR6t1cXRYKunJ5xbePtePGd+3ODAiEA+yjhSEjoElRu3vsW9U5hVogqTYLw0yta97+7shES8d8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.d2db8520_1547727637797_0.3965951783802648"},"_hasShrinkwrap":false},"0.16.0-alpha.5f5eec01":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.5f5eec01","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.5f5eec01","dist":{"shasum":"167332d7232d28a8b3e7a040bcedcc4e1f17642b","integrity":"sha512-yl0RiMHPy5qChMfV4wfCjjb845jF4QmGlDb9/3QSmWJkTVJ/+xi2jApttHlY9Ca89z2XpxqlQuk/v88HnWLkkw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.5f5eec01.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQHT/CRA9TVsSAnZWagAA7XcP/1snM8DJf7ulEBmszeBk\nG60PF2xbHqvpUPnOy7A1HiKp0rf/7NMwrA0AdwE1+z2ufkz3IF5rgE4ED6wM\nvWiOC/dx+h/XOLffsX6JJkBu0XUBHiMXPpMkZkVNNnQJo6h2AyWT97zW1K0V\n2+1+koE0dvHA7jKr1nQcwBVpZve/8jw3w/m01s0MlMv+rYoaU4gIH+mUePLk\nn6AMVTwWv3zCtL2Y/yyxfz3ngekeAty3fIxuXyQhOdHbBMrsUjczDcWBSlPU\n0Zox3SvbHK4d6tJZJq04/g9NKPnBxzaAFhjVTgvykZ1t/T5Uif855UFoRGvX\n8U8dJHge05p0gs9faP+PCQawZWOQceju17G8IsN4R55b5zpNQZq59MRW2BJ7\nKbVa1QxcSKuqh16EmeN8x9iMcM3NQkXatkPwlau1D7qagog2sB12anz4UClX\nMveqNAAw02zYfqSzRGbAeUBO8XmdeNUYLLcxPGh6eF8c9IqKKEWT+qD/2EWU\nye8/1Z13eReSJVn8HBV7NWabrt4LWDeeJzKtesPCAzqX5uxRkQL9rY9jeMSn\nkDioMeSnlpbtveLPGMahEN0wT88/9e64BCQWGf8YcAXs9lbDYSAMguf5Gy08\nqjBaorijZ9xL4fNgqy3Zam1AgryHToxAoxdhxvLroQP/IWXdLLm/ojRafnrn\nvadx\r\n=dAVK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC610rp26zJjsRZTq9F8W0TeXRAHhViTZrDAxQ1wpF/ZQIgF8SilvRCkHR6fo+FHxEHGQYN3oyDVqnHBqV2wefwcO8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.5f5eec01_1547728126761_0.6371725961419648"},"_hasShrinkwrap":false},"0.16.0-alpha.b9914b46":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.b9914b46","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.b9914b46","dist":{"shasum":"9e8aef24b151a3c1a068585ad09e56d0a3fb878e","integrity":"sha512-tDnjP1xz9BceAxSgUz2adFzz0FJ2ZwVaM8AMbAgF8pdT/1HfUQ4O56ceBJFjPmfe47yPq6bUxTUYCzbcQPKS2w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.b9914b46.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQHX9CRA9TVsSAnZWagAA5DsP/RIUEYY9aAtn4rIgeqsZ\nSS32KYZA/5/JUtf35p83i3wCE9+FDjaPDprGofO017HXvIh4KnMW7drnh4bj\ngiaVb+Bm6a2yfvdBCelxXNhF7Aq4+zjIoJxvFCCbQytJ4j1DToEwDFNv55NR\nY+VqPOs0rw30PuDi6k+OZzg3J1DEWzDAJTP76O/vdUy+6msbxrSxGxjWA296\nRdV9b/9cC5KFA99ClyMN9GLTpk5MS3ZKPcnXO1D+kN9Wt5zB0Xfp+5muSvKR\nstFxEcN2FlxEAUj07gThX3XP9gtX/fvf+zsV8YT+xFPJHBHhDq19YNUqn7VM\nJr/05SlrPyEEP/bAH98sDiQl6JC7IzklTiwz8vEIZr0Hurp1dSSRrQj0bKDR\nprmQd34LPjEqBAj2rHJ+RHKTGFOU6IK81I4t5da+g6C84AR3TAgT5zohaExb\nLnN9VIYuQCHIYe7mpScdq2wGvHD+jFjiVD/afgEwpPgBtiy6nhyC3rVeRNjf\nEZZjDE0eogTk4t1LumVA9zfgFNPh3k53ggxRCRxTt9Oj5WpTSMTUNf26V4bs\njUqdtDfMRU0CK0MPKT+BeQfGsXX1poPH6u/npRMqCRIoCM0mLmYbtPeVsAeY\ndP9fWtKuKweUlLBoj7oqccx79DIT9oHok2QxuRti0gPUJyjGOVnK9F6Y+Sxc\nzlMd\r\n=YbvM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC4NANIJYi79nx66ihX1dDI3L/6YX1F+G6Ezr/i47BzcAiEA6L9tSE1Vs1QglguHa5FLppMPbzH4Fkvbpqw3teZNdsg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.b9914b46_1547728380855_0.3233411284575731"},"_hasShrinkwrap":false},"0.16.0-alpha.0a3de09e":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.0a3de09e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.0a3de09e","dist":{"shasum":"956d75e6ad0c3e93f043d9f0aa78dad8dced7b05","integrity":"sha512-WiXLYaWKvMJfeuaxoEOWTgb1gPVb7TULInm2wHEB6D+V4Tsr45FT/1gF6uHxtoWTfNZJT1KCWHNQ0MMvQTWeHA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.0a3de09e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQHz9CRA9TVsSAnZWagAAtDEP/ijPQuXUeW8ermRMNRr2\nHPW2SVrImG8TK8+yy7GzbzNe0QXVdDMUaf6v3CSuHGSPKmccRLqDBTdEkAMZ\nP+gijD2Xf02f3cg/cqrS8MMnCU1rQYWxYvYQdS9ugyDYOG4dlyX8nn86NabD\nx+0k7AwYHsGkMOCJzFM5R60HLDNPLslMJKxb6cz7/8AGVHll9W+R4lvst0xA\n22wE5w6Lyrkym1wj8lxRFYxa1sE9CHg+xWIFyrgXAyiCy/YBygNi3SPkdM8S\nKbaaGDoC0YHdPGp1aqV/RBVCsHDdlBs9Qac6y9GZ9IhaG8KtqCAjKgTo+XUS\nobOpvAvyUpxaam+6tlxkNyVAVNP4DiwBTZhkxu6jRhjNjr1CbVXX7g+tpN7r\nk53gyCcpg56qdkwc5s5doiTLg0oR2Bb6vmSZqIsXKJ+hwRZ34AEnsbLu92m5\n6YT6zfLCU3LpLO/QyNSv5cQTZMI7wvtwbSKvl2/BCzNWu6Xf5ubmLIfnGHN2\n2N03GRQ1rn9cA65Xy9mBX+iW0I0k9ksVAkSwnK3uteQcBgZzHFONLr/d+MN6\nfu6JQbsHbBcKMO7NjORGdU3PkMmefsSEFT68MJ+A8v6NKPX014wxcIsuMKRS\nYwxRNBPXat+aJmzzW5lRWCalgaqZ7jRnYiyhsbEA4ADTI8hXtYTUwlFSdxwZ\nAGM7\r\n=jB4o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDN6QhqAQnyJuQ9/QPvWk3y9R/5Dip6epVAr/iTRuPFjwIgEPhZtvP6jrwsc8/h1amwdXUJS/n6D4W2P1PjX4e4w0g="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.0a3de09e_1547730172701_0.5372279422145825"},"_hasShrinkwrap":false},"0.16.0-alpha.c2b26dd2":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.c2b26dd2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.c2b26dd2","dist":{"shasum":"d753c4a152e41013f9d0b1e4441f0d43e4e4e6a1","integrity":"sha512-iI6kVQWRktEKxu7N15zb2X7uzzS1WcY2HtxOKNzeEZ0OKeXeq4vT6Tqg76RPBVHsbMiybmcxrsfAJObynWB/qA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.c2b26dd2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQImnCRA9TVsSAnZWagAACOwP/3y9cb7Htmiw2dQ7ODno\nLrhROZm8sOwoHC/xHS2GgJCTRZs0lEEsfVeIivn4zY1muP3RKOPZTq2GJPo7\n7kuxtNMlZxyFlOmoEIOF/Eq2jGxg7V8xK+L6Bp2FuHm3tQlMDUr54fRm1xRK\n42o2q5LEROW/E+HX/aq5aVS2M9KyXXQ+1oNvVnSmmTCUvcJFcAwpcUOxlO8d\nVe2JoN/RSLwLSz3KGimUiOxBH7ulgcHLIwtrG+CUie659eHCpiLjNkSP4nNp\nem3geSxc6HKB6jndIQjdq89Jdz9ZBI3ypP4wtS8zuAMnYpUzbVn/3f3aw4Gj\nDrsG6IxevdV1epIRFI80GU4QlFnjFFJeJV77pA32XDiQGEktz1Hxyf9rlmTf\nZTyicJTWGdu8dy7wNTXbYDTiTckpDSdG5h35x0yP+QZRbHRyxEKU29Mf/avU\nyCIYVFwEyVrLz4tcnRstT3tV24JjCynNiidhAHLx02BI4RATK9Ie++szUsAQ\njPPOcVjQYdJRCtijlrzeDzVoFR954NXWLY2mDBqGz3g0JOVDTvUhN75Rj9Bp\nb5I0R4n4312jmHkJrH5cvh7BlTPY7vcPVa+kyVxIM0ViiKcMAV9OWPUzUlIX\nQcYy3T+Ad3gYA6iwQjb93bAKfS+rMCJR8c+eedAjL2usgw+teJqdGZnOdMXk\nih0f\r\n=uHdK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAuMzNFnZ0RO8kjve8fW6MlcTiiZJmMlUrBaxXd1XSrqAiBohH+b2qyKfgRKQP4k2DpG4DjKAS38pN7c7dSPx53hoA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.c2b26dd2_1547733414829_0.4212794663922099"},"_hasShrinkwrap":false},"0.16.0-alpha.21609e70":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.21609e70","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.21609e70","dist":{"shasum":"95b2c0a48a494fc8edeabfbd7a4617f1e07c174d","integrity":"sha512-TzQNQAxInw07siqWC1qQ8Xz+DehajTRx/7x2LaYEu99D7EMPhGBR6LxrzSVR6pDFQdxrUJGw01G9q83rS0A1qA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.21609e70.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQLHwCRA9TVsSAnZWagAAWXsP/3lBBvl8WUtChmUT8cFW\n2EbRcgrH6pRJ595WEuMtXw+yFErnh8s/sXFJrk0cenM2ozCYpkoXFuVNEHfW\nMVEED+8xQts7kaGGZM5ZpkuT+I1gkR7IP1rs90wacUv/mBtKWtjlOqqAvAkm\n4zrzoUxieR9ghTWlzRbR6uY7bG9bN4PV5TVEaZBK6ANA95264493tgPg3tKf\nqn14ocKy7uiotTQHXOKRV1EU85afgRYGG9IXKyEiRMfiE/FpPnExsPMFGQRA\nqpMda/JnIP4hYenLRRoRDtbQ+7KFS7+NczsNiW+7fiVbkqfb5uHjHY9/aryp\nV8g45QWgHAn9OcH8sfwOzYG7GZLMXE63Q7nXI/eR08iP0FXlW1hZ2lw8Iwo7\n/+GHOyavAhQMLAiDn9wcqJdjROwQSzjf97aehkrE5A+U9PoX7Ma5X6YTeyH0\nK/PLig4j+YLr+7vqHqOHMEZoZrSF+X4u3Yva7idb4af3ZuCOStFa892XFKY2\nJ3v67pYXoxuamMO0cfbMFUt6s32GgiyTjFFiN+xQcIab3846VDgw4dG8tOm/\nw7kSKRSg+r0olnBHkHeBZPPQHkhdZVS8NpWJ45jIJSO6U7+sqKXAs0/cUjgu\nhwVPPLMp+yptLrieycevAwU3+l1ykWYjOb9KGPcYdN+6ZR/7iCscjUGgkN0i\nT4iP\r\n=BFZS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdlrDOMnvAUhgJ8p9wuCVl46um7Kk0rX1jbyMzSdRJagIga1zd2qoorN53aNWZ90tt6krVlHM4v6/ePNfa03qbvBk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.21609e70_1547743727884_0.7406730699091031"},"_hasShrinkwrap":false},"0.16.0-alpha.206cb192":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.206cb192","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.206cb192","dist":{"shasum":"f6882761c6a2217dc96e048ce600b123b698b31a","integrity":"sha512-9lDv8zGIIFRB8VtnsjRCB7BFdPE+MKynv5k/sKJhHlddtz5HSMx81pCXlpDS1t4e+qULojBex+sjYj+fGV74OA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.206cb192.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQLTnCRA9TVsSAnZWagAA0u8P/R9KjZKAHePjCbvMSjH8\nvrOV8ewnpoNAxI2C0XqRMdXsWWmuGVeCKAWcfUP0KZmYFnWiFBnceOom2Ia9\nW864HDWUCUGSJ/o8QM62E5dzwLTozINZfqFbTGTQu9FXylxBpbYHFCv5Iqmm\n7kajmv4Qcx6uXWz7oQKM/YTk0W9hZ1HVx6xuVeQ7bs7fqb0ggeIlkqr76rZH\nqr8/WfjnFxlf0o25q0P4TadSx1juxAUqDXG+hrohajeRKLaiEF2C4y2VEi53\nVIGiiiUcLlOdqgPYAEFttQCwgkHfFpKje1BUMd6K6JCOQx0waeyBK+RWrOJL\nHIBYIQqeFT4XRGeW4b+xx5xnx0fKJG4ZKFAelMMDN/YqsUTkRZzrEyEXaeXi\novFRCC4yowoGAEqh0TNWijwPZ3Mf9UxE/NGOgcVxqtpCCjjqFMgkjWNNO5qM\ndSPA/7ORX14Cnjznwf0X68mS/O6xYYonO+JOSL/ZgNG53xIYhlnynxwvNpCj\npmHyHDw7CWU081iFNr2/KZLNYkxqXZ6r6UnKB5LpN2U9PzzrOHbtIxzm7KJh\nB31XL/jbuOT4IT9NjK4cpk4Bgho2c9tLeAgCZ7lKgf55sBH6nmACFk2ysOj7\nnUXpWMby5I1DofDIaI2ySYxGYrHCHNFKasBZ1O3+1c63EBk0wUfDxe4T95JH\n9zJ8\r\n=i9ks\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyo2ZAXZjlZS/et/rz+77e4+yYcwj15N3pnKK3gR6ckAIhAKIvOBTsvCSoEMWKRFYfIfi6TCk1uMC5JbsEo7pdlLjn"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.206cb192_1547744487132_0.5075124952089503"},"_hasShrinkwrap":false},"0.16.0-alpha.11129b6d":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.11129b6d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.11129b6d","dist":{"shasum":"ff246300d813c48d16c1a06a27715553d796fb58","integrity":"sha512-aWLlIZzOoEfx/8iBs4dKOVMt0LDm76i1eLo2uoY9b2MBx+Y25QUg852LQieXnLW7yHUyFI2UZy+C2/0DERKLtQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.11129b6d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQLkZCRA9TVsSAnZWagAAUGEP/A8teP7EMPdB9Vmy+PGw\n/fgQzHI+quXeDeoruZ+05fchnN8qItg/doP/mE7VEb+MiAvNd8AhQ6q2uW/a\ndo8S3QC+/HoVbMleUNHMfHXWkHecsYxgTodaWrsv5CSAlSgoioM9mgMbQyu8\nsZ/gl/23anjUs2KhaH4Dxh/YCu0zkf28OdLjTBWtpJDE2CPaIjY8HKu6XvJn\nHfppJMPv4qOSTFA8PRNmtIB+XtR/EmYLmU0qhiEKt3tzVdEJHtQGbAcWP171\n89TQKsAl+vat5i18+B9eM/H+Tcr+Ofzl4BJJh0krK5d226UUqhWGzJiiELjx\nZZTVXl/OBexBsphwxwRKv/fXbT2QY2AQyKCpdcJTCgB+7s24syULI12BJo65\nRwGDIvM9cwmWW3RGHf6RrWpszJw/5gB1FBucIhxpwYke88BdtbCYZdHeVBa6\nJqfOW7q/nH183ErvbVhUfMdUdDl2yQLVInHkk1KDhf0RboYDzSUaVqRDBWgU\n4oUO+e5eSdRMIMKvDqDEUEijfsIvL46cfSvTaicdDKtU/Zv0hOVZ/g69PFP2\nT1XFj1IEVzvsiubnKN+x0xg1Q3Mu/gLQsexYpgVxU//HgyBNceg60t9dZCMZ\nYv2LRkakt1bibdwWt/p8PoaGnGvRPHriHI+GeRvto4G37HHyFd+br3aJJE1I\nLK/v\r\n=nsLL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvVFlZhQRTvX1mo+vn2q5IzJn+F9xznJjO3sQ2yUHPOAIhAJX8FAiAWddByJESgj1fZh+G1H2gIh6rk4N7PuEgdCge"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.11129b6d_1547745560169_0.5606973244533435"},"_hasShrinkwrap":false},"0.16.0-alpha.edb72ad6":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.edb72ad6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.edb72ad6","dist":{"shasum":"2a63e7a3a015f78edef7c16c718a412f1ba98437","integrity":"sha512-E4qi8/1mt+9DPp4xaKxl+OMWx1FeOD7NRTCAunJ0rxr5d5cxx+A4FyWOJAFTbsDg3FIZdd4ihVp6c3EUlWdMMg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.edb72ad6.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQLucCRA9TVsSAnZWagAAcgMP/2RTw1RDqGORDTngYSuJ\nRBrs8a1kHD+a4JWBWET53ZGRui7mYZt5AFR9NQHZfGfIuoP1M0R6qbau8/FQ\nTmFC3n+WC2Im/Xgb3taIK5E1woz9cPWlaNRoyNgR2M31Xm+nwFsNPW4Jr+Uy\n6PbbhpCIGah6EsjLX/cfW/ko3IW2PGb0h6UyD6L+xIikElXzpnP2ifh92tYP\ne3fzj7CoEV4z5VkYRQLIM+8sRVswzSUnOP5ZiNGa21rWnXrp1d+jL48EGzrs\nUV+PvxQkIoKCwv7y1KIDhk+2hUx845aKLMCkK95mZibyDb27wpulnHQhaKt5\nt3TBXNMlec2T1jIBCk71p3v1BaQzbJNII48j/h6CncrYH4HuE6Oo/8FxFpJ+\nChoW989nHfPD/zgHqAagEpl//R3H9cJCLE63f2MlBq1DwY9rsL/zR76wIz3t\n0wtp+Sk74CCS4pTk9escuWcVcgAhhW4nkYWae4vbS1mOdIWuQVgl/pPN2pq6\nNYTWyjLe+DGt6NaHL5SEK3zI/IZ5RAaZjg4OndDIxbpevVuJcQv/w4QFLCFY\nJhLUACnqAT3HguVJvQpbhrZpAxGzF0WGb9uUl6k3qKnUi7PF4occHPP7E1Hg\nR+qLMq03kllBZFjBkOQWXSl/7bQ0NMqUeUluPC7OBY5dO94INWhNFHXib3BM\nGNct\r\n=3ZIW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRmrVkpWL2R7Qecmgb0GVW2niJrYiO2pVQ2GJyfU7mPgIhAP9JtNzsQKoyqcROQnC3/KiJnAovUu1kJ4/N3RrWXRx8"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.edb72ad6_1547746203964_0.24328023310863078"},"_hasShrinkwrap":false},"0.16.0-alpha.ddc6ebb2":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.ddc6ebb2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.ddc6ebb2","dist":{"shasum":"d97d5433924033d45e0f1bc96c0f8023f69c7aa3","integrity":"sha512-3RYVwRq+ZIfa3ha4EjP0e36M7/xJ4hp1/Uo+LtmIWKnExLfq4GYoHvnz2fVqPO9abZtK5J1YoMC6u1cGmtxYDg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.ddc6ebb2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQL5BCRA9TVsSAnZWagAAMqMP/jEcpjRpfsWDzVrZvWnm\nW+evGQ6wbYM4DhdArv6EEgASRq9qpWv37Cr4rp5yuWW0Q/mHiTtMqzv6jHmG\n9en1u9AbhQ7JX2xCCSyAqpLP2VLbqACSxEtVIajn3Ey2G1+st86kOoI5lvgr\n375H92SypTVx08fzGWi1scLFv00QkKnnONSMmCrgBMjvgEFZ4RiR8WA28sPG\nKJu4ttIaHYnhTgED4NfFZhYn/++WKqlH/G1L5SCgti/nXiFWo71frDNTzlja\nPNIPjArjLJJB8lR0ADDTOX+BKFkBE/6TXtG46AKUWPae1e9Js3WqBHV7qZbS\nzMMSbm6O2cqwQO//Of0/6NPfBG36PY6h19tlDVqyzizw6dHNAnis6V6otz7+\nqA1brDux4ERO0kC6dLfwcICNCgk/5B0hhNX24CRA12BR4WL33sBEe1W+miBc\nPRO3Hu6Vv2kBCGDNMHRy5uv36VZDiGxI+uNOcNS1vQlCYsg1yIxYZbG0aI8s\nu3RDYfWgMaGhxU9rNCAW5TxjLEgPHoyqjRFTG/Efx8xCBGAWW46ozA/YAmu8\nhTDFlvBN0bqWcPQbaXc0Jw4A1CtmBG1mzjfmb9jU1qiDMVHeu9BZU0MfJxkO\nHxbBmgOV9EbVHUOPJLoQf4wiTG4nLvcLX8F9vRSagGmPvbNpG4ORRviddFf9\nSJ1n\r\n=RVwh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAcGHt3I3GfwmAVbWJmzulKe0hSWJb8QY+fU94lQtKX2AiAotNqtIHpXYK2bBrVoHbLJzDB0oJzWa/4RP4FICJZ29g=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.ddc6ebb2_1547746881053_0.8783602413325184"},"_hasShrinkwrap":false},"0.16.0-alpha.27eec8c7":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.27eec8c7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.27eec8c7","dist":{"shasum":"70081d75840da4883c185c80ce0bebd87f5f18ea","integrity":"sha512-DLl6BLWgCtQ4o9Ht/d4MLwngypRJlq8X0RcgF0LREe2LoJvIeFkhrh+OnqMJsSbMpOifQHslomkJNOjD4itlqQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.27eec8c7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQMymCRA9TVsSAnZWagAAup8P/3JrEqCP14TBFyASPLBV\n3wP19ciGvI2CaqSBngZvciWE45I6GG8wOdAnR+opQPHHNgfN/EzNBby9nJlJ\nmOUHMazXokJxqD4XjwiCHt60TPLZRFjsQ1mkoVUu7Xx5furn5EqHZRTYuWYb\n4jJktAOjOSOhKCsA9fEp/TMYq6dwzcgwGzBrN7jVU84Dvx1O53ip/O66mrtW\nY96QjMZn0UCzU8/V6gzw5CdlCerJJ9U+1Yj2v151e2PG3xcC648sx/f2zP8o\nMncmUgCrRDDE81mTGMxvEk/h51GD3Y4VwCLUeDhXoPYIhLWQtwvNTYTtb2T8\nmqUfKp/EOn7oywH0EfzRKqDIHZZVCZS8ARg3Vy10gxG6wEVjMAWsLps1cg6U\n0V+GHMGU/2VxSMI3+HPjOuNRoGR1as5dl2BYcdstN6Ey4h1tkxddZ3QyWNVB\nYSCbNuUshDH2hTNLBF6cWFu68RDFthCSxN8tqoEoCSIv1FCDmRB08HE+uNTZ\nvkQ7s8KtmHLsmxfL6jB4S8UY+boMheIca/X1zesL6sMeIjVyzCFg4KBFOvMy\ns0GoZNVejDO9erpUFcRjoIXd5OA2ylNrvpTdfbgW2My4bhNsuajqrw8nrGO/\nl/jRiZuQaRWsKgsvLd4+3XPbdFqPI6zCKb8PBbEGzsSjQQZhm04JH9CDfAu9\n07k6\r\n=0cHI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7rcpYBeBrv/lwDNzspqhO5iHjhky7y7JhnoyKbyCCmAIga8gcL8tLYci4DTF/HQW1fvbwo56ZSqiDcgcfci4i9zQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.27eec8c7_1547750566101_0.5900678797068577"},"_hasShrinkwrap":false},"0.16.0-alpha.73e39b2a":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.73e39b2a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.73e39b2a","dist":{"shasum":"924dbf8f49e0e2d6450d2497d88deea136b0fed5","integrity":"sha512-YNM3i1Xaa7MK6pPcT/lED/ZGl5hSD4hINvNFB9JvwAwsuh96nC/gIk/hwRLJ5G+accyf0AUghkOzWhSPpWTfOQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.73e39b2a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQOWOCRA9TVsSAnZWagAA4R4P/37FEztxPkA3OhUW9EJR\naVPC+O7Si29aWLjjtrIFzNr0kBhIENyVNw6F/jjVECghFN52C96sNcSZ65Rf\nPtkjdOQeaL71/K44m0iTGjXNkUEcoV4X8akCN3VF57NtIYqoxPfuCz1PxG0y\nJ/34AyNdvVBu+c5lusOYvZOcyjVoEIqn97GgKIelO9w9hTNB6zmSaD5swwaD\nhbDtamwQw8O7zuanGW6UjGvbTSIx8DKKmwrabmD6yJOLbgKdEmJ53978DZ73\nGrc+zN69TWqaxKxnOH06UjO29ip1F66zxxMrN7+ngrsoUWVBCWDnDVeoc5pm\nxXsDcrhh4ayEEtUXMtkDVAXYmQlj2ZVnpxhHMYInatm9fO0Qz6iXybASwNJZ\nYQJnXbOo7JtyerDEh+7dOIe50D6+xdAFwTtuNNMYNF3/Sdo8x5fIlumFqB5E\nIwU+eGoY6mipC+7gDB0sbmg9Mhp6g/j946G6bpPDRX/Y7SdTX4vsGD3tbHKO\nqu8ZWcjERaoi+w9neHhPqobW5WDTqB3/aw03U08XJAZpf7bMi5lCxSXJjN5a\njewz1PIvsIktpEpeDszYI55OcfYAQRKJtjTr23DrhlGUukS1r15FJd2AXJOp\ncT/Llpn/b1VQnWznrN/T/rR8wY+ufsZPiej2ZBnQEhFjr+Ao/M6Cvw2miCGG\ntKsh\r\n=bXGb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCq5mSMqbLp0YaOG3d3ZYsURuk1CbnCv2Mf660ipgZ1GAIgXCH/v/WQUi6qvzIzJika00EM/tee5grrAv2A6d60poE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.73e39b2a_1547756941693_0.8793439470021807"},"_hasShrinkwrap":false},"0.16.0-alpha.b50b458b":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.b50b458b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.b50b458b","dist":{"shasum":"9855eaa2ac8671026f922f2ffda84e9dbf2daaa1","integrity":"sha512-nqhyNAxbPtJzf020TSRLO6mAPcyZEeEaV03qELZJ0C8gPmTNxVjEXzRkJvxICkILu7gKANJNDgouzBAHCQIE7g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.b50b458b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQQaaCRA9TVsSAnZWagAAEhsP/A68nDlnpmBTFjJ7GDws\n3bbpSQNgUABg9xue2nU18CD6LayK1QHAJxs7h839gK1qwbU6FQglgyN2d2Z0\nReMlHhtKDF4Yz7xdfXdnTwQ3kJJNsRu5exU0GTjSlGb1O0Q9pk4nILkJOrZO\ncOXU/hTiWKqO9QsxpLn0d3L8azfB7536jKIxcUtSm5uN1FpTulb0E5FOZfRo\nbI6efiSj5UBI2CHUhIgJMZige1uA268zAL1xWhq4yZczHq2YELjXOXpT8QHq\n1exWUWrhArdyhsiyK7eO/OUgnr39uhKX+sXr7IC1RrHFxzULp97V0K6pRpSq\nvEgM4pvJM+zOw9QuiGbVoW2dtcAF/6a4GUb8GSBTV8DXqoypiAVD8XV0SiJY\nLU0vK5S0SEoHRHnmTDfJ8Kdm9lhE7UtlbASPkrXspzAAynCY9jTm7AJwhw8J\n9BWN+njmsUTDr95Ao7Az/IfX2eavqCurxEOQYVT5D07VLEYjao7HwZUw+h+h\nglZAm+WLUKUD1Flmbx6KTHD30Y9cyQ1fPDQbcHYWZ0auuO1luj89AGzU1wWr\ngqZcEL1qM9z56lwgRiYiPu7Wv+zVHl8NmEkP9yfXtahoEwBJYkVaUTzR6mpw\nC+qkdvu/0SCOBRXL+535v9ULcaa51tuR5x7qTtMcf9icEM9uigeSaFdKzbip\nKcHt\r\n=7xfW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCScAraZN9hG/AQ6Ecf7EL5gcvQkFQsBf70JU5ex/tEgAIhAMDXMuOfm59zUm6tCl0hwqE/SRw9d2OUF4gNh06KR5jd"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.b50b458b_1547765401408_0.308454211958614"},"_hasShrinkwrap":false},"0.16.0-alpha.7525bc98":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.7525bc98","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.7525bc98","dist":{"shasum":"2422f27e3147f4a2c1c30397f71ec001a1d5a226","integrity":"sha512-YIcKp0W+oPRCkIoYSL2Tz+giEm4NqcJZ+enF4lr+hZgXmKdYKtlaz7xl/ujGIx0wORf5OCLfK1LE7GwVMPWtHw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.7525bc98.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQRXdCRA9TVsSAnZWagAATjQP/1iN/55ZzTjutzvkeEcL\n6XmIVKfzo/nhiTx94Opa6aeldKQFlI7q60210QK+80d3Ue1kt7G3zEaogXN1\nLNZ/uNJWniopgOJI91JMpInE0naByHEaEHwi2DXHUhx6LRbL0F1njN/IvqT8\nHqyCjryxbgtre60+U+wJALt30K423NCyPl00Kbg61cUeKtoPe/B6vZoLkQOp\nNE+DJILkJWyIEYoLn0687vymOoGfLiFIbjJUWHG2r727Fl7IjBDHw69HMjFF\nxrSruSj0EUElDEorSTIYNrKYxul8pPS6SguXW+GRRtFZJXAmmh2+PkQ72Duj\neIgaaBqr6NeF4Ip7b/QoTfLkAysZ7g0e7dh5DNV/UBDvlkOPrbEk6U80DFWb\nG9+kOppFGfFM2zLNciNwn6WHgj2nHZAcmPq65cGbwa/XL7Bb79LpW5AiR7kP\ndRjia0gt6vL+9Aszwzz4SN2YT8heqcMdez6cKT1M8On8K4d2sJ577gXn//KC\nJbHAQfzUKEcLSG1Ul2e9JgS8vZNVO9SM78woYh1DHZkuyyg2wVgcaNYNiyYo\nCGlmY3J2cVacL0DJThvruNe+9NvDqtFUvIgFH517qputftjmktRXg7NnpcVO\nBi/OJLTmDe5MrBPjPGWGE8S0NqOIlja46uIQuGd79Tfx5WOWcso0yCtwx82A\n+lTn\r\n=oVlg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoy0iIYPWj4sfYkJg/jpsZI6J7SdW6yk4KgtK+wKSpogIgRo1F/Q+j/zwa3Ub3sIDsjsPRCryMMgVOsSKPYW/v+6w="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.7525bc98_1547769308934_0.35603461180134177"},"_hasShrinkwrap":false},"0.16.0-alpha.d2c922b5":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.d2c922b5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.d2c922b5","dist":{"shasum":"a46081c971e0f58cc10789e291403190fe13d57b","integrity":"sha512-H2wH/U4K+yP8JuISkapHE8rtQ9EU0pw5LfOGbZJ0fwgX9x75TAEL4XrHXWVasDa60/3nD5p+gkWfd2DvTQAhLg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.d2c922b5.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQg5/CRA9TVsSAnZWagAArgAP/1q12tDL3pRXIEXWct6v\nuxNpN65ZLbzpDI4GGZfY4NYbmvJFwOFjx6kmbOQJHMscJVsXANxOqqXn+MYr\niySEGFH4nmb2eiPtYJdOgfiu1qvFYrYlqDGyXirEegGY/0bgxEUOzBJRx4lm\npCFO/TyeiySELISoyzWDQTIO/UNlFGE8d5lB5e2UDfdMOn6nwWuMfzrUvoMy\n+Ot9VO8OPq9IuJO3AKMtX1SJW6bNaNfVSGeTCHdN4JsxhVPmIqDw4958YYVl\nf2e7k6Xe7tXejoEicr7dZven6pzlvvA91P1tCLiKORkxwvYjqhBnoNdt4uPD\nOI6snB0BdJtnxD39P0keT+g3KoJLSLqWpQ7etGm006s8O5+PB0E9R/gqVGre\n+A25aIZDaH5XdhhIdQ7IRfo53JQmGNv529k7zwLkEHl3amGU7oLhNc3we2U4\nTjAkfAJnUzw92m3HEq5LLb2L+Zp0EsJHHd6ymB1In2rcwe27a2jhRKfD0MUK\n0GVKObIrV3sD9QVoQ8XTMozYGNDjm2Pwk7Qk+Rl5Y4cdsXy2r4/cB/d8YIs6\nr7tz3H9NTYkN3ovTn8d+XLwtEVqm+bMiKE/Z5VCrnPtccgds6d7f83xYCh9b\nk4cfMNCQqMEPW3nOajDnjTGDxna0jo9Ul9N5dc8xVluk0f+a5ckt1jMNA+nb\nGXWO\r\n=SZUD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCv1YPqlOcfZHMw7FaVJcaooz3HozJ2BWcVyBL/HwiEUwIgOuBJmqqCumB80KQGPy9MeL0lriS3EUqpnwS55ORPGwA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.d2c922b5_1547832958889_0.36908868437320974"},"_hasShrinkwrap":false},"0.16.0-alpha.ab1abd79":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.ab1abd79","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.ab1abd79","dist":{"shasum":"906ecc05057696817e880a5baf3675e81eee2cd4","integrity":"sha512-fTOYf7ktmEwU/OEXf6C4izN4jQQT9pl5qaZLJgv6CNFq6oZF8MmGd+t0bd1Hr+36UJ8o7UfjJzT/pzf4wVXM7g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.ab1abd79.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQiTLCRA9TVsSAnZWagAAXI8P/jE5aCFTgNEwWtRreBXV\nx4Z+yMa3AUpzCzyVZqKqGxIW6auIf+os2bbSr8l4uaDt0jnzwu9+PUtNvZzH\nBJcFbg02x8x19VAqAaKMX9td72hu+rPtN/rWjUmhSmawCWFqUfFmqyM6hd3N\nBZZN4fJ42oXjU8cYM2n24f6OJ8p7nUdCzoTaBWAcd9b33gQdjk8cBZah83aN\nCcdEsx3wDMMb4rBHYXYXLIAMLGD1VR5U8RKVkX5/x/seUNwInaEDJbO7j+/Y\ny2zM3f8RJ/Twg6tdf8GX4M1PmNN79o+qda0+Ms3v2ybBDRmzQfRSDCNyTGm0\nSqlXAd2rv7pBa061FVTdL2XWx31ix7mkIxoAIg17UtdPfSbME3ESGsdMoUqX\niypf36JbCXCwxV2py3Vsiz4s0sD+5r/OV88dfdlsTLtDer8SUWTgTLyTcZ6Z\nlhE9kiYyHujkr5aRWz/ReL0lRgXz8HhDzU1Jr4ygK9ahPhPxTWPQHaBQ9Sr+\nEQ30UGbaXOuWI5uSAkc7F/bb/uz/R38X4rt+VhCQsqqqyhPCxPwcf5Bk0YGf\nZjK3kOaDSHk3a6DQEXGgrq2NUE7lXm/O0xfAXCL+Lf0xttlcy/Wi1gqPe10r\nBWpv1MAHR5nP03u//S5Hj8cSw+MjQgUSP9d/9hHRMnxbHP8k/TIBnyegq3sT\nLehs\r\n=Bv32\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE1+cElsQFWd9c05Hv7JmLPz9UY9TkkiERLsT9mDxP0WAiABK5ve9MFZcHWrY6GyyI5q6FHybi2hoTaenQA5D+MC3A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.ab1abd79_1547838666941_0.6803731967048321"},"_hasShrinkwrap":false},"0.16.0-alpha.11eb5fd4":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.11eb5fd4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.11eb5fd4","dist":{"shasum":"84cfb66edaf6e2b5e552a2bdc93872fec6cda3fd","integrity":"sha512-7YtQpgRckDdm1HbSzj5f9NPFgoRBlCSrFDrdE3lm7okLFK/Tr4mxCjJhtRAMf8wLGNq2COvO6JPOSQX6Q7xVAA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.11eb5fd4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQk0oCRA9TVsSAnZWagAAjM8P/1iZ/Ju9iqABNsWktWHY\nQeH6sRl/GSkiWHKyMu22srnR2SqbIA7aikdlVlwoO6gW9lrdwKU+DYRckYSK\nVv1/QRvDVwTYWWO+582GGwDsLaII1FUYeNij8cwWIR92HsI6tZyc+CuvuYnI\nxvsq8EbIXcGMRZ3ia/fJb0+jeOOwD51om6DLJi3zgkgKiD5aQao1jvJNGisS\nn6wCYiSogbRsVK5DVzaG7a968i7VxV+ZYhU7xxK3Mlx4RYUftJznBLazWAZh\nHV39xgWhCGbH583lOqxFSatvL9em12AcM5jf6wwS+kT+Cz9EeoVppRa/+S0x\ndxIj4m1GVB1++CDbn2lgXBtkQHS2nFmY3qccshtqbj+HYqNOjkENgqSDaU/7\nP7Bsg/lxvoQo0Gtmmsnw0H2Y9pJF+P0llDD5fI0tg1jlv0gAXOv1LFm7OKDN\nvxYoAs7SaT5fWXct8KctwCSKI99kY2/cIwTmai8LtJ0NUMg3hSyfcvGYo5Ah\n+4gJQ2jfGmmhaWKckDQg1xEiZJG+TVE6oEwHVl2FSoa9WVPSVK9am08xbK4w\nb9bvAcf/hq7hUf9obMxmCFiJRBeTkIpvPlI7fgZMmQhOjfzNguLY2/x0KWyp\nsZviAhtIvP6g4k2i4iQv7uXqm92ahdltXDgxbVCGMzavkkx0KvhnxXpYvaMa\n5Lfb\r\n=gMoV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvVX4+XCTmgy2otKcqid0jF1cwpT1gxizpQETR+yXKawIgbSqtKAntc2oBtMfJCpPTK3zICCZEGvqAy2Jiztdg5sA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.11eb5fd4_1547849000387_0.7571189752217242"},"_hasShrinkwrap":false},"0.16.0-alpha.6e5b3828":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.6e5b3828","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.6e5b3828","dist":{"shasum":"5525d2d406b36802a00628c76e553a7b079bf861","integrity":"sha512-sqEDX876ffV9wElAyNPnYffKWe735GWMjct7Hj8Ts9+7k2sPbqrC7cEc/fS/VtMYGd75ipqZqa/IU4mGw83bsg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.6e5b3828.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQk03CRA9TVsSAnZWagAAxr8P/04R0zmz642J4x+dL+xW\n6M1mV438ONX0TyXNV85OlfeaXmU/9P950K7oTP4NZTywYX2Tzn/7vRBhxxIF\nVkWDJ0Xe6KIlDmq+vN2bF8SJ4gGaqL3Xr67GL88ypk+e3I0uQFs0LUggLj/F\nR2h85jVruLRMX0276nZ1LUkXTpiFfk5xS7NxbvfYQ6qZvZG09RNORZmIfIqA\nSf6xO/kZjvjcCY6scp9S3gFdRx0GgUeZnCHqc4nOLFBOVUO3uQdI8EK7CjgI\nOJ8RBYseu5MT9/rQUmwlT3mNl0AIWP94Hxlun+MVNirJUqMraFNwve6gkS3b\n35adpwLk30p/g9RhUfsTgp1CTIxDEEBwZudOlaA3pkuqu9zDEMSl/H43P2wk\niEYMZVmREBbvxIB51QCCLUtGcIAGku9eowW9NVCbngcOhv0W8U6JToFQqm0s\n/8/YoKY6vbxboq7hI/MTj8nPTeTQJErWPq8GOoJihDQblSpXc+l5ithELT4x\n5HlznZ+d6Vz2igluT21YaHfu4HIqVJVidMwIniw/RTN+MeL7KMPtHzCiSCNM\n/s61TsZWW//xTREKkKs9iEKjhbeEBhqqnN0XToziVw0tFQ6RtV9JQDiWu1yZ\nBADK50nvYm0xZ0+aSZ1sTLle9RMSaKuydCM+JwDwZB2HCadip1YXxvoqZ+wD\n0o/1\r\n=mI/H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNMjW6DwUwpdoCs4uJqUW3mt2sqGUO1qN1znuwso2l8gIhAKhpxA2NoSM8nFvmipuktTpA0CV0EdKSRH3gZSuuDmqg"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.6e5b3828_1547849014461_0.6237547253906346"},"_hasShrinkwrap":false},"0.16.0-alpha.43757203":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.43757203","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.43757203","dist":{"shasum":"6a76d676058233bec4373271db76fff3db17e60f","integrity":"sha512-LjmKJ/ycGOV0SLIJcpl2a7WRlqthak6VrsCmQRwIpHLdAlgtF0yzvYebc3hY2oek9YYhl8VVhcO/RO4T/szyQw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.43757203.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQlReCRA9TVsSAnZWagAAUV4QAIrezIfK5hj1oDdsCAPU\nI4YJhHGIG7uBdG2UdSryCrroI4duTPJ7hMG9hAc9y6BWlNMjYNlKAerwmeb6\nEj+TZZX/tGvDCp5xXtuYyTV1oKZE74ZKjgoyjoJWCxdJrNv9SzIbwD6ZcKIa\nIPQKH4oE7o4175HXxFCBzhNCqw4SDz9z+obDKVFIzT5N9CR4ISo1HS8ZbuTw\nm4UCUnUxv2T2jGlUVyUwn3ZcULnKeRTLVrpEemjOZ7DTbuN+wCZjuPzC6bzB\n06OR7HpNnTg/Ez1/uy8SLTgwJwLPWJ6+mR/1K7Pd35LL/8QI1cHqEfqvTLap\n636GEhRydOJ8IucwHtzva+uAXceHS53uafZ6KuNIKhGnkoRvYAMbVaLb4uJH\nxCAtJZOTthc2Gxj2WBIcfdaF/HqAuzBiUm87ZnZdMwQFomJV0oWugg7HuIY1\nAUq64nJFg0e/HVr3MVefVohCrM7pshFlj1+VOIfBzG++rySnzXGgynha7s/7\nHT56i7VfVDAZAe29NqbsFp+w2R7taxEMlWRD4BayxHpLxOJUn3QciVxW3zog\noYSc6C1z+PfH0stKcatifHv2PImhM8LdbvK/cJcAViPNf3Attv91X9B5bg5f\n5P3yQZ90GLUZ6RqdloKGQ9B2Q7/dldQWQ4fsCm9AVw7uEKsb1TmlrmnNcR22\ndg51\r\n=7MUb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXyBITKZLGVw1i0sd0hkVxe20iJM62qBZqKobG0O34UgIgCZi+0vVZrXXzIp5mwWiP/v+elDKiEPw47b2tLJv3tFY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.43757203_1547850845675_0.4036108210974705"},"_hasShrinkwrap":false},"0.16.0-alpha.31593ed2":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.31593ed2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.31593ed2","dist":{"shasum":"e7ea3380b19698fd91295f6b83e7952067838752","integrity":"sha512-Vxe/fZqpbOBtsp8w5quR7Bl4mS4PMuyO+XmO1p4mcOZ9o6qaAmlkkgwF2RMoxd0Kp70byrDrNaOvrmuf4LmCwA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.31593ed2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQlqsCRA9TVsSAnZWagAA7x0QAJPIuofpBpd9E8guU57a\n3ubIYRHndko1B4N0LZgwQS8ZW7TxmWeZN6+4mWx0CT0l8FgUsJMeZcYdZcW/\n1YimVqm3A6788o8J3nmADO9EktMHkue7sk5immWs8swsg+m2Uwpn31uWwwPE\nzqAXPEHATOOdNJk+sfINOvLIpbAmQ0YRkt/nmQKm5NttYKd2YaHZgvBGX/9B\nx01jAPGb4HOlWxng8+x/1o+04EXDgbEeb7LTw9e7eqU1dSSAnkJHmztshZic\n6CZTOMWLlfyBJZ7NowaU3HtFL4YEGs3NPirWmJGhbxR8ggL8/KZ65fAYGC4+\nF3wS0gScMmp9cb2RisbYG7dfQHnwHdqvBuc9Ad7n2IxMNZP0nNXR86ZrExcU\neo0Ze2nUNDe/xruuL6QS2KWS+cI6lRrXh6MtaBa9p3oKRfrFpu+kq/xlDkOw\nnCAV2MHd/c0dEspUyDUphC4mc40Zodnv3loxmasHUUGwg+fx6NcOg1NS3/DL\nlijcehpCX2MkWx+dBYQ90vj2NUh3/Un484B8Ri1hgaNPTR6CfHp6dsO1tXZD\n0hyaJ3/kZ2eYaSCzQx+fSSBWjLivL1enCDeW5SSHfhjS/49Pp+ZSyitfDY0U\nDdJzY5IPQjewc+TGuChhe1hrQNpZTcv1chhl7G6yD8KgoSHHeJVnjf5TdW9Z\n/2Z/\r\n=5vmi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDggHDN2GAn+mqzcQDLwyfggEN12EibeqkElaGVcwuJeAIgMQNFuzPvXI7AZ47u3ymCQwHJSChHuDE15qc2kvLaH1g="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.31593ed2_1547852459789_0.7507148349942532"},"_hasShrinkwrap":false},"0.16.0-alpha.e58dd422":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.e58dd422","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.e58dd422","dist":{"shasum":"dd7dd675aedf48e837e5251f6603e58bf76e7848","integrity":"sha512-lssQxtiHxe6tJFJUlVaQzAqESNVxeggOl/Xr11ihfYChgFKbXFmwKZMEau/GOEWR1znQqduIAQNac4G4wOEN4g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.e58dd422.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQmr3CRA9TVsSAnZWagAA+TYP/1xui3MTEcCXKG4Gw1TN\nNXMSIEs7rpXiccnPWqMVJU1AkJQVDbRr43+aCbQmJekyDdw286GFvvgustA0\nG95WAILZA5pGz0P/584/8o9MbrlDXMX6nwW7JiDN1bTSXkKrL3GlR2laIRao\nNDPpoz9NrT/iwsasOExHwSnCfeJtgItC8Uae3+YQZCoU68UHtzO/HW3cA2FT\n/lw1BRj2Ah9a9JG4hA5tceO6POAjeP1MSLd4T3qQ/1vQyAac0kVA0By41C3p\nmaoMyNTrHFQZjgaLYxFAu2yCtpBOIMNwr55U3EO15VTsSGLjdmd8mzkbszcP\n0BzuXWFWyg+V5KOKNlQjsj50CsxrT6KzVM2ngGFN6ltSPeBajAlrbeVLYohq\neQLZnkaJsGIlXj/b5YiifScJCkhxDBC8Nv8u+JjGGSDO/OHg1BD6X5ncMG6F\nNA8CG4WZE0itgVCeHos/qeIWvJxro+e4CDLAFH84H9ghMGwvy/pCVFmiTP22\nEowevah/ZqPxAV57yFCi8SCWobtlWXxR+kR+take+wLUhOyGEIlU+mp7oTG9\ndu3vFJ+FkTVgxie2BQ8ocN/+M7UrL+sYZ8gAhs0ppvt16DGFlKyfJLifnQmu\nLf50WLttPJCCOpEC9vaV7v7c/9lMxyaHhx/QV21R0cEGvk+0TddRyVTdsToL\nlPk6\r\n=ykjS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwGJaLkao5ETs6G5f5nbkgGv6yFahl7y3ReUn4ojLXoAIgUQPhLgd4zbiP0KxrAccN/1/r4Qymecf79rnu7wwOtp4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.e58dd422_1547856631253_0.342104645857884"},"_hasShrinkwrap":false},"0.16.0-alpha.65ec50a3":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.65ec50a3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.65ec50a3","dist":{"shasum":"d57e023f125614cc8399ef656e771077f820ec13","integrity":"sha512-Xa1yqSnsZKfDTowBYgOEsVl/+KzKyE2Law0JehIscV/RbbIAOnVUYvDRxW3Cy5bhzwdPIEN28DvybfkBbzi1Og==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.65ec50a3.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQugECRA9TVsSAnZWagAAfgcP/RjdGUwBHfTbuVTwTI8c\nU7LGOPQXHlM4bcoo0mVjEy6eOmZlPZK4QwXo6QdXcXXN9pEiyHSrzljaH2Y3\nadzV7ryru+wgYbDVzVPytFDuvOsAmWa1PE8ehc8VCOi7BhUUH3KTFTCb7KE/\nH//zJ6XmYBRN9qirk7bcOy9Z3V44O+5ukjfoz5nnyVwYL6vkOH7zHqL7+60e\n5qAp97I/Fn4nxydcC+NxWrHMHlE+0dv/jqea5Iib8k1xceY+2ORsj0dXE6GS\nCbv3lxrVzFb/La4q9X3DLvIndU2FK07DIsafFymZwAiPSf05sxUv5ODfY/OC\nxOdDYD8tnvZPvDScToWkb22gG+95gzsShihDHH/JeIsc3CBahz3EtQ2Ded6h\ncLpoHhE0RXJYSV8312TQUmt2+4W8iIvr5frpxkcxfADrW5bFoWWCbTJFJfi/\nwY7HXKHGHu0IQVyECtp8s0dQ0W+6W3EP94SjHMklQtwjdlx9wRdcQZd1at6x\n89NKC8XlUUyUhJK8IWHW6bn77qHAXKo7U0uXV6zyf0esu/grlOs4a6ONhQZE\ndhvidGacOmihvdStlnC+18/bjSGDXcxFKaElsugXSO9ML5R6Z76Ht6ub+1E4\nSWYU3UZe6REeRwLsR9kKzRzHWE3ZVZkceWW4rPgvxXtY0kBsvwA5jdwX2DzJ\naiVQ\r\n=x782\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG5j/f5laZqtWMEOilOP9PuebGaJuRXiX0O5z5pLOPUvAiEA3bJIw29gFHzUt6x/MTcdBSDd19/+gqDAusSGs8zDEzk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.65ec50a3_1547888643713_0.6085274381535635"},"_hasShrinkwrap":false},"0.16.0-alpha.3f632c8c":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.3f632c8c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.3f632c8c","dist":{"shasum":"70b1fd9f4634b52a194d9338a05d37771f5bc7a7","integrity":"sha512-9mPvQcrqzozTXjlE9tZ2M/Fgbm31+R+/MkpH39KheGa0gcgRKSAk2Rr9z2mH6Pi2fv2q4962fo8uThPbatQ6qw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.3f632c8c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQugYCRA9TVsSAnZWagAAJLUQAIYqQCRAGds8mFcuRzJx\nBqXSQPQQAIggbzCh+ctgTJXZqaft8s3nskTy9mV25QN0t8WMoykcRXXBdUJp\nc8rIiOQUVdJOKt0FRKw7C8GfmowEpt9HF/3gJKF2Uc0hdQuFgCz8YsuolAbM\nd49zzQqivl6H4UT88z1aOwHqQd9WLBdm70xdaYxPpUXDv2ZdGe6IYKMaiu5i\nWdvHTm+4vgP9HKtpzRJh2cMvMAhACXTiTNTPXECQSd9WEvQaJGt9ldZYZoiN\nWpMcycp6buFTFrlPcS0aaefIe4ic3h2sZeQ5wyy6QnGEqpHOOP0VY8q7zB2k\nuYkBI8JTbNYzPu8eGZyvT6q/pwX25S8hWX8FmfjlmGyOWoPXmoQTzTZspCo4\nfk17xFPXmQsRPALzWVkZGmYpVZzJX2J5p5BnnedKmGppbmE6OkvDhjePOQmU\nATMJ4Lt4eRBp2XH8z2yiXW0OtkR0YJ2zCK2DcU/tttWTUxW3r0/e7e4EHUof\ng+1pPf3LOMucPWiEBEGZp2iqx4QxAurgwFBR5FuWRK7TQdMyfyuh0gS+aQr7\nNcYOs0Nez2xt3CFv33fCf5sakbcux1Ar3rl/rVf8CHiO/0vZRgN5ollTGDmc\nM9ypMjQ4N5jLra344JS7XYgg7CrkzdijFW4eNyO+0fqvIOiATtAWsPjmh5FY\n3f94\r\n=TJo0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC35fHkWBCA/RdLB09/GPUxj4SOLoKM5kfUr3yoMXjz8wIhAKbGNc/1lb590RjzYrdxS4Mr7SNCEiOMe3qK7yY3ruua"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.3f632c8c_1547888664308_0.14286437264707152"},"_hasShrinkwrap":false},"0.16.0-alpha.c003293c":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.c003293c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.c003293c","dist":{"shasum":"127df53b0a6befe428e70a30b64197b68e15cc46","integrity":"sha512-zmgq7PIYSNP38A7gVAREYp/KBdElch1yQOCcEnsafAtMMcnJKdEvf/wC3tNPeFylLYTwRGCWh8speyFUSgCrEw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.c003293c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQuglCRA9TVsSAnZWagAANwMQAJfSaG+VQqaO0RqYjnHL\nH5CLRvi/Org4pk1Oog2sjVaB7i/mZUAn+XSOW1hz0KgHgtr0y7lQiwcAbfS7\nZalcndxFBAcD+ZrmhqbPv4Q0ZVvXfiY+jdTuMnPtN4aU3lLYNF89KPiLJDR6\nTMZvmDVYU/ZQ/KRcqsAxWi3j731KHbFey7BAc8UZNbh5XtknYJyY68LL8dZ9\nNW5CX3C9oTNkcNid3VBptKkKTVlc43enVJV+uJlAIXjvW9KftnucU6/zH4vl\nNrRXdhYGW1Z0FPeuDeJD5WlZJCMf2pr4PkVHWHR8MW2wbP0/fiAXesZ+Kl9w\nRKqxlm591RqvhtOioOcm8qLoMiaCPoRI/ODSmZ3PweEex85sHpskS8SnkgEg\nzc/UIj4EmUrBFznh/p5M+Y6IYdoymOSQnYMLO15xg5ZY68A9SSv8Z5kDPHEv\nW8BZRI1gxo/czqN04KJgR7r6RFmJ4QjkheyeRCUIlVTlHWltl6hnJ9hb7bot\n0/dII+VftLbmivU+4QvIt8k8yQt57ASuToZG5o8opvr3kkyWtNi4ZifZOH+P\nJTuWRT+hhjh05Qw9DFouEfTpkIoENPQLm7ecyDYfqQYwrdZm2KKlxMRq7Jzn\n+19SErqSiKtJR5yJNGTtVpp+Q+puF7W7dGJ5Z3khRHqK7xPHybc9GwfjtMTj\nf0aW\r\n=uwdM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4AKP9Hgq8JnUYu0hFl6GC14frRutgcS97dNxSV5S98wIhAKFhqfDDkAbRos1lPEFfjDqRvb9xp2xmjHHB0mMsNfME"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.c003293c_1547888676476_0.4519427249187824"},"_hasShrinkwrap":false},"0.16.0-alpha.a5cb0ca4":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.a5cb0ca4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.2","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.a5cb0ca4","dist":{"shasum":"34fc74c19198b59ef5a3f18d1bb9bc46e5164db1","integrity":"sha512-8l9mKwBVkIJfXTColo/il5k7p2gAZ8O9CoE6ugy1/OGx7rjyk/VgE9ofR7rIesY09yOJQyaIgT3h+ELdnkNbaA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.a5cb0ca4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQuhHCRA9TVsSAnZWagAATAUP/ilH0lOw+soyCV92/oIB\nOzewKhgJa8yYgBovlL5GT+EgQ8T9CZqbETtmrQY9EGvZ2+PQJwHJqum7aExL\n0BRHyLx8spMohLwyoayBUiO4FAk/yHYfmaFiI2VYgklvFwTP3JGv7lbBwrWR\nPqmxKHHYWVYyxPcJrJYQPpcshLqBV8ifsAqO72GWtFueoACFoeSkTTqy5gSm\nnalgp5KvOqL4MuKP3VPp4MtbPGzaQSRsIhuQUlATLE//Nb5pHOug06Woucih\nlJExMoFuGb19FYdBPrhzGBLjnpre9Tk7pOzXdq9QcJJQcWaz79kIFiMGtPb7\nPhGIcVn7e48yQ+7i4pnlti40tC0t+aU/66e8xobRxeLblBqAQZ5Cr5QDhnIx\nAsElTZg3FoML5iuBQh2ESDQvB6+lZo5K2nh5FNanrUMgZxtja2whfz74YnYy\ns5QIdSssd0Am+z2N1KcqRQZVHb0oHL2+z1GrOsAi+wVzzkCgvsWqgA2PSDgG\n2/XpV8B8CPRrECbmbpYq/1Fo6r9NpedqV0jrQp82sHtP4zksXGVtc602No49\nOIHlvyBaUWdKPqCVLkLlxxcOzuNTGSnKnpcQcAQ4jLluHuvkpYOzOmsOMNJV\nl3/mrJuVev4BTesq66qAnpVM/+FzBtBtXNvq0sS4RyRITdPaxAeI2iuit1eb\nfmS+\r\n=sLSv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDnMBfX56Pu8AOT9QZzCWVBqT7cz91myatwl1guE1DSbAIhAJ6pMfGYF69GRsZBsFHISNbRJnQJwhEYwBng9Piv3Wx5"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.a5cb0ca4_1547888711033_0.2537393087720652"},"_hasShrinkwrap":false},"0.16.0-alpha.51c35a5d":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.51c35a5d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.51c35a5d","dist":{"shasum":"97be494fb7ba41139564ae869708d463019b9b4f","integrity":"sha512-S6nt6Rf0t2V52LCcL481/3td1e9JZPdcJXY8pMpMdArVx0IkrrAoTqf/QdeHXKtBXgIZXjN4R6GAhV5mePdGRQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.51c35a5d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQukFCRA9TVsSAnZWagAAgv0P+weLgzfBluZ0ykUe6tyS\nHkzIz3ooKi9Og0/nkAtRXBYipn3CoSLsV93Wv5QRk9JuaCEe6OPInNa5K8Ke\nkIzcQkJy0CvEqDMlW8+g/+4jC//+AJBbfvFvz2nDPGatGXoYsC8bozSYqyrb\noTyKOk3AyFG9iExsZYbU2RoRTtQ2uv5NTrFyNujSyAYsBwsbUqU7SkSQ7D4n\n2ihEf244VZG0k7haRZexAlxXk2J92XzvrjADZyT0q1fxxeMo0unHiDcIA0+T\nvmKMpkPL408Aw2CTGZqoVcBObxpbzSP6zvKl/o6eMUtj+0VRMpdC/nJsR7Jk\nwfJ/ah3mtbZ3pkxaogclTZNIqdt8Kj9BcegGcFo8pQSMG/xZlbkCsxcA8Npg\n3BHBhnBAoAMInnuuwgGoj1sj2rSI8o5ygA10xh1rmrBhFvFyH4S1eCPB0p3y\n2PuRYE5AaSfUgYbbbGrVB2idShgQOc5YtnuQirXyXsF9TtJEi5dRh5l8h63l\ngdPHpPSHTif6kfJbBVDgdCgbedZ3FRRwYItiz9EscLmnLInGLFBHdX1XkC2+\nFjvV59Ib5QKFXrgU+UZHgyR/1NtEsiszYl8N279JN2XO1l57zmYHk8OxP/Pk\n5H9fsSJ9GmhqHCgdJzw7P/D5XqgN5OvPVTdP0bhQU7VexMXlnr+pWjaL1TnN\nN9G7\r\n=UKqt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDeqQjW/ymTcjSyxR/Srgnz2Yg4YpABef0s7uAfyiYLKwIgI/caE12upCh29WG4ZKFdBs7t4knBQi/6frKasYlHToU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.51c35a5d_1547888900609_0.6920123810081136"},"_hasShrinkwrap":false},"0.16.0-alpha.214ee5ee":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.214ee5ee","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.214ee5ee","dist":{"shasum":"b611a2a0cfdd30cbc51ff6133181eadc359d1035","integrity":"sha512-0fjgRudQCMsuxCuC1Rvwiu2ivue/4rvrlkmRxt//4ZtrFgW3aG8J89Epgikujetar0ni4mm7AzFSFdqKK806uw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.214ee5ee.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQuk4CRA9TVsSAnZWagAA0tcP/1yGAUu7zyXZ5py0Ze74\ncVFbmVVXWEBg6EbuFkHhF67sHshKXl4lb+3eLrYWPj/Y+vMTYlIbpZ0gWzRu\nEU7m3/R+Mq28B2wwzv/qhS/x6bGcgt78IWmWBRtczsHQfeLtWuLSjW3C0fU7\nSrx660Rm3L4rXGjpinkhyWVC/4p1n8ewySxBY8qHlMQL3MZMb7bxzOXG/Jbv\nAOShEcD2V1X6QQnaSD4HrTI2tAetCqKtEwE3LmHw3xPYs4/87SLrYb2MIow6\nGHXWRa+KlcyJlaIgsVSXoiymgA/6CJURUA+mTKLyzJx+N3mvjLkLK1ycrX02\nqdqp2AWLnLqieNXdmjRHRs+0yvbrfK9nHcGeg3lSzzk4WnPtVifQHBoQn72A\nUeTXO7w7I9M7lHHjqVu7o9RgFAuEFq5JrM7QzsSSN1BVryroLETVsMWTndGM\nevZusgy2mCaVYFiuqXSGwnwbbCAJrvIsRnBnvCUwjtIUPd0nOaKNN/v8oG5M\neOHHRgmdR03gzIMzIXgvUSz0Ntnenu+4SFka5cFmPuHeuJ6ejCWxWjLAChKB\nGLsP7DLV769yuAX51K/O9U5rD4tPY6eo8/+5Q7kLlr5I1A85Qayn0D5kMPBe\nOCmQ+4WIvwT+PPSXHuRre8GI+nlCP1eLJ1/Dg/hFF0IHo4qDlBff2/vD6zq8\nyoQX\r\n=MBsD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDJBKQ/xNBcdxAX4fWh9haecPAy4bVmRfhQsLYxchMevAiBn18bw3BC//CnJj53lVHIBaV5eOTuKLV75/ZSPm1nRnA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.214ee5ee_1547888951906_0.946635118355015"},"_hasShrinkwrap":false},"0.16.0-alpha.87b081cb":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.87b081cb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.87b081cb","dist":{"shasum":"1ff3675c92a6ac4ada310f7ea060ffb2c78ed740","integrity":"sha512-dPwir05f0pwxrk1Al6cnxd+Ka6PFWCnT9r9F9ZlT1NaiKNKEtlB9svkTfXCcLjwge8tV+w4/kMtGElqkrqgQJg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.87b081cb.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQulBCRA9TVsSAnZWagAA2/oP/RgbYcd0onnyWj61iiuY\nygVwpUsg2DXIlJZdhtAwuPfRl9BsOBRhBHWM0Ca1VADqyM9WAdf0P1zPNmK8\nJ3AG2sIgmDd9zNSHtTcWeFh0DElmeXXe58ulxOrKfmFJvE6l4kfqfaO26Hid\nalCgfDpactY/NuIa6mucn5qQpuTlQokrWIWvjwi2WSqhIY6a/lpyXbzX7OuF\nyiSgBbvE67OYGfVO9qRP7KBCaJrl5Pi/ug1F3LOIBCZvIQ/tMrEnR/crYwia\nQh824m/HD7aw+4bXAGvYxhAc+5Yo+cjUvBTsZqlM5julzUP4Q3T6ggrQW90a\n24GkuoT1hBLoFHP7JOyqsU+dL6CZXkVVl3jePszYOVFoGgRcIrUEZOIq4aHq\ny6kWUolcXsjoya73Ns2LunG+WabWkMVo/rU3lI1Lol8f8wKY5VwCXyKL04es\nbAqx52Tal9svBs0uJ3gqhTozrBzG9bTezbfrngCVpyYwNs3FeIzw0hnjadcc\n36zLWoMI7oWI0UHQalP2Cmb8mYrkbnW5C9DNAB8AARQpnGNlUKadFSD2V01X\n7qGZTfOs4hOpMOPENZr+xxPjLpgB7jOu/+4QWszsMH+vFHyjH49Vpxc9fEyG\ntIPQ/UpqIY31AXeX5XuaLnu8TBiLfdEoakV2CPAT5nDtbxiw10VPXkXsRqZh\nct4c\r\n=Ni1D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPJ7f+eTwMpeGnFESpSv+RweXZ1RoW/tdTITe0jXHZEwIgE8XvdXKXbR0b+GTOcwMzXRn+LcntyLVTxvymMRevUyU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.87b081cb_1547888960902_0.5673889493605975"},"_hasShrinkwrap":false},"0.16.0-alpha.54d55834":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.54d55834","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.54d55834","dist":{"shasum":"2a2210d9a284001e9f2e7af2ff9677f71dd92002","integrity":"sha512-U4AcYMc357q9cMuULZ+JBE2CpBnQXvta/m30vz2aNm6/FrKNjz47nzdyiy2DAoD/l4201XVFN4oyjWGkvW1mKg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.54d55834.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQul/CRA9TVsSAnZWagAArkkP/j/sgvcN75PzRouGO5eV\nBk5hGzaqQK/pXgz2Ae85MQvD5ro551R8i+S32Ji/7Llv6Fd1iuSYkegtfC7n\nlOpf2UNnbgzY+yzoQn6+tY3TPD88C9KEWhfuRTmjKARh8a64w6wCdXaZMnK9\nPt26a7CZx9uILlgIbosyNLixeFHZt8Rvl7Dvp7myyUDUi4dz0U4sz7y3TMgz\naxcdZpEehU2by8WAgY//4HPGGDxkzYaBH53e/FbM7wmlK5DAOASdL2qBFhW5\nfnRmz35IlGYmQaATuwRyqpzEwQ6WEFQcAomKPY00STQQKUkna17ils2+bCCM\nxHiDzdkpVWs8Ow2yCl74RojJvYX70nMmB+vNZ9u9+bTVEqd8g3M1GPiGYXfB\nr3K0N1GWbHiUDOWF3tIhiFtFW4QRUM37CUFhwaTChjbgEtjvI+clOberDyZ4\nB1QyLghrE1GiXMcHhbfH36shzTKOHY0VYAh/R/fQKA7noJzVy11NSgHJmqhe\ncb7KZHGBt4S0K8jMlbFS1MP9N+B1IWDIhD4Vv9nXatZJQx3MKFqWxuZ8Dedg\n/bELElAFzgUgpb2xI7PiXkowWWhTv+hDCVi55ERr8v+NQusZmOiRNz+sNuKC\nGdEfegglDesyYzVez7rUJbnxrA+nUzC4IYqPenBdNi6VPYu/dHFlnDr0nqk4\naNo8\r\n=jlT0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFHKeOQEpcXWLlW5tGPQUeGfFDgfd1nXCChWLVcMUnGbAiEA3Lehm01+D2ZN1ch7UHZroqVTQw4Cnblm7ufH8r/8wfk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.54d55834_1547889022769_0.7543576703395749"},"_hasShrinkwrap":false},"0.16.0-alpha.8905ed98":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.8905ed98","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.8905ed98","dist":{"shasum":"8edc9569ad7a5cddcc7ea3e0a4484a3cc004f79c","integrity":"sha512-cNqoXTUYM+NbBpW5sPAw5ycyKAb1xZUj/GJrW7WKPQSDEtsY8y2lCeIwtMBYVSDxiV+rjkMU73pzkz+8LrodOA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.8905ed98.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQuolCRA9TVsSAnZWagAAqyoQAIjFXphLqwDuKEhWyzdf\nhwRybBZjsX9jiNC6/J6sIEAVIYMnZmzB3eLCaNkUyR+DMOwwKec7HQ17j98p\nfIYk0D/H9kYK3p52LdvBBzRaSVTl22VFe1wpy20b1bwHlSimQebeQW4sStwt\noMJseV3Qup5q3pJWtx8zRVtDknjBR00ogzi2TGbVwS4j5qxtMHUMxr3jtj4t\nQXS5iR+LmZbfIDEnkUbKIPxCeM/kKz3SmteSbd6gMqJOS5nZcFcOFsk+hQVc\nCo9JIe5XwGQ15MwoJjUgVUHdztK733F2lIoaTL5mcMViypJUNuXqVP7OG5XZ\ni/6zJ/+GHS7gUiZySdqqEJ5ZHMqd8uf3TlXrXePUKZivMaPizNsFnYMEjbno\n6xDYZnt3D3LKC8HkxJm/dEGz6j9kGrJ3J/HxMCQu9xskEZelytYRR22BmGiS\nccftVeMIaeNpWs1Fwhq02a6mqJVq3/K4OMGnVdHoo8uVYQO34IKfITW1kWzi\nPVvfrviAxUh2tMIBhDZCnd4AbBkd7hi2wzXOoSvGROTfjD2LEp1hBpK4Ue6P\nyHGacYO6Gkut5I8rzU+/lTPF8cCGzyuveOfygWbXZCPVMy26Si2ReJ7R4LEz\nL4RCwPB3j/aSSRKiapl76n6fz19P66oBpH5psa58aAYFxln8QanTdcT4aNX7\nP8cM\r\n=PzX3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEBpg6eoaYaHZvYFt5kUyT9Gtdw3vXtz6mROvteJwQyLAiACQFwSS0vBkOv4RaN9Os+WxGEu2au6TUWEgxrFrj/yCQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.8905ed98_1547889188761_0.08084045200972856"},"_hasShrinkwrap":false},"0.16.0-alpha.fc6e276e":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.fc6e276e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.fc6e276e","dist":{"shasum":"2c6055eb280f20b95b6f55e69e70f2edc976f775","integrity":"sha512-h1ALUQUZcAA8AKugDv7DX3/KyySIfatGx0k0S8kgeboPj/Wg3qsOAr5uq6Ecwo+/r57KVkyHzPS6uckbkpfbMA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.fc6e276e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRC4aCRA9TVsSAnZWagAAT28QAIDRggSs9qn78YP2LYmF\nqkcffVtNouY2+EwZB3kLXiTl+9h3ClIrCafOvXoGRzKGO8SW+l/9sOufPS87\n0wdp0PflfCl+XMQ5nGNegkGq5nzeYCaVJ/222yqrBebkUfNiOkrQ/VoEMwZO\no6PbKYx7c2vUa5M3cH+Tt/ZV/8s+7rm++sGBZ/qT45o1hRKU5WWu8ntBSiHS\nFZbG8qr4d6m2Df6K3ZZWAdMVOT9A36uoHWOUH/zZ0D6AT2Fp3PLTP+T+VeES\ncGDugboJIyM61jLbtA1wy+4lRDhoZJBeOTYHUIU4KXHxEMShcdCc5vYjsOe+\nds/YPvPpz6VXiPY+sZlXlSkkPfy5d/f6K5hcA9X9enMz3rbzAznOXUlOqWoW\nRX6lolSiVVo9UjqaFstuU5L9pdGmIq0TqKrhc7rA8/jqDsl7qoAmReNPRDLf\n93kjbg/L/TePZd27bnaZMlD8qhyY+/BEglNK3oBv1tKtsIx95IFjbR9jpmhR\nVuvvXPgLG7vyVAcopcEYLVBtOP4LCq/zMML3GLXtmxRqx27p3dgIkkbCZTPs\ntQUT/sbAhBoEV9kbc7oYC6gqhd+Cfw+PEyPn3mzgASnK0KqCOacWUYHbk7WC\n6P792LhuSUBH1KwZEG2ehOir1w7gMzTPFA4qLAvbDUMyeRS44+JXTRIvtwXy\n7NsK\r\n=JnP+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEKAuMJ9VIV84NrBJLiBc3Sj9jbCl7aiaN0pYMj51SSgIgZ19XF84m/tLLNRYgFxnd/tF/dX+qjQIydUloDwLkVHA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.fc6e276e_1547972122140_0.0991093705825754"},"_hasShrinkwrap":false},"0.16.0-alpha.9ae6a372":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.9ae6a372","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.9ae6a372","dist":{"shasum":"efd926d3bd85febb28b25d52283979dccd863400","integrity":"sha512-EwLpdjh/WqxUT87kz928W4tGsw+N1OrA4NQO5OlhGviWCXwyi7frB80exDYHEAO9+ZA0N9ytI99KUJfDW5ZrYA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.9ae6a372.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRC5KCRA9TVsSAnZWagAAINwP/A/mJvd5x6/SaR6GKfQ/\nXaatwH8SQrLMYiUJ4Wal+7KkihGTgPqAiA5EyMW1KaMVHnqmufxzqUUIz/oo\nlS96KbVq+Tg5N8Ei/qXv/4Ly6xMR19paAMd0gVLbpmIqQqmW+73RniaTJF2v\nAqAwWLK/11q6rjP2UuxgBFmRwmQJAY2ssxo5gNhIQ2NCl7UgEMQe+Zf61zfx\n73J1yNbyKqYzxLkZbgDbmNP6N5ka/TKBo9shkiN8Va6F9LrhaHRWnoiXkwq8\nbZ90fmufaQ9j34QV/hfPIcKopn1r4PutrhI5GUynMW2AuCfw9D9ymx+dqXTq\nwXCy0SO/DUqM3am/qt7gV586pDsIQt4LfA1EkMN0ddTUQPK8Gj7uVDfhy3Pt\nujIzEHII7Ir8lV9jArIuaVR+JUgAd5gNU4KSGIeDX6o7L1ln4cebTJaXtJqm\nZRCgIJmqwhsyESeKsmvTJ5r0Ox6P9BV1UWLwMWaNRiI9Uzq9MkilHMQCRN/D\n59ZtfrtWlPzz1d11YND1YADokBpDy9U1ui2eJIcyAIsJdl7nbDo5nnP3Vyq0\nhtnlf0VpnWFm+A1MjJ+G18X1/Pucmgs4OLQ9isZ/VzaG3vCwZlswUrUhKowW\ncJfmYOOejwuS9dakeTawMWiXSFMedFYlXRnzORs321ItDg0EwlBmkrEkjjVh\n6D1w\r\n=HNnl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCj0Gt2hkoliEYXMQ4XIyLciRsugzJekTr+kk6Z+/UeMQIhAJRwSCXwLpz8I7ChQ7DH+bSdoH0TgQTPm6CVTUMU3+Ck"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.9ae6a372_1547972170273_0.17526750319169193"},"_hasShrinkwrap":false},"0.16.0-alpha.3e03cb27":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.3e03cb27","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.3e03cb27","dist":{"shasum":"6ec47db562fd48e785d2bceb89e17ccac4b6ba67","integrity":"sha512-jU9TfxdCT9yxewjnREZGOr7CWQHCAYdj8r296g/OkHzHjV5uuWGn4iryTnu1g27Q7l7KcE16ZCsK4HAhuKKSUA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.3e03cb27.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRC5XCRA9TVsSAnZWagAAlf0QAJkK9ncmBO25gRqbO6on\ndAydPbm2/3M/xEAvfz7vnZE/M9OConCN3RsI0Lh3NpWsG/B8DxyHBrJFdHcJ\nv7XvUk0+jU1PbihcuCpcsE5MdlRtcZEBcs4/n0S2xxkNHS0iMgMOf5u6TTQ4\nEVocsQkAJGr/jkFoeyIZypSPiYo61a0wX19jFVcfd4DCQM8sr1b2xxaqQDac\nqodjcf74dqQxf6oEPB43YUe6q1FEPf8sOhdmUvpU+F3td4xRTf0PoAMEN39A\nrQFMR91e1xGY9B9pnfiqk/PO75EBRlSYWj5PTQVK9B0KNW/M6RwVhP+7BKu+\nxl+kQVHCF1ncZ3CSURcInWlEx/7qojQg+9lwaWMNRo7vmePiZA+FSz8h9mr/\nY5abqM7zKv94jFr+Cmo7TCFkhDbCvAJqGv+P+TjULeqkxzOxZwC5iPdNJRNp\nlYqkF4yXPwaGpivBPywymaV9ebVE/CH5MY4kDcdfaY6EB3McIsS4GtT85OIr\nrJi78RY95QxL3Cn3ITXJo1+htZr1CsPtRv8hPUSuxUUSCW+2hchYi0SM6kRU\ngc9XPFJYDTL2B6ENihDd7ez55DrCHPSZdum8MGq6tZQl6LIC1ixZ+DT0b9NG\nvU3p83oi3Uu7MnuWAGI7zHSiMXAq08RNSTzWpD6rMNr+WkPm8Y/P4+0VZT6T\nnIr1\r\n=uIBC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID+H3A/VJKG4iWFnuQMqFBVbC387OI/Q/5/EbJwYYlQ/AiEA2zINoIleheKIUwx3PsWcxI+rE8+ywZ4ZrdTUHMvFo5c="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.3e03cb27_1547972183105_0.8169100746253111"},"_hasShrinkwrap":false},"0.16.0-alpha.8299d01a":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.8299d01a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.8299d01a","dist":{"shasum":"9e25e49de9b953e073b0f4a1427fa2565e5f41f7","integrity":"sha512-hPgLY6FG0N8/OL8nJPMnxqonoV9qDmpMfVkJI0EwQC70wGqa3ykc8GmGaIEnL4MBSQRDxg2JsSTJnnvDzmZaIA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.8299d01a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRDOaCRA9TVsSAnZWagAA2FcP/Ap2Si/e0qq8QU4Lre+q\ndDGDZPJDeLCWCSVAckRFa/AIIl/QLGcpmcxcmBWGmkLe/4CzrIvMkYzP/qcw\nHOMUupdPESfolfFtlB6tH5swsI78Kd9av3yiuTltGMtbnweGvlsF962j0It/\nb/nvcg2VcKWgcXazT+wpOINFAVsTYtn02rfBJCm6mhOa2UCP+49DV2dkuUIh\nV1LbuOawMjWb9QWH+683oSmPuYVjBBZUuS1uEMNhJAcu9BWURdA2lEzwhHI5\n2ETvP0sHBR0VE3jQGiA30C5EheVf8mG2ag8JDGGYrakiOZI7LFKva2d+YQA/\nC6cg7oM7Sl2Nl1H3rPMBBVk2hUd9vRK/5ir5VM3MnZBTmewmFjtER/Vk1qhw\n1xwdHjLT3RoEy/NlQSV+UxRK4QYso+lBpGrRkkAKBz8dWNslgbXsTsFKejLI\nxTBHkzMUEw1SLjVCfvvdudpjYscdysyhFTYVyiBPWPemabu9FZCrxwU/CdlO\noU5nKmtxRyEnBkFD83zkgXfbLbS6vBHid45hAk2ycPhFxUtptBUeq5c2ma2y\n6p19Mhqs/i1GxPzAqoCCKp8YBGCCH7nEdTFqHeKsKDUXkDNa0Ep1UWB0DTcf\nmaPHXW0+z51ZWon8zhwyUYYub5wsYcfUugIAqrYRvnJohJBBNKvISDXtAYS/\nofLi\r\n=bipS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGu47wlSSMuPwiXEpnJ112pp/wBgmnHITTzAARWmf1P2AiAqB2QuF5AJJKZ1XX07irNSntpV/8KCgZfdOrDDZHWbJA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.8299d01a_1547973529484_0.9086215565064457"},"_hasShrinkwrap":false},"0.16.0-alpha.6441cc2b":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.6441cc2b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.6441cc2b","dist":{"shasum":"d41ce9bf9e05906a876ce3da28132a73dce5f083","integrity":"sha512-vGuwlTo5PhMzaksZNsQO/ZS5FDJyjvTUKaEteE85UMzeIo/4HYzZCV+822ANn4TMz720LWAIGRBZ33n/O3oDqw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.6441cc2b.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRDPLCRA9TVsSAnZWagAAVvsP/0yzK+M88EZtG9UFXg/w\n+7JQaTXE+8Bi2RrU2EHTmYew3mG2YIVzxoZJpqBs0s6rqsQsox84RXJzWfqH\nWkzVubvAd223INSDZAS1u/uUQxq5mvFFJuWPzRY5NDklXfiWRmjpb8vv7KsH\nvMOo9txIHyXWd3A8N3J8XdorNm+qqMCCGPe2dz4hzqI4lopFrrSVOjf11st6\n8K+VM1U7Nxb8zdkNXH3RUc/scDKkB/v9j9fJGnLFQ/r0FVBRZdhq+sMG0qJ6\nHHJ/5ClSHMnxxEGduhRtAXVmLO0suipAEtnE5dUsbqKX2cLewTFXJ3mLMRVc\n+0WHAlBoTnrc5YUmIBxnEXd1vN/g9P3WfUglU3/+s6Wp59d0FgdQWtHWSQKi\n2dSC6jZ9/4z9aHPc+/0eWR9pRvQTSWWZF4wjKInKAp4ADmwpTxcLfG76CJ/7\n+k/uUEW/5QN8RW/p9b8Tpj8fR0x0L/u+ZPr8rJLPgBkrlIwBaIjLVj4ae/kf\ncQFq68DnooEdt7deZPekze8043csSbuRwZ5VY5THCDfaRmOMEh6PCS/9A9VQ\nKvfWHL5UygMnFxaMyZLulH6dm5xM0Y+k0cTxhUmdUUKUNWC7S2auF3Pl64Kx\nRu4XxnzNW3eTlJmYMvDOYKyahOTrcsP11wOecX3kqglArIBLj74v6AoyCIvX\nn1JB\r\n=R7WK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICiKlLbXPn8NpheddeRNhfEIktVu1wJ+Vwttpf9kMLYvAiEA5TAf+VqsdIUBHOpdfIjFXYh8ebnheUToHZxELy6QtXI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.6441cc2b_1547973579019_0.25350001374075104"},"_hasShrinkwrap":false},"0.16.0-alpha.893d6be4":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.893d6be4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.893d6be4","dist":{"shasum":"3d8ae8b1bd09d5247732b2b639418b3637bcfb1c","integrity":"sha512-+k8vK3AKT18JubEidWJCpvi+0WRqfkiDerZQ9X12Ovd1A80Awl2FAozkGzjvjbm8D7ReAA3TXz89LtCk7uB6LA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.893d6be4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRDeDCRA9TVsSAnZWagAA4CcQAI+cMAHTy+vvJslfvBTE\nURwcm4U+Mj0aeCl2xlc9ukhf1GExaWghdTMvgxtSvZ7nWISMAOSIYpuaoR+5\nZwCLIqRMCZjoZ3KCi/Lz5lEmxyq8gl+kOk3lRYZ6pNQrR2SryD+tq0fGsWQW\nMG9jS6CAGeS5KCGE/M72cswjDk/AklGI5ib0/fLqfGZUiMVCb7H5jJUA44bc\nXLSocgkr6L0K5aEbHj1KBINU3re0RD210w6a1UeJQQwut4mzTIGBoId8Pw2C\n5Tn6dlrq0pB8zibh0IvfNuSL4H01QGuBMcYGumcRoHaDp0L4fZano+qiTmSz\nNYRrJyqC4YB23Iu6ajcVJ2Fe/Gq2GeTUazgEADAXNklXNWXiX7xDm0DsDTL9\nZXxlwMektnp9vpWGBZkNR7bGUVi+CBFLNi4eI9cVIdxDuyzWNYEJV+cNrhaN\nmFxEUbmfOCL6AZXjbmByixmfhsMp3ydjNJdtMYgBbE1W7SHfAHHxQKbHQorF\nmznS6G8DCriYyOdXqbffuIypDFD813fwwJc9m7NYNrmVKtYkMBLWgRxhgK1B\nTIdHEr2iqzgfflp5WRQOfj7YOq7GF8nIG4FhSQ11gC2d92BUY3Y55gimPgVB\n4iVjudPyreZpvgvOyYQbau5JOOFHwTNM6O22X1kW9xJL6BAp91aPYjFwdc3X\nqsoR\r\n=kw+B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH5iB0DSQSdKSoyG/MgpDb/gDQvjINQMDWMi+oTjpB2SAiEAnaTQxIV3cCzKu8SSJHDGHpnI0TkuEotV9Cb5zwR1NLY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.893d6be4_1547974530773_0.19494699449465758"},"_hasShrinkwrap":false},"0.16.0-alpha.f045ab52":{"name":"codegen-templates-scripts","version":"0.16.0-alpha.f045ab52","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0-alpha.f045ab52","dist":{"shasum":"73c8e4e873ddb9b6ab6c470390ec1ce1d31254a3","integrity":"sha512-Kc5wgH9slyARsCX/N/7f12V1Xpdvv6hNgtSmA5vuy1b0ikNinftq521DH8McoYsWvDNsBNJoToWDHinLyIr/Mw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0-alpha.f045ab52.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcREUvCRA9TVsSAnZWagAA8NcP/j/0M4c9fk4mJ5E2dCx+\nhen06NPj85HvP1g0SBbn5DwnkKQDQnGmprjIyJHQJ59cn2XDt5sU6ZIrbuKd\nowehUztaBJ8gX8RaXEUJwpkuPFGS2Q8JYGWZuDJKQL+rXUZ+8g8pndpjbH56\nqkX3vw+USmVjnJ0pKmvmIgIbTzQDjKgV9/qAYn+rur3NEDVnp8AMUGDVFaoW\nFDxzdkpm7AZZqyHnu/GZ2z35a2/ohQNWH5LndIz8BsjPA3k41vQBmZVoxu9O\nhBZuJgDxf/OeSaBtmZjUS4Uy6VoNXwVsUJ508fvOgQEje6ZSfnKB1JdvHhRm\ntlFiFWzeS07yCQMVcH1fDoCJT1ro4Tc2m+Nf9lmzDra/1ngZVnXtVSwhGye4\nURSW5gKlbCZ9+SnLyp32kUMUqwLqyQby1jgjNenB1wsRxpkaS0fg88m9dk2/\ny1pPfOj8C24btbeAEvRZObasXtl6cvwAy/BI7UrCc8IGpxhLGUC4inugfmVw\nya0nSuGhK6lTnmf8yNPLtjP/DlcIEXnqYF+ZDEzAgMG6qsfwSLiOvvR0LYpd\nCPzZXKgDy8evgCVobLBVaP3UFe+OxoUb2iqM1UNtCjhGCpQUoEefsrGYlM1H\nTa4eyu+es4WLIoCSKwGOePKef4Cic2Xfr/WE7OZaY1wjAHMPoI7ZrTHEu23h\nhbpZ\r\n=FLE4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGyyfDtoBAA/XYaP/EpnAn/ZlYAfzBGPAHPhGpRm/07KAiEAg7zFDMhK+20R/ZvycUYHPMe5qbmuVni8I5uFOA4K5/o="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0-alpha.f045ab52_1547978030596_0.9497285446794856"},"_hasShrinkwrap":false},"0.16.0":{"name":"codegen-templates-scripts","version":"0.16.0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.0","dist":{"shasum":"c784bad4ed326752ee51923ab59dc18ba2279efb","integrity":"sha512-IiHIW5q9WHE0HsXyjpipX+O5CX2w6YKfmoaZB8nPx4HHr09+F6pQWRdBMEnBghRaGxKIgj3tUMThMoxT6iDATw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.0.tgz","fileCount":22,"unpackedSize":16711,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcREnACRA9TVsSAnZWagAAx1YP/3qPJs7MjCilJD3uGKFT\nM4aVJvVJa6cbLjbJQrg8zbTgdLJFMW9pW4Dwkn18ry33QcxVimmxEdrpqyTJ\neWvRjFNUFnlmzabQQjpTJzo8SVy4k0YBrzvZGx0kUyXKkVGKgc5TFJ4o94Wk\nXXx/C6aiSi7/AZIropkyiRqNyO3HyhpLfI+tFWFRb4+QDE2OBwaGVBq6V/YV\nHhZQjWDVqgHHEMoAPzns+Yx/adNYz/OtAp4XxS2/f58i+0+R128l3CQF48Kg\nADvFwg4ZAgIDzlZqOuS+yg4stBRM0KZPkjqhkKkCc58+zQC/OYW3KXpNcBrK\n63XiAOO+uHy7KWas73vctKMUx9cElfZxSCpG/cGjTPOU4qaKHaRbP4jfSBVJ\nZ5jfffB3vEckb03zc+KKFYSaGLfDWE0CeSM6iXvB3SZNNnkoFyrb3I+K89nX\nkuTNK0FjCEnAclj4Q2m+0UZdFfFL+GZmvwOWVSTghF55l+A1hlk63Gg3XjRk\nZtR1tSjl0cEUr6fOb9yceCk78nufim3+ryAXe7amqc29joRyEYE0dKxQr092\nYK/qejmNgiMd7+oeRtg4Ic/j3ZUsTlUdd7k4YqHPeptGQqHR71AAxeRF9DBz\n/8b+IDzDQn0ncUbHpw0/APiQzV93Z+CAfeMqp0F29A9tk97ko8XggH0jpTFJ\n+qff\r\n=A3UH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDIfMb/CzjOHlIO9B1xR5bpV0PIRYbhe4UF8mdlFSnqZAiEAgsh6mLyemDbjtwlHDCWIO1qDCnfzRLYhlEmC7cSF1CY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.0_1547979200240_0.07373154104025992"},"_hasShrinkwrap":false},"0.17.0-alpha.325baef0":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.325baef0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.325baef0","dist":{"shasum":"c0b0177a99ae84291d5b0c8f453931624dfee1db","integrity":"sha512-p4fNpcjD9+O0wXZW1YrzS6fUya187wOUDBuuN0IWC3BvUQhWT0/C8kocgh8jKsVztXwvQrWMHySe2ZxZZL76Xw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.325baef0.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRErMCRA9TVsSAnZWagAAwdYP/i4KaIYSY2iL5RHqm7uh\neqtA0rOCH7TwhtpaIZ19n1ix4yjrbq0+5WWPMhl6Wo6nNdCEUNGr48T+cvCp\nw2fYICtnLhzqI17GdntKk3+kpEXSDmBAXB0KUZrl+HH26iZtvtXvh7+3Ls/M\nnvF208GfP23qtdqklfOCdlsu+EwPic1BGHdudUvwc82nya+0Uvc+uzROf5Jj\nRIBgMrOUE2elwwpNhydNNhjIs72yYfnJyO+bWLV8NOWqFo/5HCadpMPnI44l\n8QoFLfmz0bszMDt3Lie+PenQQhj2+hqgJYWaEKAPNpt7yAekUyxJphanW83g\nrWh0BC+vOEil0ra4hl6g0K0ati8V8gdOWsEQshgRu00dFgjnBibYAju3Jl5O\nRoTVVkAccPrkaHG2TksP0qWYI05VezSnMbLRXoJTX+P/C4KftT9J1dRHOiPG\n2c3YzFXRXAQuIQcn3Vdzs9s0w+86uLfUayQPYkW+dz6gneJYXir/lLkPoIqX\nFly4kgBba/shzoqxAqG4MHHaUTB77gV3hw91Kah1tfQvWt96jz4YOuN0kSbz\nYPq0+gwSFP6noDSeNE1wMk7JOXUcxB9lh9+Jnmr7l0uYWIos6heGNI6rNWwa\nSYux0IFGzchL1HoM0Ft9+8beiz8F5OewMTcgV8XtzSf6twi677zv0Wloeg1K\nyPLT\r\n=uaKD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQCJnW0oLYIjUFQWyEd0+ylJWmclwnDZyKz12dxTGc8QIhAOzmRxZrJHT8TjwfWu+2sami1tONI3AOISBKOP425KIN"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.325baef0_1547979467538_0.13326106652445713"},"_hasShrinkwrap":false},"0.17.0-alpha.c9b91b10":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.c9b91b10","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.c9b91b10","dist":{"shasum":"df6d7dcb46202520c6884ae63e65c5e22e250c1f","integrity":"sha512-kjsGuGrEpkbOEZi58WPiGP9oYHhVYb7b28dt3lqusnCeckqPW4eko0qCNKAQZ/Zm03bgSJEGSGAy/tFPd1LE3g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.c9b91b10.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcREraCRA9TVsSAnZWagAADXgQAJXAQh7goGYgTPCRR8z/\nJJTk/c33yEbA5YnJF3H2FYKQy+DAjXCReqI1NJbUpiXvSev5zsQw+5QnouHR\nyuHnh7Q9LBcNoNSf1AeSGtCF2Ngh1hZlPD8/ZagwYtf3AzXl5SHeb5PHyeAV\nzMWBs+myCjYLwc4pjDv+asTNJHmuwcBOh6GcYPv8HP0LegVs4EvwLGBlTYX6\nH3ddadCXc+VVN0fMcjg3MOXEecaQYx2SG8fyfgKvkGXCbbkwTunHIrP7WyoP\nnKE0oxNFhpehfFYcXYYPhOVbz7VrwynbqnXvglt4x9j9WTvZR4chsRLA0pxr\niDXPOxZJ5ZjQFvWQcuKcWtQaL1oFfkpoWr6hGVJQ76pBrBlYlACBgxrMzsmn\nozoCewIAY/peYGCPLFv0/qDU6T6tW6SIsrzBgcwfJqrOZXWfALkg7+B7jeAu\nD6f3Na7OK/Yo1bgFiFJJ68FGwg+DU/Lg4/Wgtp+alunu4wcWxIt3cTpVEXV6\nhaMhFd+uAtv2EB5jZXV8siVoEIedipJ9WqDIBAOgJjRyVwi7UOmq2XmD4WZi\nIl54ztci+eWVztuAet6S9rj4Ub3H5brCMaXdpszLOoBAGoMHCOfNC5CkQgtD\naeNQc8TJa0IyAiraE+Cy2/nE9wy4q/wjrO0HE4X0KPoO5hwVj1QJFFInrIhd\nwe/O\r\n=dNSb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG2zWu/ETCLozj789tk9yNRWATt5eQpUE0amdF9Cm4eiAiAbTi8OfbqrWbXK32tFM3Vwnfn/KYWIdhDLIa3nhRq04A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.c9b91b10_1547979482169_0.4020230718367348"},"_hasShrinkwrap":false},"0.17.0-alpha.a290eda2":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.a290eda2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.a290eda2","dist":{"shasum":"62a56823a1c102bbecbfc1a424fe569b4197670d","integrity":"sha512-RN8F33e+3V+nvuY6yOfjqrUcHH+ySytgt49Pfx3CyIyu69vZ2bawxwmssjk30k14LhmckxMJqytri7u+nOKvuQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.a290eda2.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcREroCRA9TVsSAnZWagAAtZAQAJqQqXZy0gM1hq2Ex11V\nlib3HLFgwTnZ/1kg/d0MprFAjbEO/ti4/mdSnn+1rmtSd1SANloT8+D4ZuiN\noYgBRVf8Bm6LI2Jq+WL7XsA4ahOe+0yEstszrYbPzpmq0IlEgT9ytJC5TZBm\n0gqlm3VwdSmr3+TTROx64IqhjwQz0w4hmiGPkpbZmUk5b5N4FUontUZYmBPV\nEcw7IMaz5XkFVRiNxMXR3YbKyqlakDUM4aJ6Cn165qhdD2owVXJey8lM4bwC\nijG94tGKhXnP7Ugniu3nRyPboPNxm8wP3FJ9EfNgLFx28jtmoELSPSg1/ziU\n93+fv7eNSCVqRUG8L2uBKAqRuzBbn74eNglEOTitTl+YpuZDuf0UU+J2cpGV\n3tA83C3dO1ok+t2fPEGJe5mLexKuG4aqZgFSSisrorWJT2H6aK2eCtgMKpXj\n0sZ14pcrfOw23tTdIu+bJVhCwJNO2Kx8J1Fw/wyT+rUJwcr4t02KszABjMhD\naiwkELkSctUzGKjl8nLw26XvQMqqhUokdOeJ/81NeGyX+sAfWDfgx0QAXe9L\nlwrMPkl9U0hGzZgETns4FXMB6ryHcE01bItOSycP3J3/tDUGGDR+JFG4WGBP\nbmvv6HbL92lIn/FYcVorWA4TmpHFClpVBm1fNiEGCgY2Xa+aSNwKhRv8dO5E\nn5ie\r\n=3D0v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBU5Kn1qXN5mXVsp9pMGHttTpCfjEh81GfSUVIphFHjOAiAsJhsVELkd+lPBQR8Et2Amv0KB+ZgqpETEepNUAK4QDg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.a290eda2_1547979495649_0.9959562050674793"},"_hasShrinkwrap":false},"0.17.0-alpha.2fdb8985":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.2fdb8985","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.2fdb8985","dist":{"shasum":"56be76f4e7fe34bcc7008459d9f3e4281d339724","integrity":"sha512-y2lA2pPRlfglLCwQ7RyZEQXGdMeSzzrEgVymBlNWPLZnBpAtcuoGysk+Hr3SdnOFaQIdbNnzeNrLtNtJb/m1Yw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.2fdb8985.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcREsbCRA9TVsSAnZWagAA5SgP/08/paZb4BcIyaTu9D2h\nvKx3Lgz3dttWe+0qXRD/D9g8OvtqUrhnBYldOTGB6qPk0wyGMReAPXDioSZd\npyB2+4rrGo6yKZmd3tCiG4UmwnyvUe9iyGSVz6jxRqXxdEm9CwNbnxVhKzfd\ncNsNfz/2Go66saFNgXK1suypidCUY518jL2QsMYB90Hs7XRt09mIqpWShZ6f\nv3T8/DFyPqdu7qNjd33qxg9q0v0zGdxIZa8iTkmug+vUKzzoyfrwSOyGFWAM\nmT3wE1r/zgRJZ8XvfxWG5FR49+8pLsSl301TBAHMYF6ATLYjweEZ5ONCx7dY\nw3PYFThi3RyP8TDV6c0q3kJR/bjRm1HwJYaz4+JUGr1ufM6Jlx35Sur0yZrD\njQBv9RJNZd3/RRR4SPZHoJYB5e9aX9AH5OVKkhteSjj8haxUHWxuuMCNKY29\nLAPI70C35ukGwyek5M2JcCmn1bo14OMDH5rGPXvDSMwZ94vYQyP5bIX3Mf6Z\nxc+xfP6Aq0IuMOYfUf++92dDXMrCYKP9H2x2/tlCxNpYUuLbmOLIXGLXysMH\nbB4iGOcxjEf8sgWLG1cwOwlSCKm+wJxPNsMBW2cAT7alDOKLDA917lDPjyBD\nK7VzSSX/Ee71lMiQfnvKq97gsmXCQ8pl6X0ydnbDtXlAhEEoHyUYiGbnM909\nehy2\r\n=ajDz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpIL5JS4LWyQT0MENR68mBsf5QF4YwzlGRgiOGVf80AwIhAIHlf/mkyPJs466aAm9FC0pE7LllwSmKdADCY6pp0vcb"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.2fdb8985_1547979546820_0.4973089615470263"},"_hasShrinkwrap":false},"0.17.0-alpha.03a8db14":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.03a8db14","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.03a8db14","dist":{"shasum":"c215b0dd2323f6bd19de899eef920d1ceeab512c","integrity":"sha512-cC0cXAgDW+6pvohRTsQ0HMNxmZYr4bUDHSwLCFX5i0dAFuL65mNZnH5uGWvMW0SHI+3kWfA1ZuVAoDnGh53RbA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.03a8db14.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcREvaCRA9TVsSAnZWagAAarIQAJ3gT+1tnD0KRY54B4Kc\nHXAATTP41FWTS3jrRNB5//nzFqLYSRDlcTlh9cPK23ITVOQgK+IeQ1Yb3PdH\nWiGj4gvOubBNYq27OeuYH2k7gWrVztbItj1Ed1raoYU/DB5T2F9QLuo+6wel\n5l03J3x9Y5mqdSvPdysRMBzjeKUKGo3khfbixEHSnjrV5tBsTSouTPOH1zbF\nkfy1wH/96xZhyBQkdHXljNp4XMGx0Ns2ldqJDGJ483NAJCTRxIcz2q6Zjsb+\nK3FvvbuXk53EtF//zw+qo5ha4Lgw8mPc6MqpSqqbwZ+ZxmUJz68xFpXsv+U6\nW8EVtxkMelmNDbvN1zSVtN3EjgmoMqORcrm/+u8/Tw82Y372Q4pshFZSUDrA\nYj27T2QM2H0L6O5x0XlEPjbkq6mdbWoX5lLXdOBG/KtGxA/3/QrimtOadVG4\nRCmcEl4Ycb8gpog7UzhORzBUUfbeoPtRfF4Ce9NQf8l6+FifP3mx6aBcGv/+\n7fG94pKm5Oc3GflnHwMimdfRt7zErhulNjTfjDB1z2HN8w/dQ4C13Qxn7Ewx\nhNOV/+XWH9dJGsBlYmmruVJ3PHIrPDSI06+AswPZV2iwVOJ2MydknUrxKpki\nyVOSH4CbHF36w9LvoD6CP0SdumWZ9vHjDTkL/2qlYyqD6ik3w0d+WuwNZ1SF\nMcD/\r\n=/a5b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB3DYJJewfVJOgquAXO1NNycwZcIsOtKFy5ndrWRmfB8AiB7Ay9OwE8nXNvIFA7QnYpO796LGjuZLQ4+0KrRDxLlvg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.03a8db14_1547979738267_0.306066135351279"},"_hasShrinkwrap":false},"0.17.0-alpha.ad45c54c":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.ad45c54c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.ad45c54c","dist":{"shasum":"f9b14793b714bcbc857cc3341033adf4accff27b","integrity":"sha512-T5V6Wr9SaCdNuQ6QUr41z1/iqBDhQiF/XNIRFl2zYO24MbyXCP6SgVY/G8fNCpG1YFFiT8r7cBZ9nufGh/vOBQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.ad45c54c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRFjDCRA9TVsSAnZWagAA3JkP/1eUuthf7Z753CtHdPv+\nOr2i6ANIGd59v+iKJpIaqeaOOd+MoDfrx+/vZT2ffJoE5s4NkxJ/EEgQOiej\n329PgS/Mi81oZJaz3NaIweGyfcu9Wlsg+32b5Fzn4RJNsTPmKr4Vz5zXjK+G\nGRaiiPWPvzG16Zj57ZLfkB82jbcGjOZ7pcaDPU0eRsShdCC0WkMpxhTb0hHG\nhNUW2CXJ8P53WWEniPu4Yp2v1uRxouok5E6IMdlj/KW/Lo3kG6rkeaDIdzEG\n3hann/3rTu+mD5sofYx+jdGsnmb33RpgAcBueOvSi2htuZwVPiZoZN0KwuS6\ng5dfJe+B1NnzM/lPze2VuaFp5d1VqIjhwcWIvxk7I8syDyuuCuIckPcseYhU\nb31eMc57J2ENOHlAt3sxmRxjc+zl5ruqftFEU5g0hZjuY32pfjJMsjw8Me6I\nMAahgNkcgFf4UkQOKdXI2j0xvBd3q8mVkItqQU6mVJvQYSUmvH4ht2ERaaio\nPmil8tRsCKJloO0i7brXBWjzqx1+B6EVzcVuDkN3oqR97sCLBvCTMsfhjuNM\nQA6lVFJrkleM08cGW2oGS+RLM4xi+N2jPBLQ6rbHS9Zej7nR1RvFl/0qAuCh\nhOFSA5y7RvG9PRxe2L3khhXT3oXhKM6irm8RsNsvA/KfwvMbKB/GfNf4ebS2\n8PQJ\r\n=2JMo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDK41WgHPTnuolsoc4OV95k0WdwXE3IOfPaXFzjcQ2sHAiEA/WxA7J5EDIq2L0Ec8+sRDYaj+uv3nHGEGN1bBrsvppc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.ad45c54c_1547983042438_0.15791726763569414"},"_hasShrinkwrap":false},"0.17.0-alpha.546c781e":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.546c781e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.546c781e","dist":{"shasum":"2cf5977ab114632c1a12bce15c7a808feb1b344a","integrity":"sha512-DMrQcdZ/WryD8IGTGzM7ylOzeIHsN14TmGK/U3EFZ87reOujvJy54EOaHZHC5NWy2HaDDdNmvsthVBeY+AjRqQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.546c781e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRFjPCRA9TVsSAnZWagAAcGwP/0xG8ewAdCwM8Rs9iUIU\nno6ELVhrl1u6eW8QVQWK6pGQSj2a86wRCmYSx2LnY328oumra6c1qTgcm77f\nIOOubYP3xVPR+FVKHWBdWvgIs6+kTvnKPlnncuh1XhT552N7twpXM2iz4SSr\nQgBEkR6XLHj08w2Sw9DlZ6Hmj8zOGaKGc3FQ5SQX7DpzPHvg7EfrsrGPeV7n\n9PWxF4e2NUoapg8xekp/Zwo7XUciu94bo6tXZypviAu1bpuSp8yhVcXMRc9x\n6huMr8Ox7jWeHr1rqE3RVO2lvvcEIzW9zjiH+rAPz5qeLiR6O/03mMFVlZ7R\nVQxkpKw34SkdeZ9n7BS6/6UIvEkMtHth2iqqWT9pahRog5dpOzybtaOONmTl\neNYrDIuU/0rqTRX2X67IoAXgM7oSUsdEArLtHPzvZLabm4RSdfFh7DuDaDxa\ncbQXNfNw4S48DCB1trsLXizCzWpp8g+OE8prhwurKFSNmAhG4G6MuQAOZKk5\niDXc8MCpXR9OgCGQjDCxZGb/B9WCnNMA8p735ER8jGDW1IMAOVveaZZtyp0+\nUO2YaID3OFaLy2Os8DTEdfz7WKzb+1Sv6pAsTqgoDVtr9GLY15Tqr9+frpgp\nS7jaWXcBOZb8rXil4AVfG4txSGLWJeaZfLcJTeqWtrSgrogvtMcawf2AmEmk\nxilO\r\n=6Nmc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD65dmLaLporqh8VkJRecZZdv6L8tCIiJWb8k/AGM7RHgIgOvgfTnjySuAvXZETojBERh4I/WvcoQcj/ZnwEFgstvQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.546c781e_1547983055183_0.36516454674847276"},"_hasShrinkwrap":false},"0.17.0-alpha.498958e7":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.498958e7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.28.4","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.498958e7","dist":{"shasum":"b25c112bde2a3a45d806ba2ba25c08de976990a9","integrity":"sha512-uxgpWntuwtMuBYU/XoLBL8Caj9sXemx32dSOocygL7KN79qaT6KxiNvMHzP1p0rEDOE1VE9uDv6o4RskbCXuOA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.498958e7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRFooCRA9TVsSAnZWagAA+3sP/1a93M6hE9Y9Op3dI39T\nbTtXCuBDQpHl7d44Mtdus0VQL1uC5zVzmFLVxW+zKKWohIQ2qj7HlWVjbavF\nzYRB/Kyl/e/PIkTliiOONDlIAJt7jCG0TFke9ErCFs/ng+kRA/5Lbhk7wIpw\n1FhmZjxT7uzW1jOHu/Dtc8ZUXlxleV4EK29PXLKJjBlQh9akCloIGxQWPiC/\n17II5OB/9ASh6j9NBwuQeYEtbor8MUp3BFJbrH9C7VPgmh5DR+1a3yjdwLYO\nW9rvzVvJDG6bn2weIpD9bjhzEDUX7txJPCA2sEZgQ3yJwb4Y4+7NcPGmiReN\nZT/duMjt6ZBaWoYxPbNWVG3y+ocV+LlSGiVHMiEaq/iukE5tKJolAP4dBTr2\nOFhxQGSVi2Q1FkDcxMj8tha/CvhCRnsdhMnKTWHd547i/+RnLxP7cpDGLuZT\nSs5VuwkgibU7a1w6u+deu4Qcgsn8IieDZ6l5jvsQZ+L+sXZRpjPPV/eRzHF0\nqtcGs4QCwfisvehrKauJVTwUwug6bhhnkdVaVebQv4RlyWJx5igwgDS67+K9\ncI1TC8Di4iRdeiWmePNh1X9b9Cr+n6uPriQfCC3gZIeyBlE8Yr9ZfA3z+tkW\nE6f6BkBnuNmPHb4FVhToJV1p9fg9fWwBVM12srNvhfodCqBMNmN4WoEScA7j\nAOaw\r\n=ZR4J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQf0rQReKl3GELWhHsawALN0AeJNcWVHyf0wd1WkoDwQIgIxflnwqjszf0MwGc4OChzx8h5PZAB2Sei3CZmkyCSM4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.498958e7_1547983400156_0.541376439461462"},"_hasShrinkwrap":false},"0.17.0-alpha.e0c1b279":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.e0c1b279","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.e0c1b279","dist":{"shasum":"7f4eb39096001e73c1f9869ef75a58dffb0f929e","integrity":"sha512-kqU72zymnDfmTld+y33s/VAlWGb0beu19aSELvyJlaZWlsWYacHEIOaFGur8WCdxD09UASBlBgRF6ZQ58Ur+nw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.e0c1b279.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRLVuCRA9TVsSAnZWagAArlEQAKALzXHbZYKEYeivt87E\nRvwKNMKp3qOJUHy5SaWZj0PodG81XUJ6jKNsjJBlxXZi8ixXeWcfCxEdvrK2\nFVGhR5SqSdTtKDfPFuGmAIKAiRpCLzMhJdcIjAU0jUdX9+jG7a1mvz5uqgPH\nmmUGgqo0QObhu16drRpqWR50VVY0C9HvB6NtHb1zMcQ2IWPOMO/GySU3QB3f\ni/qQRWyqo2fqksgU3RdSc3pLpTDF3Nwyt/Pc1zy0hLEGAa5jGzQ9tTP/rlRw\ntTj3MgzavggDigs+wW6tHb8Gc/vgffWUzNSadVs7Fvd06p78VGsv5sM1nuM9\nAwgkSaqYu6oUyXvkGt2/5adPF5/ybkWnjy6Xze+v7CNJpZzSMVAYm99uE0aL\nk3VRcE1kdru+Mlz+9L0eOIoh7gocz7HwdPRS+1eJRx+5Mf46LKCAHGFoMSZ5\nhlsoJT8/gR2x7Tih3HEkJU0Sg1QW6VSC946je3MGxX0da5hGmUQNEPCQw3G8\nnjj4tm1qbq2FCO8xxegUWHa6TEyw1QcmhIJ/UydRRtz3v2hZ0Of2uTtcRFlt\nIY6rw+UbE36om3qogeMb7i8QRChjZL9qwJvafYunHM8x/w0bE1nCqLJw6QRi\nSlWLwR59w+KgKtXsASfPKvAviR7D8J63K+i6XVFgh09j66K7odQe3yF/7AQq\nkV9w\r\n=8bJz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDZN9Ht9XFSzxM6fUc8TVKtXzCrBtAS8PfpNcD2jBG/wIhAMg1+UsYUf2FiG8rMzSv0e1IbtY26FH1tHcQXGBicon+"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.e0c1b279_1548006766298_0.7842374971404675"},"_hasShrinkwrap":false},"0.17.0-alpha.aa7b2b06":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.aa7b2b06","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.aa7b2b06","dist":{"shasum":"216118692d336be346edfbfa62619038b1215b7e","integrity":"sha512-A1N7+X3UUuBQ51ozueGc5m8xbwvLG2VuHz+3zmMe1fR0Fe7DVKws6ZC+z537u9vGf5BTGaKO6EQHsaUi1qInuQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.aa7b2b06.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRMeDCRA9TVsSAnZWagAA6FMP/jr6a5h6fzFLt65GEgWy\nDSK6cbokcn5V8Gpkku94nCYiJbqtPAlaO5RDtu9wIGR9nmsvUnzAtpn9mXKU\n0u4DgS+75HLBtsPm3hRbOyN9BNBF1sOhyDKAa/6c4nfowCxSeWPNbS6hjii5\n7SeTl/PQXxsWzjhaHyNAChxfXA01hmuqxDXKHnsjZLuNH3BC0G4l6D3S2n7c\nQmepHcbeJ+FBRZPwVEwP7UXXrC4teVqnuPyvDOY6atCB+JuJaEB3EBGJr+ON\nYwWQIgAzNR+JTu8nrkSud+y+/siV6uqgtip1Khvq5Ocw3FaQoawFHi4EeDUE\nG+k1cuezsuNm0902ndLXU0cHkBvL5yMt8erjeLZyJ/w1upa7kahb9Qk6zzbo\nT8K5MPpBV73yYrL6WeycOw1cXYliUwGvLo+D1F3pFvALfXC3eIIprCXh0BGz\ncnFU2qL9WjpqcuuW0i9RGlXfmHnNtjaoU5TRcR2/eY1YT1m5J+3H20LjST9a\noRZFMRWHX59qkiClkP5oYf1pMqOb0Ws9D+RlRApVW+BJ/P+3tpRXVAUA7WKA\n/988U1Pz5kIye6dfAoS87RhZM/0uGIheMHYrSyUEqT8XbCu4oFVG3fAqUmJU\n6+0lV682LARa4ZlLIkrOTnBs2q6NpJvBgBiplF+VCVq5biIFC0k7DUuW427n\nhMwt\r\n=SsWY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6LmKaIH0pJKnZull6VR+d6KC4mY85kQI22XEvdqTUqgIgIPpCP7d5m36MFxz6Ro5SqSbPGPGC79Wzyqx4kBCv9m8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.aa7b2b06_1548011394402_0.23007470107921657"},"_hasShrinkwrap":false},"0.17.0-alpha.89d7da37":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.89d7da37","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.89d7da37","dist":{"shasum":"0eff6267119ed43f5811880d5a1fd5a3960c39db","integrity":"sha512-ZPPzN4HVBpp4UaHeQVTnKlXFYENiWtfX5o2HErPN3kiCLZeHhEibzCSGDNUF9xQD6IpptThrVeBCVfYWxIoE7g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.89d7da37.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRMejCRA9TVsSAnZWagAAbdoP/iJE+4PHVDRAny9j/OAd\n+6B8kAXmlPSYANSQ9m6uw2u71Cnx4ygWPtvjQ7qa5ebRk7rH86qu+021Bh7g\n84zs+WAtPM57C7fEr78VpSasezAc8UWdjEOjoZgQsxD2UwYsujxeijH3DOSg\n5wYUCOEQLzRg9s+TwZcePRD8QhtGNEzztK1zBqcD57dD0es+w8aP++kTt9A7\nY4GScT1ya2Ho7FbBFLpftTIJxe2ugUNXjIHxEJbUcu8Iu0c8fmgKyUvJ1yvb\njRN3L7w1wP6tktxaKSDvI/Hr8Z1x2YrNBujQHyS5hAghTrikXPWjL/lNvoCZ\nfL55a2eh8n1VGgFvbvbiv8J30wryc+iE9v1bgT7RZoFq07szpGBAT3pCT+Ph\nWaNjkEK53+GeSJ6ztEgpAIAZOzi/9aIeM9muxQ2LjHNR2gdT8169KSpAayOv\n+iJI+C9pvqsLV7e8ykwT0zAJidHBflPwksYDGpLq+0YzMaGCbvAI4mqoeAWJ\nWowctVNSVAfuV/JV22g5pYHJW2VpGlRkEIkyA4ZwonVqQrdr+XhG0NxEDZA2\nVVkPtuFuvs23+WvYtxRoXW0Xhc6N1fpbaY1n4KyXPFDX6bqOQO1FGM3PYwQI\ncPrw880AEpcv09zNl4EYrMkYnbyJ7SyALEEymgXZHeAHyeDnvUwyKLKZmwVE\nz1on\r\n=MjPf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9OsG8GelsdR/PiBXpgvKzf8Oy+SiNwPKuFMmBH5lZJwIhAMqodTBR23ynCZrDC2G7mD0E8T22SF+P9ShRiJBmQrNr"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.89d7da37_1548011426790_0.39976294167011717"},"_hasShrinkwrap":false},"0.17.0-alpha.20739eb4":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.20739eb4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.20739eb4","dist":{"shasum":"41bf32fd92f74d49c0aeb457cc80c3c72ba2946f","integrity":"sha512-ARs2JSScrzA2wkfI+t4jyRtsfHr3IaRRIHgJS5w/I1umpFS8xZlK39nETPe4+89UyhHYe2KC2mFKNqwAzuoCNA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.20739eb4.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRW3XCRA9TVsSAnZWagAAcBgP/2zULKN2/zbSqu7/A0lu\nN7wR1Rnbdzave2haguI5U/eZAjJKfiHFa4Yu0j4Caqfw15k2dxHnD9LhuFqW\nanGpwt7yA9MZGk3WTandRAgQOBaTRj4VH8MfvOsXXM4zzqhSJRYAzU3lIsI2\nqIx73av+tTqimPmoTWeQczt9Xwro7SICbauVJRECGi1zqhXW++Fw6sUejgTo\nCXOqjzj59s4IhWQxWffonqeBX/268f/0c5qp2MT8Vp/iZasfM3bV0i5sqvwH\nSad7I0g269wUPnXGKHZaH8U26TrnwCyQY2R0Ngnu3yvg27HRxf5Cq2bsyqk+\nZC8bSkWVBRj8hlSzGFjxk8fTKRSeCsxMtrfzbzZxMTxbkmJsTr/+BSV/AtrP\n3+gZlIDixEfl6xFMvPEKg360FjSlqXVb2hYPSX6/kblJ08MnsXz2XM5Vw740\n/ZtmTa/GPJ1AjmO8ZFtTsjqv5uANTN3FzuzQPaKrHMk27NBapFCa6ZgrzfMN\nfnY5TSe76GMeBsD++cIAylMndTDYIjPNy3Q0dRDmSGmFawaiv9gaUnkEMd+g\nzYpBgGbJ5tj4xXmMgvINsen05qtNiTmsEBt5JpUs8XqgrRtUBxaEJLlRORHZ\n8NLjTbgIfxviSorZkpn6Yf1oo4zEavf8sknpmtr8dWBGg4g1V9Vw4EAlqnfS\nkPOA\r\n=swSq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYZJNFYk/aYjxyHVUTn3SYajve8xFzad/qCHaHcGnkZAIgHfZzHw9jBr/U+3CI6tu2hK/g0taS5PR8ZVUC5mpMfCk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.20739eb4_1548053974860_0.341749282728097"},"_hasShrinkwrap":false},"0.17.0-alpha.f686ddcc":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.f686ddcc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.f686ddcc","dist":{"shasum":"52b885140c5af719bbea544974f66a458a6a868c","integrity":"sha512-t8e/ssgJAcpG2HI3zB++pMa4Q1Vrcm1YnCXt/DwgdiaxCTRoLhu8bBa8DEtkSTRP18feD5PmuNnuOxnp0Sqktg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.f686ddcc.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRW3nCRA9TVsSAnZWagAArgMP/3RjmwEFOqprVQH4PmQ/\nL5yx9RviprWJJO2KwgnutjSk/WoZ8ZmgSkYAoIq4sfSZsY8qsqt3hlccEBLL\nPIPeGeq0MQ6hz2cV0JWhj3T8crfeYJ2FRkkDT/OuS0IrntnOOh23jTIpz73P\n/JjNIVH+lllILNdBvA7dCm5KzyGM10oMFp420pajT3OdHw6+q8rUHtAhxOzx\nFoFVFFrWJh5bRw+r8JZTV0hjp1uZv6oFs1pm/dcBbbFMVJPs5TzX1oAXAhWB\n0jljdri1MJafeIgkhYG71NoWjhfhavoKf4gozAITwszKFc9rfSaAN/55CLnl\n0ELE5nnBeJ1svAF9G5e/sv6dMP3pl8GE+sYBs83QsJ85L7Nt97v+udjtAoju\n9lVc8SHg/52ulrdjgoO2rAQOuOn94YkJjLny0hdWHqHRRsesL7S1RjTIY4U1\nKV2kYBjrD3CBAq58b2JJakBf9DjmEY0MC+4nRglW7JjuTyX5DIL7awBY+UNW\ngm2fyNTy4HesuUXlmMX8aT11rzLjykczIe99wUJaUATxICs69Jn1gEIZwffq\nvFLtDHqu+QvKXOTAt6fkU7UAkIn5w08SiLz3tx+8kcEKtVQbCt8c63Q0Bx1n\nXFREjkDXuCkLttDwQfL6a0E51Rh5xov/HJcKWCMUNGAovNGAWwRnFOYsKOMI\nMbm8\r\n=6MdW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEY2Amz51R1UYThBbunzbKa/LInXOSxazT79/XwaJuKZAiBYzrd46VS99JYwGND3kDmr1izTYDMSqx1eWEqv/BJUow=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.f686ddcc_1548053991340_0.8709608365579722"},"_hasShrinkwrap":false},"0.17.0-alpha.a93a7cf9":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.a93a7cf9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.a93a7cf9","dist":{"shasum":"229a6f5a5b8cc98a8a3964db2eddc7d03a9c11da","integrity":"sha512-uIUxuNucYWd/PtFXIBf+PUszukXuM1OQEmQNRgukUVTrj6/UpzzkjFE/RErV2ZNTrfpOyQDeOVgRZrEoG7WYiA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.a93a7cf9.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRW8GCRA9TVsSAnZWagAAp/IP/0NAIMAoeYMqSOTazj7/\n35SM+d/aVbG7A39EkyUd5tRWX6xqCsOLYIt9UuKA8v3Dmxmk9bvzH02+pcHG\nBQzesh4AlS57FcNts+RVUECoEnrxftnx88NHxdvvkTEiTcblabAE+EuIK/QP\nBYG3Nkd/Yth7W6g/5pIZYkJ29OyJ/eOoRJFfb0w7m+4IydfsLSsnyAjbTqqE\nIrVsaMGQJYVxBxQ8xxR4+U16ianSncQVF/yGb1divLnwHc0fd6emvLtYKBjf\nh53KJTWc6oqlc2lvf9wGNg/f/hpcUSu+KGEOnohMIaR4Z6N+6ZTAt/0WOKO/\nEgczYfd7dTFpiZbjXLdjrK5za36U0IIWgZ6jFnLGNkcGoPlxD29N4mVL0TFs\n9XKNOq7YGnlgg/FV/by/BuHAcVfQs6CHLl3A3PUUYdNVPphZuyjoMx+vNhQ4\nwChUsAVk7t604VZyzv3dUgl9p2qkKYVF+oHxTNzIMYx2BuD3j18NkPaOStIv\n4hPsLQDeCOHUeUGXMeWBBqcF0qyIcYcyy27F+pmT0kYIMgZQihp9LW5QIDLz\nzi6shXwF5qCULsdPfeQcazzB3tl6QMFX20WsZU6flpHQtU1qL55q4qCaLV63\njqkViYMi1v0syab3dpclGwioLGLXtGdRJMbwvNvhIkB0Suc8wI4uwxSWtVu+\nZNg+\r\n=GM72\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIElnZqbGenfAqs8OsJnNJZ5FkPdHcH8+3TR7YjRMxJ38AiBVX2XvKd2L+yz1F4HmEtB6xpG7/CqP7dSJF0T2+COXWA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.a93a7cf9_1548054277970_0.3063272767101899"},"_hasShrinkwrap":false},"0.17.0-alpha.1d6e8107":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.1d6e8107","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.1d6e8107","dist":{"shasum":"8d13bed158a45516c898492563bb44ba7742c645","integrity":"sha512-0s4YvLKZ9W8LVDRNWwxZTz7v0GUoPOgZ2Ihhxrf6Wg+gN86tShpJ2fUdJn54/id4F2sgIY9gN0jv49SgAhLmIQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.1d6e8107.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRXVlCRA9TVsSAnZWagAAwtQP/3Y/4eaB+scDcnatCiZz\naFhC/em6JUhUZjDsA9sxcaW4m527P2cQuxmT5+7Zwh/Rkhx36PtaN3Bc0/tE\nw286sG2AATw58o+OTT9qZwcfZgNh5Kgxj0E0+9MA2b2UIqqDfcFKR41pSIXc\nDWojzu9CDyqpU/e7iinOBfM41H3/buRzyBYTSpbybdOn/qr1KyEOuC7bKbVU\nVQIGSeAYahOqi+tGpWUFEM1G2p9vst+KnYURX8zR0bP7z7Y8CM3zhBC1hSgY\nBVOC1cukJW2kSz6b89Zl8zv9fGk2WERcIrPx1zjs9fwv0vokh8DE1PbgmzDB\nDs7htW3o+HrxCWpFiECMj3x8ei0/qmC0SXy/1KbN7SjQmwZPQ2xitMHMDfkV\nXRGGbaw2PEBagzj25otMODkfnTetk7s+D6QtiPsA04AE8O31cmjDCC/rptCi\nP4ql2seXon0A2Do+OPb4ZmNPRhz2jQf3FcRkICkHmd0gYrshPcUdPV2gYVbd\n1NMXfrgLbuh8UankLs6CQmNf7cX5XK6y2ezKENOJX+9740mdb87JeIZviyV0\nbPn/MWQUcH/c/zT9ZttiNMqsanvML1+6YMp/1tAW3en9QYF4R7FpiKdHobVA\npHjjoBA8wDOYU3UJ0Yq/v5ooZ+UdyhNqSaLbgNiJ0vZlWCd4TnjwBDp0YevU\n95fR\r\n=oI8w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCbEACMSF+YcnWl7YPEATNYdGmVB4Mo50pVJxnYowmuUwIhAPrvMjNfGQjax8ll6nZGvd+curK+yOWVdq4eM7n8b9af"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.1d6e8107_1548055907300_0.035505035281108155"},"_hasShrinkwrap":false},"0.17.0-alpha.ba17b639":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.ba17b639","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.ba17b639","dist":{"shasum":"8656fe6e6fe80753e2f3814c831cf4e5a08e4297","integrity":"sha512-sFnX8ZgNuNI6vnYOPl0cifuuky37H4XdrDwjwPBztNnOaXf0FntkNygMUKQzFzutH283Cjq4ndiXFZPlxU7qAQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.ba17b639.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRXV+CRA9TVsSAnZWagAAnVUP/0/UvgcCWQWBdGz8yACn\nQdBXZHfU/vBmdlTdJK8DTvsfsFf46y2WnsdMsauyzkaU9lO3B0bBc+kqlWGk\nKUpHApV5lHbcUh496sAlmZw9+BjE8ePZ51S6DNPH9HmSHEj2acLNIJ3Yc5F2\nDz3uaK92ad7ytdGsKUjJS7CJrsRNlxeBwOMfkPbN09+KoFIiq6eJY7/3Upat\nsH8oY3/mUdVb974iI6NC/jptGst09cJ8ZiraMAbimbEQcrCDV/8Eb1aTRBhO\n4fgdzM39fG9MiFwlqBizTY/DcAy4RyZosxUdAZ53RqAlPJOGLygi73/ZYOwV\npc8eLfboyaCj74f62Q6UKopcH3RDNKhJOKANtF9+iqyG4OwBN7pc3gZteMpm\nuU7n+vih4E48qmEoUwP+Xy0qXz1EciopqPGtpvyzGS/xaBP0ArxsmesG4j7K\ndHFVplj0pMd9PFJPm1Z/GvIaXrGVFcL0StRvveC9mEwVNGDxC7ayR6HxmcEZ\nQU2yfm+EnbMQQYfIlH3wmrb2AFeBJeE3MMpPKjoO6zzn84FAB76Hb5dtUn11\nlQ59kgwJEG59LmM9MBIv5TMJuOXD1/mJllN0TIM+wdITlMtuFQM05A+3dsIw\nNuYpdZqTYCWzt3ndkeG721bLjzZdHNZQrQBUnNxzCgnXj8Mea9ued0U0en51\njmiM\r\n=1DFB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7Ae1glFCsnmvvGNV9D9oE/+ahC7L85yO7/+fc7KbIKgIgYGkQI+CW5/nvxCsedAe2Z2Y/AvapDa/fkKa4ldD9kGg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.ba17b639_1548055934021_0.6300803557537593"},"_hasShrinkwrap":false},"0.17.0-alpha.df1e375e":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.df1e375e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.df1e375e","dist":{"shasum":"08e47929ed57ca092fdfd1d4f8f2359a07d7da27","integrity":"sha512-MOYXfpjnH1c6IdV/QfmYWlKABe/y/i/ZyDilba+kj9IVD+y8rg03Weteb0t1F+NI5wgan+M1AA/QI5aS8q3vvw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.df1e375e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRe4rCRA9TVsSAnZWagAAAA8QAJUQFWCKQjhxlSpx3M2Q\n2g/IO2W6h1LiJi1VX3rv0mugdOOFoaKZzzAI+MjbjMJoy6qEBW6/CuquPcfk\nZx7KN5PDeDavA8k1YU/l1UPK0YwbywcOzD1jRx3IkDg+e3l6XtZYifdIfZZS\nkcmbqzoQivKivk6qUXZkF4oBZ38Rx3RHUTpTdlSebGr32Rn3RfiN+A6cPo6F\n/5uw9yTz4QdZP3zW4KVU6ZvP/fYFa2JVfIsTEmbhS3lOwX5fE2oPJqVkZ4tq\nXcVJ5mrJ7ZOhhgB62jtBtdbu/OfMTwksIxqwtKiMYVfKusJEQOb3kNY993yA\nOY6C2uWSbmdMO2V75djygta5quL1WvYbt9AlKfsuIydOILOSw3jc1a3Hh4r1\nDVBsGH4S4HUuNFMt1Gq/nLPwujxB3wDv9+adWyxLpu7ny8O/Dou5js9r0XH8\nPBWEEomFIn/VnFfuqetuRnhbJ8v7EepbnkiW0v8YdrmQccYjenyZokR0LPW2\n4isT59HYCMqde1AYSGI3IHEHsu8PpfUJzZux/bKeBh+JSfji50rT+KYE19jm\nX8IkjBNIV6UgziQkLOuYgTw+pKY/PKK785fcs6Tbi1xHN0uOexKaDCFvqSnt\nMxiVB1/SR7mzgzqFM5U+dXhduEEbJ553kY0TOu1aKupzBbBs4d0ZQb94bled\n2riM\r\n=A9YD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1oPGd3P61nsxtaOPRGitQHGVluOjXqYMWsNRZTO8b3QIgZD/Iv0766flOCuVSUvVoACr/zDzhnwZuOaloFNQeUdY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.df1e375e_1548086826422_0.9385128879607767"},"_hasShrinkwrap":false},"0.17.0-alpha.4c59e508":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.4c59e508","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.4c59e508","dist":{"shasum":"d7090a86dd8d93c3dfc76b13fbb8e2371a403ad4","integrity":"sha512-RtZJ5j+qEr37Ake5Mv34SrDPJOSBJbThsiTvmCK2M3fIh6V0G8Gd+iN4MfS8THMdnM8cDLbTTSJMNoX6K+6QTg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.4c59e508.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRfKUCRA9TVsSAnZWagAAHg0P/13CKfwfi3I49KJFe8e9\nJBBOMdGU0DeuWTBihdyFuR8V94VUEICdAAZuJozDH6OvodtKBmMrvtCtAIyb\nKwHcz1SNk9opvN4p2/bTDRSkSeaiH467A9iC4Jdhdp5h6eByOrHs0tW5fxp5\nuOnXjfh0aIdRHDBBZPxBXjh/zMTgmQVryOOin/Jz10dh2UOjsXBdrQcgKfAa\n3v692LXTbPNgoNj7pNZGeQopTxwB7btv8MLVABH8ASoH51pBO0ylYhdxAwpm\nY5FFcQjGbQkU+lh8nTs/+WbrzZSFTy5ngakvQo/FZ7qxsFNK4akJLJrc4Kl9\nyBk9mliwUjno/9UKiVelRhEE1iQeCv8Z75qXdIsN/rkHaxYDYEeeP3LcBGTg\nisY7GhRxXDsiXbRIvvUcItByanX12X4QztVMXsp9HhfqBg5kH0hM8pClFBBr\nNSTJ+4/fEWMjTmI/2VH223VECmW9Y4p2pqBcrsuApGCUDelPoJSr0CsyXa59\nbfN7LA7NtiA0RFFI6O/akT+RbapmuvLvbz36m6BDPg3QP7Ps5QYEZakWwCt6\nQUMqFsszAmhzG80OPBmgYC42U9hGQb0JBVSX4Jj5bZh3Mx6bAlLbUiU0qSm0\nIuj89cxRIW5oVTGb5i78Cn+PJUk6DannqiC1PRRrnBCPnsyq8MGFzZOMYtlv\nn4LL\r\n=0gIR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnfxCaxdNbCqwOAbyOlsdCj49r88wlZc7pGnDkxu0ZDQIhAJtW4FyrgvyKBsqjm8H7llq/LMDB9bWAcseUdIhqetTd"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.4c59e508_1548087956090_0.44016697573234964"},"_hasShrinkwrap":false},"0.17.0-alpha.e01c48d1":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.e01c48d1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.e01c48d1","dist":{"shasum":"2e3743f3c9147555ae5426bf3c00f65217d0458b","integrity":"sha512-EK4mxoSY1QeEZQ8bxnJTx45mQhIIprTYP+UUv3bIPX/cJLyFQqqxVUrXQC/oYcJOUHCpG0aNZ7oKihrWge3Krg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.e01c48d1.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRiPACRA9TVsSAnZWagAAtCYP/A8NIBBJxGaIkTsC/UDl\nUPQh7pVm5Ep77FPPfiihSo3YW92FCNc4YwAOSfDleDDsDR1wi3WilwlZJVc9\nmifyJN2qh1IZZuwEmuUAwFGqO3e9oabJvgrfGip+AMAcZPiWlYV/v8sFQPiO\nOvn6BzOGHm67Yxey77VwDEoEi2A2psPxS1yheDFTDkJrjnjWCbq42aTqixRZ\nsdjv9Wya6OH6bUE6oIFmS5qlDY5FXDmAE7p321p1wwPvsWb3/TzFGLCkQTwI\ngNtQE70kw2SAizggweaWnVutyjdQGARw8O2nKvl2fpJUKWnF+TlqHC6H6F2K\n+q2i4phDCcaVNOIUiSObLIPk2hfgfd5OTmyh67hc9sDBB0GKLozCHA8QX6m9\nok1qY+n9bKwsMndZzKyWp+HO/YBIl+n7hRmGg13CtKMQpvhK4P51l4CQueLc\naqIP8m12S7DhNxj2pgfehzeg19vSXzHMK7xgcqjDGq7vcDLhpAi+kOzOq3Kv\nN3hkdQ1DKfOxY80C2zM/YMYIu9ZklJkNK4cHmqsdGGr/qtGTqGqnFPkFvUaE\nagHxjruFU1Y6IreoHyFlB2zqDITNHLJJi472X3TP46pj7COfxqk353VCv+0S\nEcznZx13fFgItjNPLCAkOcpRwD9xcqb2l1zPMcr8wTlU0nrP3nNxzi9NXMnq\n2H99\r\n=iQY+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPW/isDVpMZTuX8fdxn9b0jftO5wC0O6+mOZgckuzG3QIgKTI78p/vM1uBCVVRkwZoe4MY28ifeHLh867OFMtskf8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.e01c48d1_1548100543714_0.36031004776998143"},"_hasShrinkwrap":false},"0.17.0-alpha.be46d9eb":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.be46d9eb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.be46d9eb","dist":{"shasum":"3dbc78327dccfe26acc2083ace7bbd1f200c6662","integrity":"sha512-RNyb3L+xBYVpmK/gckoWMxW5jKdTZ52HK6CYmeTuRX9vp9jnnuCYEu/cxJcRTXg4ygybsWCAXhQOQ/3+uKTVLg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.be46d9eb.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRjipCRA9TVsSAnZWagAAuTcP/itsG1hToofkg0YVLfmE\n+xTQojFl07h0XwV79clFU8XlUDSuINPmQ3Lc8YnG+SwSy9fbWC+zP5vWCwl1\n5p6LzTugURQYYeWSE6BvznNE83toHdOS6/hFCPkRG0gCkNb5l5j/MxL9xW69\nVlYyYZ4lMc3iewPmDjE7BDyZvdl8y7CS04hLXMRkVmyYbRXzQL0LvXB2bJtg\n3pT2zhu+zrdf7ffzBJLpA4tXOurLGYxSRdz8EyjVkxeahQvRpP7NKIgazV1B\nTAL1IySMIaltTWiRWl19iMOIcqbG830ibrxP1UeIHnt1RK5rNjwjq9Es2vC/\nj05RbD1fG0gp1mmjvv5iAFwmm6RNq5gKOWCt4WxLM/KXS5MLShis975nn+pB\nvjioeGLl/t8FVCXzk+yiYowoT2AGzFFx7vHF1H1X8vL+iKkhioOtnqlH0Pdi\n/XGPh3hgKL3PuDm9OYmGvgDdovVzrVDYBDVFwSFN33tztPnuYZlMuxr3mhTd\nOZuMSD6p+H+N2QWsveZAg9uf6Uhx1aSFwFM7cSeOjve1H9mANqolT/4JHce3\nGU/rxRXtmyUn+HExWzLAFTzMEbXDbOsemX8Mtna0/MBv/mrUxfmDyYN/SZJN\nsal/vJN95j/Xjfaf4c7A/ygB43EuamZomRPwMESCp74lhP21UQ4za+5WA9yB\nxnYy\r\n=7ymg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGCG5YvSwGeUzfDGi9O+n55GpuFKQfjYxrWKTK3Sx1hoAiBVEzsEWbLgppA6FhRjsnbMTrItqi1Kla2FXY3d1dkSLw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.be46d9eb_1548105896483_0.27563885892515616"},"_hasShrinkwrap":false},"0.17.0-alpha.ca5f1e26":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.ca5f1e26","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.ca5f1e26","dist":{"shasum":"6a6c88a5d1f739173968cd5716b6c2f88b1eebeb","integrity":"sha512-xvtZsvfocPBzMmYh1TTEVbNwNH10Bxk+Yo8JbPFSexGqWx6ERgpU5IK+wCBD9vxfk3jkcQ/tDcY1JQRyUzx0Pw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.ca5f1e26.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRlJeCRA9TVsSAnZWagAALHYQAIx3/u2ve47q8q61Vhpf\nGCpkojlR6tNa3GP5LmRGiFyPdXGCl3O0AO1jr8NyiX6YDYsanQ4Bb9zPO9DI\nc7wRU49hQUNpYtIe2jco+ZzBI7QP6Ow7Bf0aQFEaHDz4Imd8YhVpCIgKJGp9\niNGs1utUXndFgURfdE7PgK+SXuEpmNTCCbYeg+WY+VJmn729x6E/MipmXIWx\nAXwFxbQO5OI/Dj0nx8Xb/Ti3MXf249obYD7GlUGqB3T4ZBCektGakIMTVbu8\nA7kzI0l54VeR5P1S9896/dTa8UwpZbfgy8KLqFDJkZvrbyNCeVc52r83ZGFk\nI0oDnJEYgCfpxQSBZWpaZIZTu/96WiGvK3m0DquVZ3wpNRpBpD1HC9z2ujKl\nw4rwqxOatLdrMQHRPFw082VaEPK/O9MmGN2jQay16Ec/3UUBToQE/GIcBuu+\nAkONsT9QNBXSWpucv1Ru13B1DOZfEI4a5uPQkLnZAEjs9stGADqit23b1b87\nIKECe9vsiLer46C/brrj2YfciXoFCUeRohH9WgwAln85OiwVxINgIEDM7Afw\nETSHEHpyEMbDs5Crq4jEqujqEa3PMteY4IW5yKiiD9w7cPi5ZLbh4/MUpy7Y\nHFWZrAXPMWudHpo3Lug+yTTfZ2okjzPpysLJ+EO+tHuntJzpUDFyF6oJnwzm\nqrF6\r\n=Kpdy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICFk8HfCr0vfmfIbK1xOWWvPTEnnxbv/KXR/rltFQnukAiAZvD4oZDLsIwmhL71ODNtMTvhwrgU1/BkfSww5eqiVvQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.ca5f1e26_1548112477808_0.3814082126986247"},"_hasShrinkwrap":false},"0.17.0-alpha.389a4e5e":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.389a4e5e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.389a4e5e","dist":{"shasum":"bec4880b8d7db7d8e2ac68881357e4bd727cf13f","integrity":"sha512-9SBjjadbZogW6POnMUVI3rPFZEiUd81afaZJuLQkgKsj9vfdaLwX1vEuMU6nqQZmuG7rkzDCGpdT/3jFphalcw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.389a4e5e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRrnICRA9TVsSAnZWagAAlK0P/iytuzYknNEw+BSVCXxi\nMsMcBbycVIngFtfRBFnfJ2uLSSJMXtm5HN9ImEAcrvGYxhTEVBiZ4UsaqFPT\nYz7Hl1aLDdRlcuMBhgI/bsP3b7+LhD1U1J/vsC4L5YOplf2lfZO0oEvL/T7Z\nfhBSt5s2uOGdZ+SBeVJafpBn0XTJbZVfEkU8OTFfQ50AmK1y8qt5MQxdXP3n\nhSfVz6UhfexAFOj66JqcmWvmW5N5uwCsd8Apabmr8kL/Y6Tl280p7ZxeL/Ek\nAHwm2byq54roI5QvgTcnU/vLhXeL3Izi/I3J1HL8ev4nzXRXUtxdhxABqoI/\nNlX+dNBD8u+dHoSA6EUih/KmYlnlNNmlCZDKrzJyAXn8GO2ZABnpjvf3am2b\nc5OxMt9ZIaWRfmajWF2yVDJCu6obMzDp/fEHyCahQbvICpx64yNUPVGcY8bk\nNsCfuqIn9Zbgyjx4Z4E0qR9MUWM83PQXijjkDV2EHePzL+bK4WHOIcdNo21A\nMDNdRnyVWeXOPouSyNS3/mzAtH+PgQkldYcoF1bUzpUzDENxlmP0ESfONuNa\n2+hZ7uL5/GKUH7n+aoSHwFoEdDFDf9JsmAgvnaSfhwiXs4G4xrh/5Kcfle1d\nY6S0g0QqpuI3w44wkmcgMbweN4Jr2r2RR48iappwVvkHj9fBYsh9CpyOnjdT\nS811\r\n=HoOm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlMmL16w4CZX38YTvHN18eKOMrS83awZTO+/tjxO0KPgIhAMILcs/HKe7AoJLVyBeqDpJQxLl9bhEL1T8Xvf7CT4DT"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.389a4e5e_1548138951113_0.33629965161503117"},"_hasShrinkwrap":false},"0.17.0-alpha.f9396574":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.f9396574","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.f9396574","dist":{"shasum":"46dffd27d53cadfc4437250dc2bb270d8336b32c","integrity":"sha512-cV7BmIUFUIn6nxgQEBC3l4EUhKLwI6vVBx14dMMu22sIt9qVIh60X5k9DeOUwZOfiDT+v3gJFGjV544Xes9b8A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.f9396574.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRrnWCRA9TVsSAnZWagAAZXkQAIhXYe0qsHdCyoGFACeC\njMTx5ZdBDEh0mKtYIHRWpxda2U3qkngC1LcLmv48HAmTyl73GKItRFqshQjO\nVetQ4Olv0J5rFitiJ2oGjnM6F9IVZDgrbyTwOEysixzl2sZFEqcY3rlE0g4Z\nCI+V6i75xxQij9D2KwZt5uBaTkwVfGkKYn8WXvPlzSdQn3LPhvv8eWnVFQUW\nejMcIHM657EQMEgVo22ERZg38phocS+UFBpNXNeYU9xG/b/a6whRfRj3DqQJ\nwOoOk88B00uiHSDm8hW6qnddAa09aDXSbO2u2ub/F698KLpx4ZD/Vq/TCPIy\nQKx4gadyN0nVI0WzoMZn2OsAwSDVGe5XqWcImPoaSKRWdNKrh2sXzhKSfoFl\njP3VANkuQNGEMqE5qHLWOliZMCGOxll8IvEaPLQjUifcoU1R7iPRUsCr5L/6\n3Mh/V3jMEp2QywHDh9fykmxZkYgBWC6Bp0dwvYxrcCwQYfedTQl8b0SW+tHa\nH2M8cEcA3eL2QmUvRGpXzEyn7+GBYy9+Tn6L2SVqq4a+zh1moaORggxxj1J6\nOCxvRI3XdMsmOXE+x/7krks2p4XXLOyPXRhn8cbcEI/uTFgd8qvRlXbyYVpH\nGOHuDzEFQ6yFiTweV3wE/cIFS88kpkSSE6jmacSD3jF4RtfFBADgH3VbnYa/\ntJTz\r\n=rOue\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF4scKWi2q+dpaDD/OjOJIlbVRkP4KywRd8hCv4CAw5BAiABtxqggsw0TqE6JfPj4UKrtaWK+g/r7sckD4lON2TLJQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.f9396574_1548138965909_0.3904160929035547"},"_hasShrinkwrap":false},"0.17.0-alpha.274b789c":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.274b789c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.274b789c","dist":{"shasum":"76625db28975a7e53139696ac6840af5e8d1368d","integrity":"sha512-2xFBuM+pJymErSzDiIkNGcz5xCDI3dJ7ROLWxsWBc/i/eM4fOMOdgllrqak4Q+2wTFhteY+CdH5CCpC8ESAgeg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.274b789c.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRrnkCRA9TVsSAnZWagAAbGMP/i77kQd1Lmb7+xL8ANuX\n5ZJCqI7ibwABko1wcvNPiEPwiz8G+ulAE79B8mK3Lj2PxIp4wnfn1VIupIpS\nN8y5eIn6NZN0/zDJb6jmcJkOCbYxffSmD/J7Oqp8UN4FiBsGVYryc9zUdisV\ntqYZBTtWnufp/YX+KOKcMtaOXJN0hPKQouVB7sRzaqufMPKw0uTPgh0Nv/4O\nOeb+Ghgo0HMNcpUZD5HRfYe3pbfwZDO8Wy+jO+BLI7Xd/oKxBNSQEUFHzzhI\nUbYGLXMOfSw85cHsVq6uygOXlmd4l7V6zLxrE5ovbY3KYLrg9JrRmH8IRX9o\n2Ah9zZ0DnG43easGmZxSiKOJ7RSJrMmI8pM9+iITfz9wC97ARfUyDjcji1RU\nMFR9ReCIAX2SY3ucGxggG8HhmivtZeo4RKYfWXvSfOodjCNVxXDszt9rstGI\nWMRltKppwgkGL6ICLkuUAOmZblxXrGBFlzrG8JJS8ySr5wqYtVwoWljAxrGI\nlB6eybIyoRy+66LrR10SCCZzhZWlZxOttTTJmR2VEMUMqDKgGS/9TtpVUcDp\njrHsuocpHXPDVPul8ySCWD5UtXynJ9vex4+LakuPjJTdzKv2v4iRRynFsYR0\n2YjjfNaqawkRqXmv3hQ5lMvcM//FBLONPD6YXsMSCKIFSjD6xCU55yj+Fi3q\nJEP7\r\n=PqB3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOfL57WHr0UYg6ihlb7G31CzuqIy96iaVcRIKiiVVMdgIgfXv28kYjesYznZ0obi1JJeBvC4Ukj9vJ7Xrhht6tXzM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.274b789c_1548138980222_0.7080764088135876"},"_hasShrinkwrap":false},"0.17.0-alpha.a77a7e9d":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.a77a7e9d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.a77a7e9d","dist":{"shasum":"83766079bb190e577d597e60ad81f326d581fcf4","integrity":"sha512-s+ZKt+BvzuFfm01dr1bksLh74Aioxbs+E/YPM+GabBPZrh0/+v7SfK4l1a43ITQas7RDfl/qFVLHFkNQ8B4azA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.a77a7e9d.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRroaCRA9TVsSAnZWagAAhZoP/jlxOD2o+XoDNX5B+zI9\nXJuyhzswnxUgpsUKPECfmtNDw+EzOBbdPIe9geK+A0gOJpndbOe+UnTS7818\nsSn70oA+yxhBUdPHaKFB2D/FTEiyCl/XQiLtaxvVGlrijpO3U38QP5IciJ0v\n3Z+HhkiXynS+UOuYRVSZ809MqlrNj74WWfYyoNLZ9BqrlxFq9Prup+cz2S6+\nBlpD+/9ZEGZAjdL6siSRaDbYJA0xuvC+8ijs+Da7aEdTWSZJHGM6w5x8M4+/\nUvqPO0KFQyfe0BKED/ni9wV5tX4lW+Hukysyqbk1iiERMX8NLKlYgBBcgIUe\nzVNWdz/4FEFAB6JBCMCy6wXjYeV3FjMq/tvkFC3VjuI+Ml29EaKaxJuXWrWe\nJ3PSPUZqmSuao9lYxZq0fAJEtm1/U2T5rgjDOR/VHyw0WIyQLDzbap6leMUq\nj1q9LpJfkUWnLHgmD3qH9OUFtYIYeZCIOB79NA1dNUGbMVmGWtNeRkJ1P/x9\naPeBlzOheyO+ZBjNUCO6HPE/HOWg307qTZ9CnkVLxzEjjKBpQ8U6/lb2d75j\njhbZ7jUTDgAlsLtMKRN7R9bHSBp1K0yBIhQGBKogp1qGZ1osG9T23BTAF107\n+FXa7dSNSdAcuVJUVYNPDZcxurFhL4APUCJFIPShR9GuA7P+nx2zw0SYehfZ\nLJ4M\r\n=DdpL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFY0cvW19o93sxgoFj1UTqeF7iFJZAVZ+zjMF1mjmpwaAiBIHiQVjMAWm2bfnNLXW5Y+bHaDO5rxJCY3gnQ/NkKvgA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.a77a7e9d_1548139033950_0.17771517686805827"},"_hasShrinkwrap":false},"0.17.0-alpha.c704bbdd":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.c704bbdd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.c704bbdd","dist":{"shasum":"217ab26498cb23bbabf5758de2ddd71420475f1a","integrity":"sha512-t3qW+r8IsKXbbe3I1zuRxYtMcNeGi325nauIWlM7xi3dHvYKdkGWGnrwSp3Ow4c/x7faQpP6JP7TA9CVrBbzQQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.c704bbdd.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRyQNCRA9TVsSAnZWagAAjXAP+gJfrsp561E8Fr7rYvaZ\n5hfJTYrwDa/jkf1F0HcPa/Uf7GTpdhwla2FVs0cgspEjj1ulmPbHLnZT8Ser\n8jgOTmNknY9LDK5nwgbFPZfi6H5SBDl2cMC171nKpQhI+W0PV74KKejnttTs\nkiZikGIksEkjKC4fRLkb8hVPqaE8YBLCuSxYB8y+TlWZyVJ3MoYW5tFlu/d2\ndrQJ970mRj8GLf7V+xzPaEJd9/pItFYkCi5WbHwrZUgO8/eRvQ2hWwxD+NEr\ne+xlz+EO4Kr+hnB1eugVNs5BbvuB69xRNoDmh1YV/TMQsLmwh1KkRqB7aCMM\ny2lYZ38Ssu+cjHd/eGJprAPH/mB8TAUxhOP6P8yYp/33Ln07Be1+EiE82t2j\nNztsSJwfFIQLUBaYkYWQR9D+ts2Yf9QVR36mpnZiHlph3PHozK3sz2s0f2kL\npM7Kkwkr6E7q7R8WlVdSYxWdP1UR7kFtjMx4QuxHkSvI1IE5JiCBHDS8d6Fl\npbR1100tZZntQMZyaFeWiPkUOwvkEU6JIdCM8D/umveCRcxqNX8AAKNJ5pLO\nRnQokJ5PvZ0FgeIHmDlJs6Rdr1y4upTTQAVsJ3vQWsvKRwK4Ys89AWWWF5RM\nQF7YD1hOeD3LLWy6S67uPK63wtPj/0Rs1WEKTzao//42e6H3DQvQmrvgfMv4\n94XF\r\n=s8CP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFmH093pJTa7DSZql3+IFwpXT2ZwouTs9PKE2sYH+1HjAiAnP/5TEG+GQP9ZgiptznrwxkOkSV6jVhlyLZarFVxebA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.c704bbdd_1548166156906_0.21146508399987307"},"_hasShrinkwrap":false},"0.17.0-alpha.a6bd36d0":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.a6bd36d0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.a6bd36d0","dist":{"shasum":"d7d1103b4367430f85895d1d1edb32641c032ad9","integrity":"sha512-k1I4t8jFOTERRZDnHHft8Y4x74SWrSM9lbR0U4dat57mTHORQKSehCvTiuwNOcyF+ubsbiS1vYeXfBiu9n5Waw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.a6bd36d0.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRybmCRA9TVsSAnZWagAAxj8P/R7O10bBsZ2NNRKUehIA\ntqlsnTFxMuxApBpQFGYMzyDXmxCRKIrck/lmG3yw5kXcVgrmr2eSSPo2Iaig\nhM3lluR9w+CbmFXpUUilx8LtBT0/05wZloamhPDhphlRhUSaiqsHyJ1JwrXO\n+G9MFYDn5uTE4t71x3ow+Uof/Evu2D/luLAXVPsf22nNkq5ZnTPoiZ6GyAvg\nJgY3S+vFidYZFTHuwgjvClrIwCHTkSQNaxqEMfjhpfrphwTAh+hIl7yS7mqd\n0OXup/fe6MCE5HRnuUjs9tfE/vjKZbHtYUwnkz4LaxhwH4IGkSKlmNtag48p\nHe6+kg8nXksrGTroHH9rzf8afr02Ee5u7N9aRugIQ+Aw8XrlZhCDAm8REDpS\nynHLM8LgKFsRR9Rb4Uaj6c8ooNYwDCSm/OzlNEyumdAZQHf82GRyey3QStLO\nsTNMAkfbkDqLM016HlezWCGsndNayYl/QaLn48rDyN7XUXbHcgomDB80pclv\nrPT31Xr20eovMa69HlqvBmzBBGZO4XxY3CdAY6ArC7czFTJVG7HMLBd5LF8y\nQ8D5NQYC3OeThIEcPEqsWWBXkRvTvkAcMiF+J1EcltCok2hIReNhE6J2KPzI\nLO5yz32OqTvETAIE+MvWRMBVeF7Pzg4meAIJekQ3bXncByUQ+jgY1nXfDJ5T\nxGwy\r\n=ANg8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAOWUnfkhZQptP4t6f1KSwcKVwfftymWKCojvooi2JvbAiAb01lXXg3MczCKlLvfmzIWQfPMDQ9Z7jUrnuwAc7giaQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.a6bd36d0_1548166886395_0.14381387137352464"},"_hasShrinkwrap":false},"0.17.0-alpha.bb76bd65":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.bb76bd65","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.bb76bd65","dist":{"shasum":"673740e2379b82768e1f4d9dd69c2e53ae8eb532","integrity":"sha512-EwxXxDBWJ1LyxrbNioobV3I+jfKcv6b9GGtuN5o/s10MghYQ8A33BJhU7zl86/10rF8UjMrIF0pLrkXBuTOsHg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.bb76bd65.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSD82CRA9TVsSAnZWagAAqCgP/RpWY4RsPT0MCmr2AGvn\nT1HYou70b+brUHD/SdqRw7lFh/KpvpD7uV0YzPp/YG5LhnaIy3J1F0GEmd8R\nP37V2JuMnlBtXQZ0z5dl9VXCata67yc1OgFsuDkxiwKpuq5rT5P4vSe1bwFI\nTBYnU3cvvFgxq5cbXCnRitnzDpT5/aLbAKdGxedAZ7d+m2Kws2VhrmSSYjBw\n/pp2lZhR9jlmWzhHpB6riyFdugZWmprQS3i+I69iA86zOUVA3yIyK5BMZmjT\nYSAe4ZduI0Ga+Y50XC6WAcHgStyGgj/JibE03ozog3OwLssR7gsG5mkw3qGp\ngO/9vVjsBuGAcZmDLr8BIi04c+KFJq1zolcBvoRMEdGPeTRuI6vCByzble/P\nlr54ReZ0gtIQDFj/dheerM2x4AZDBgPw3h3ibri4HSsM2s3jLHtALAouwf3O\nGTnd3Fu/SU5I1ZJT/1VQpXzM93KqfGenN6EHYiq/hCbuaJ6g51JCJJzKyA2H\n4fv7voqyRkdEn+jtyYyDqAmPNLNoyZGlhbYCMHkiWeDKsRmXZOybSxEZ8DDU\nI8dxaWkLZnTwHok8XVHvaJl99Llcx54Esarwi+t0aaoXf2zT9GcGXpFiIl2f\njl0Qb1K01rgQwh35u9NdEFuDFPg+CfzaxLM6YrEwONnWQb9U83Vr8XEWpNQq\nP7Qo\r\n=lLIa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7FKY1YBQ5fu10gUmUMf7xTl+DgzScEXhgfvdmdKyDPAIgf51ES8p7dx+FRXfVpgcfDPAkbHoUU8dYMaxmhKio+GM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.bb76bd65_1548238645755_0.5316543900438357"},"_hasShrinkwrap":false},"0.17.0-alpha.4f5607ee":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.4f5607ee","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.4f5607ee","dist":{"shasum":"66c7ae72193903f634cec1cb198d20ad85b813eb","integrity":"sha512-XMSVD1Lc/gZimWt29Fj3w/+bqau0RFFowVExaxa63G3E/VlS3NMK5tf8CFj2L5CJLzxDS5KZMLrDqeqSI1h7Ww==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.4f5607ee.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSE3GCRA9TVsSAnZWagAAf1MQAJ9S1I5B/cTNzoUlot4T\nnLTV2AuC3oMwSMu1lPwaaFaTAJjnu0PhhzxWthbhqHSCBcspO3N7Z/X37ojF\nQztnU5Ov/tCuXim2dPpZR+mgG54X5CJchEXmPie+U9ihO3rPGMAG/+6FkBkg\nwqC1EybFPUcqDjSf/vMETwdfQtkSIK13bM4lBA9gWwV+i8aAZpZZMdMohDu1\nr8f+3IfMVXmcDk65vggXm7NDCoAlPoJ1/W8HZbWTL/Pni9F/ReDB6tPh9X+x\nARPCHmkfyqtnrcn1sv6fyRIFhD3u1Tfp25AhtyKiy2FbV44kEhZ6bugVEefA\naWmJwDqgU1uLsEN5W04JNWSXmLoiKy2/SaBwyELA9KleX9j+Fs3UqYZaKJ2O\nzlNI8WwiNVXYxpf7G81m7pHPjn2asw9W1UlOfVfyFfr7yt8a01uMiyHP/Sac\nPgsihMUuKVRNPRz4ZodGAXDwNB14ADn5oFxk5Tm3eEFstP3xOg0GZ2COVtq9\nSAqSLsC1qjc0agaowFd7PT/Nddi00VCS9rccBwd1col98dbmrLMq6wfDNK62\nRwlGfkbpiqqjP3GGoduMdL7bu4HFDGJhxiHwY3W4u9bDfVyvz1EkYC5ZSrtQ\nQ+RDtIy0lpxHF61OTIjf1l4NSytyZLeGGzWMZ3Etd6BguJ9CwBGcDJvIA4yL\ne9Bo\r\n=q2hr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFqEyIzLnhbpxToMcXnY+jwyUtz2AqfCPmCeNFLfglrSAiBC6XIYYSArkX+ztlkn/7Rp7qxIt7mTKfyChw5t4LReoQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.4f5607ee_1548242373708_0.22233544624386203"},"_hasShrinkwrap":false},"0.17.0-alpha.ef6ceb6a":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.ef6ceb6a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.ef6ceb6a","dist":{"shasum":"1cbee7461ca1b588a93603c95b91491a1cfc46cd","integrity":"sha512-epCRgitpap1gRYAv2HFcfOpqIOnmf1VAsQqYtbbV7gkxac3FExKHk+KgbGbb4a0EbUWvTBpVLHMouHr4yEHSRw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.ef6ceb6a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSPgQCRA9TVsSAnZWagAAoI0P/0Ei2oW/X9kPyY59xYle\nu6FbpKv4K+Hqr9Atnj+FwL1+sau6aeFS+CL+WUMSHMsPjO2CdHydCs6xqL51\nXicfvdc4AVUZ4Rqxn+wjiT26AvKkcek6feUwWWfak80/1w1C4DlFyMhcPgSm\nhYWHkZvUP+ucaySMSbFwTv0um6Wy84+y91kNGOWMI7dpxe6d4nR7uQkjqrgU\nc98Vm49j7hxh0MUWOOWDLKCHFvfHCq2202pkG9Bj7TNtUZfcHWPp9UPs/x7m\nUFYyPxdpvjf96/IVzkzt5y/fP7BU2g4tFR4DlZO6hVdEHyKZA7HK36QviJ0E\nxoAbClF6bIFZdozoILIsDY5AZIuBZTVyfJjPwqa/SBgB/A986ocQfDyA1V3m\nDpesGHe035nlR/gzF4lgKZWprF5YxOfxaVBr9y9h54WxcWWvmkmWLK5iKze2\nPAxTQ8dUGveYKgYbNv28c/ATaZW0c8191IzdSCK9GjovN269hJroap8RaQ0e\n7c7fJSoSVJE5msv6/kNuYI3DOXqTF9tOAJj0tXKvoaL+rX6Cq2IqQfgkg0I1\nCeiUzYijvYgc5FK4VOJ8/nPsJidc43TbiuVdVrtl6b29QhyHiQxKYqY3GP4r\nAi3FUXT9oQ972yvIm4wUsMJaWvieJOo4/3axSpWkmjtR3Q3HSX4O3bpUDfPt\n2Jiu\r\n=v+ru\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1r7EAXv2w53hBEoOiZPx41oIWBT8k15DapUE6S/weSwIhAOdK46mmc+f5m+uh5JI0xHkzw8adssHSJdCj3jMoogZB"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.ef6ceb6a_1548285967426_0.3734776215592508"},"_hasShrinkwrap":false},"0.17.0-alpha.4edfff92":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.4edfff92","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.4edfff92","dist":{"shasum":"8152acd550e43eb4a661791cdd1942d4a03836b6","integrity":"sha512-2RxjZHbOPv5U6hJ8jkfpJn7Kraq9/Cb/+IEkzGGHpTRQyYjcNj3jSH/s7rqj7xpluZfBLkHt/DLr4Wo5gcWDjw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.4edfff92.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSW/HCRA9TVsSAnZWagAAd04P/jW+DlHi59dWd1mUFim/\nocI9FbngOlrNr9hxiVRnJEUY47j0DOxLdlN0yPsF0Ju+rL4bAsZw3IgXvqXn\nMBIQSMPvKYH9FjrED4h3nvKIi9loANRzfxVMDDb1hqWeNqXkQEcIoL/3Zzio\nnuRy7qeO3iRQfIki+veft44DVNYXG2uQ8M2PZdcBfyJesRlFG6mYWoZSGg9t\nXAB3qtOxocAY2r8XBkcScO6HFiX79eaByGp0M+l80U8ZQdCMwxXd2ecmIbMG\nufj5yS16LiGNUGVfU3CT4lDSI2lLwPF1McAZdyWu9evPjs2/frDk+Q7e0Ahz\nRE8b6ISMO9CUDrG4a7nIerNFhHgB/ATMtS5InkFvtz5OR+IXBpYNbcYkZfIV\nxBdw8I30YoBaevPmz5wPqw/QcJy5i8QaWwZal4Vc0oi3y5OrAGptQ1/VCL3H\nRxCokJkxg2NZ22G0qsruTA7ucakvJFKb+LNX1xAJucGhxYGSxKTfboeXI0pq\nccFRboq3+MmgUI6X8ir2dXO09keRBtkQ+vB5n1g6ZMq8r5IcYDtFlrtGu1Vz\nJTMPEbPm5Tyfn/Q82phQaNoyYc1WCdGi7hXRnkzqK05J7F1TRDS0BVtX9wEp\ni03MD4NDfbb/jW7ql6mFCAF7Dr5jZBERA0IUKO8npnWaTM3JHa+IZoA6GcTp\nx2Q/\r\n=7sDP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlQxNarQuCk5UYmE0yx3OdSsaVMzPUq1++0pG0gPr/iAIhAPylOoG7XLkmg5xZc9oxgYvGCN1jMcdGxcM51plzSv6a"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.4edfff92_1548316615243_0.08181231846833947"},"_hasShrinkwrap":false},"0.17.0-alpha.d11ea487":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.d11ea487","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.d11ea487","dist":{"shasum":"80efeb475517cc6703099c85a443a1a7afb9e45b","integrity":"sha512-rO5cg3m2Dz4gvkBKbhB1KJfxqUeFPnhXwUeEgfQ/hqX/uQPU8SWBPvnyCok14uW7N1YLGlBSTlEj0d6GgGYLJQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.d11ea487.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSXB1CRA9TVsSAnZWagAAIKwP/28v4U4wyqMpEzuLOBhM\nvf1lHWdLDoEJGplK5H0n1Rn5eSx3hW4h2/Dt/ifmDqeB657s/1IG3ArTDmdN\nIA8niuraUG+E4W8vC1aaP9FAhBS7gcJ938CIyFXe/LyHXI1Ha5cr9B4o+Z6m\nr8N9d2ujhJ8a86qp/bu6+K9HOnGa0dO5ZKGh5LWNUq9Czy7Qv8pxwd4E58dR\n306cxB+oZYAT5OZKDlTpOXIpTV4/+oyS+8XOVKMiKZ+LcZsbSvsWjC6PIIs3\n9BL9Moeyqa5ulZNI1sySDd8IfWuw/wzEv7yJzT7PC+rZBfsC5XvPyUIWWZQV\nvBYlY1YMP01cpTTmx68aYvecfpt2DHUsP7AI02gl/PQJ9vLtLXRwNu6BV+ZG\nyPhGfHGKW2DhsghZbQsPjszCwVDqWxqCbEECFcZ7mt62DXbwO4WZVu2uOs/w\nwIfsuckiqDsb0LsCtTZd4GSAMunU40APX7YDRTa96VmgFZQkSxPryM2C9/Tg\n7eU1OIIEVcZ7sAtwkJ/kn4+W/JHdfTOyf+sB2K5MBbVs2vuTHrX3KhxtwjOo\noSN5J1CUPnXzQExAIKVQsk7PGp+qKDdXpzjiVWt6VdOSDQqBs6HvHsNNdncv\ngQAZ0OjdLAH+zmmBdikVJC8dHp9WQF1WnaO/eTAhrYfZxNnFjai6LwacUINS\nRa43\r\n=wYFP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0X1VbN9EuA8qCLnHcWmFKwU/djdPNkHKtkEHyJVMUbAIgLMkXCqtBMOCN87Dcug3fRN3V7QiJtUjaaXqwg7SJbCM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.d11ea487_1548316789265_0.15587749166470033"},"_hasShrinkwrap":false},"0.17.0-alpha.67af7796":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.67af7796","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.67af7796","dist":{"shasum":"c2232e0636dd12966896f55858bdc688ad1abdd7","integrity":"sha512-3wo6CAT4f8r2Y2f+yQ3fVR2HVCCdbgsHvXCJR4W22ZWsHsYYfx/gTpDQ/wFr7pb36EhUC0piysHFrQ4Ql42PFg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.67af7796.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSdkYCRA9TVsSAnZWagAAbYIP/2+EttTH07a/zsFnZ5vl\nTnKu65UjGy71I/OOM9fpp7EI7/163cWxZgYOa68nrCCb8FdgXJr4eCjO0oEc\nBzRRPmoaagD44ZRz79bd974cfUFc0YUR8e/IomONzicunN5LMFxM8cmXFLQE\nlNOO8oQdJHKMaN5/bl5WnadXYGCgEvj7Cm/mXJ0KFtGJf2UEJC9MkxEE2Fyv\nXvmVqVRYAsZyDcqV/rpEdtlRYAGRkVpefbiW4+AeTmH7z5WVZG1rgLCOBawm\ndVqZ0q/iBMkGU6m3ZjVHoLGYCTQSig4S+S2L6AEnAa8ZrfUSAq9Q8TRMEg+3\n6fHbe4V/JWEKWM7sOUs6+f5ggegoaGxk4oophLbdixbWG8Eqw4ygPZSyKEyy\nJkw/7ZRiKEN5wCB9LKFkA/9mzwrq3HL0g+malJuOs2oJE359It34KKUdKFMh\nAxMXLB8Gjcyxj0SXNHOAUTtFB7Ps3NZnlAcGEFToim8flEt3WJcVZTtlBAMM\n8Yv35vovKpZcXCFjopNkWwt8sWxwXvp8A3MmmfW2eV6Q9edxAwhBVPDrqejE\nxa/9G0Wo5/Jwe/A+7ITzAZUo8ge+gfhn2XR261IsvBylvyrHiuvyx3UNtWqv\naPUyYrMZ09Hsp36IKP0flrolHxEafkv3leoPyKPw/7aY5TqytM9bBD5nBMIC\n46C4\r\n=Ol2w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6Xy2hT8V7lU4nwUkvONzrYL4ncsMtHPgt+/du3/LQUwIhAMy4KZsuHqXiLYjMKATzCe3b0WJd3SAazZ/szBvJvquU"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.67af7796_1548343575503_0.6409637322929738"},"_hasShrinkwrap":false},"0.17.0-alpha.9ae86168":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.9ae86168","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.9ae86168","dist":{"shasum":"65a87d5f1133ae4386506998c04c4129d4efb90a","integrity":"sha512-GkEk9X2F9Wgd03HqLQ6I3GqCVQKMClLuZlM5Coetjspv2MaeAQcDXCF+ueXOi/4Q7hrr7Ujkq2JOT158B/oNSA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.9ae86168.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSdkwCRA9TVsSAnZWagAA8pwQAKGtK3iy1UvIpeFgSxL2\nXGniE67xy1PO7nlB/ioZmJ7RTHLfO+RIspwSgjkVFUoklqF4bFiVoHinU3dH\nBgXwZUt3x6ZNRBG/d17zJQyySs5mPYfFXldDIfL36ZzvWoud+IterR6Pof5L\nyPp7UrHYwbxxYkL7/+ygBqZT4ScrisOGVlHW5ghZwWkbKEC6BWF2pdFIhgDv\nyBNLrQ3+lXDX19ff370rG2ZKzTUAa5eeBpUCOw6eikmKJm/VLrqkKn5s7Byt\nda0uxPIOGS0xhA1dLFZmokF9mlG0mmvnQy02MpnoKj1AqCcZdgXpV3M/cJIb\nqMTLh1gsJkhwlp5dK5WQCarGwy/I13Y68r+k2gGCB4TXNftMDgS/sFaReJxc\nle+hjniGidDHx9bpNpeAbNXnwVL3xa1KK04Sd2lFYkUgDFnjl8XBwtDrp5zo\nCxV1uCfHdMPnTTsQAkzI7u/cVgBPITL51zWPsfYxSUmU+GQC9SqFwCligY6M\nZD3KUS80W11B97UU79sdiWLLeGXplTsDE6qlpnsfdi6t0hpIBwMLl7nvzQtD\nemY6CLmsG87JFU88/sKI+DX7AVvDqrCyZgg2Ag7NFEzzPPdHC44hRePPHB+H\nS+45UDDCJ6rEUR/hZScfw/7KPAT+z/KFvlWwaUl3RRFhbhMTewW5ZtPl4NgI\nsrw/\r\n=QHDL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDOpMVbUWNjAVdlT3xpAGS5bnnjmBy5m2ZmpUt2xF9YlAiEAys8BoUm1Fzn0k1SANEjQzO4wkNSMC+i2SLwrGapNvwI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.9ae86168_1548343599493_0.890562284468235"},"_hasShrinkwrap":false},"0.17.0-alpha.73c81fab":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.73c81fab","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.73c81fab","dist":{"shasum":"a9b3842a6c2fce6b964e4a021b95e86ad1274922","integrity":"sha512-8eqI/UFdN09HjCOroEc776H2YfZssCs2crp1FVsgnLL69j6iRA0ewrbVfE+fiBGPQvkuYrzytU/Q+kpGU8o53A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.73c81fab.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSkpHCRA9TVsSAnZWagAABEYP/3947zSRVOqsURGe42Xo\nquWQXmpRQZ/2x31fjlGmDfA3QIDgjBf9YsRilylglNgJjnVLoDFjNuIJEIsa\n2OGztR+bZ9XdofaT75dAfvpJdpfFfZttfScSLJUQDBEohcCHiiS1iGPE13rs\nP7SruKNTHiN9Jb/RAHfI5h8xfZQYQ675AN+PMzQpwz06mj7Wta/i9szaaZbg\n/KfaRkwjtUMiVfXgNOV53AOsbKKlbfevhSKr8f/Iglxc/738Z023UzKzcyQ2\nwuxi/RNaxeQmLAiXCuGt2rL13Kyi4EZW8hAkW3fOjOGmeZlvYmK3K6EsIR0t\nPpbD409eJx/bZlA1vs1uh0eMstjcjyRNk5PINQVSRM+wHzXwpEeR3ZiU2jVl\nl2IBSFBFEKfALeFUyQOuSe4FkByD/IvoDsBy1zikxCd90D2dPL1qXEOpFWHl\nNku70fZevWbrrJOOHL/tTviI7g/MIn1hY4ZQxg7Uma8yVoXLUNuA49Bw97a4\nRWPYPjhXoagtlZve7c7Dq2gm688xwpxPLJFfF1Q9dteczbYnK7wlBn9nbvLz\nLFTJUsApMQbNxR2u/5Z20mJoJzn7XmzCLo5+gJriA0TtiPQBM8GxC6dfz3Jt\nlxDD+Sle3Qi63ycz0uO9v8oLKHKmPUB9hOCsCAr6EgkY5dot4HhY4GK7cp7x\nOr4C\r\n=ajlR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEN5nFHFs5kA8Hi05dwM9CNixqVGONFdnDLdklW0+CX5AiEA1TALmojzAOF1yCXNacf+MxSPMBPF4YI6Wu7bnPiPHP0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.73c81fab_1548372550826_0.6693345596945708"},"_hasShrinkwrap":false},"0.17.0-alpha.8cd55fff":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.8cd55fff","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.8cd55fff","dist":{"shasum":"b21947ad76368c03412e1caac73187e7489747ee","integrity":"sha512-evA5NrkVnhTW62vP1Q2iMV6AdvjvUbxe3uLrC8W++FOr+hGZygqVO3I+i8U2g6KsV95taMMY5or9dezU1m/FKA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.8cd55fff.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcS5GACRA9TVsSAnZWagAAFp0P/16wZLRHSvaoZKD8B571\n5Kxo3mN0X+7dgZEzePTcalBBnlx+NoXHrZ8EZyn/3g2kqZHt6yK80iY8X8w9\nFy0Yc2RwrXNUerJpB0KkipEuloC9AFQs5ZA4y/4EhmVNFPAxWPx+4elH2smi\nLvLk6gRBRrj6TpplyuaDp3PZxIE1IOp7MuOPCo6p3S+qwYGZg8Qyqb5yKjS9\n6zcwDY9Z0t66yk2RbSytaYbTf7xBWdaV7R0eiJ3cjZaH7nw3hS7loji+Sc8i\nYEhFkfi/3Zo2KWllqBMd/fjFZrYKY8Z94BuYZf4L7EMBtB1DJEJkhS1KQxLz\nlvFK2vsJFxGGBpr5Mbn9vyGj2rEewTqa3LMl8Cgbgzd8yv3xOnPQEGxiFGbP\nAM1z3r2gUDS72dS6/CHied7fkNzRbzaM0TWUrFtzxTFFUQjjMO0RvxDv42iP\nWMGunpWStZcaeeyTGUCEYjRBVeaoKiabTTvnJrIlAN9aDGtMzqPanN4C+7Eg\nEukqP1a5cPvxSmMXtcDEungFWSmuk+diZ18Sd1VNdtJALY3KiGGdynIkhjFa\na0ZeGcTu1dPn4HGIiRMDR0+EK7W5v89ALyXSBeJLus3F+Fu3ClFmQsVKoSbD\nkWnJ3grp97HI8W5u6eJSqFbZp/Kf5Q9k0SCbex+ntsGE4fSQCu3JXWA8f6QZ\nADG/\r\n=ANNk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGpX3AtKMe4QjokcEz1V5SFPCj4lyumkNn3vLTndXR0wIhAJtoimXOTBk28SDo5ED2PxpDegaZzqwdsNyJKRUROnBY"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.8cd55fff_1548456319738_0.45986560890762673"},"_hasShrinkwrap":false},"0.17.0-alpha.9f2a98cb":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.9f2a98cb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.9f2a98cb","dist":{"shasum":"8d1b7f31b2fdcfc59452e694605bd2376f0ec987","integrity":"sha512-MGhbrSjVqYKKZsDcI2/EnwMtyvAphG7QW+hwZvny9bJ9JW0Oc5d0AZTdzSQdLGJB9TnAG9D6mJ43R61SWQtiiA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.9f2a98cb.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTGlSCRA9TVsSAnZWagAAOXwP/3IBdahoZ0lttgpT6Mwk\nVSUgowsv9sSYE5WQmjA+Ph79BLmDnTS2bkWGVHT7qPyQnTjt74YuqrG0N6zM\nuCbU6gfeQF1P9EIW45KVtk0lH1nKHazAKAdxNXi6A/yEYtoAfyNJXrWD8nUe\nhYJp+F+wNiOcmdGpoCgygdEd1g5jQGNHObwkxDHKEsjV9Zife8jJrnGeb/hy\nDs3aEcKwpawi9SECje2y3D49Nn4/Td7hGTkBpOuEDxgfOkOqfiR7G39D8Dw0\nBu3vfzgt2Yyi16D21M3ySWfyKZne9eIql21/0+Huv7JLuW4o5/LBLHbRxjSE\nysCKN/aG9oL+wwAbBsQI9f+F9Y+TnfveMpO1/EKVmFsU94MXloB3DngKvM7i\ncRHEE7bkmVToWG47ETCipq4L9FMRZ3+uIGQfG/K/c3E9q0CAzbi+M86D1LHC\nVVCuk95wy3Oeb0JO/BASYSCVcyYT74UlRCgrTUlhmM+J3TCcg7ozrolIHfc1\nerBvW1Cfxkk7rDO52oNYdAkVPgjO58lZITfjoWZtvhROhyjiWH2x0kTZ0rh8\nQ4iRR8qaQ7wjslPUS3F5DDgfYrJM7+AiBCVk+k7OODry7Eg1BQ0kHlxGFn2R\n5x4hWoDWz2e5LuyAPKLgipwb5v4cS3oQvKjk3E+fE8Oqb3k0OqIQtEH4d6Tb\n8/IG\r\n=uo6z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVXuJZpM0ZlUHEUvNO1zGHNpur7YrDUZhhFpOJm1dO/gIhAPfAEIiblRKKnkl/+g02y853INPeZ61FKwmWOzSLYSo8"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.9f2a98cb_1548511569591_0.5729903314793736"},"_hasShrinkwrap":false},"0.17.0-alpha.c7268cf7":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.c7268cf7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.c7268cf7","dist":{"shasum":"1c0e6cc7c671f986514a8b664101334a9bb17965","integrity":"sha512-7yHK+J8Ym4WI0Mv+FPXDWCrp3LIaybBXC8jI+Af728XxTW7/PdgPJYOtlLqk4FKuGIS5fmWeA2AUJFOUI4AGeA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.c7268cf7.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTLsTCRA9TVsSAnZWagAAjm0P/RWsim9fbC9j9XOrXhm0\nKpBkXHx8SGU2lYCdT2mVCT3zkdjOR6kyuUdM8pbkuoGKKoe2wiuQpa2iprc/\nPoc15GX6YlO+IH7w+Fa2f6VCY7vxZ+Zo2m9brvEJ0dzrKOa2grdN2G0s4o7p\ng5vE+S5Hl+1xuSr37MFzJxgIXEci4mGelXuA9Um/or4ovglL74k4CcK8Twr5\nt07c13EsDsJSgQCHpFXCV+sBo+/wo3cO1fYnrvFiYyiz4D+4wRbIMbzmevBL\nTHUXigrBzJEOOCTaMX+TWgc/ubgKIm0KNFlJlk4HZqCARO2EFH3TGaRmmYqf\nTHxxN5XdTrh+uWTksUXGHpmFYZ3oikPyd/Ro9A5/V18pNwvrkrEwA7ghJTe1\nqcXcVddLFIVjjDO+Xq7j7jLnVVmHvW5iNhdDXBgresQKZZMCwQcJcG/u3c2i\naS8zatuJlQgoO8DSGIpM0i5ka+MQG7Z4iFVV509W7V2laOiNHw04dr1T8L2+\nq1KeesUZc8GwuLY3zC98Z+qRVKhGlGT3XRFMRoy3/iMkBhcXaGzHX369TWng\nrS+TKMCA6K7TxI7ayukk+ZS04eIz+3nko0Rw/zBwRo/tHoPVEOmwfkeflZ59\nfdizxCBa8Ff2GPFgpYUNjXaqLDR66Cm1ZMzN4tG7EDoclOCYCAI984qdLbF8\nDjO5\r\n=XFNu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGWuTdE2KaZ5K1szIoRSfnRgRAeNzwCV/V2yXcgNbv13AiBqYKoFU2b267lSAGL2RG4IjmoJzQbNQs0ucQMF2PN0Qg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.c7268cf7_1548532498749_0.010748597003273241"},"_hasShrinkwrap":false},"0.17.0-alpha.7f30b882":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.7f30b882","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.7f30b882","dist":{"shasum":"723533bb50662c2555a2b8401e00e9aa4b8a959a","integrity":"sha512-X6UFSOm6U2gjhvkeBQTccG8Dprhx/63L4osxm6IiVPwkRxk3nON8WpwKvWk+FuGMyFXtIRkzAHeZ/Ld1qDl/oA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.7f30b882.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTN3ACRA9TVsSAnZWagAAKxwP/i65yLOS745o6NwhI6SS\nA2O9AffesU85bXSg6pt486vPikIv5MU95M0TL8JbJ7ymYPIddj07gnN5MUhM\niHcpHaomxpIRXaeZiu6tqX1XgGhhPW5RWK4TNGqMSwRobyw9ZpiVBXuM8cfC\nfxnPhCw5La6qGLTIILbjyzo6qHopwQhvJZlgDILwnnXmI1annuq4DnIM4Dt0\nGOwUhFVQ1p11183KEHmJL9g1Ks9Sy4hx4JPaYbAuTKVWDtMg4hW8wHs7kgBX\nfRRCFcANintcBv0DK4fUWzbzcQM4IbWlqjWYqgvUN94x8P5CB2YjHOPGXau5\n0s4eYvbGmSGwqUqYhSbi/x4tS0F2fCJOgYO43IClGbcAsFkCI+0O4NOg3tO4\nGajAkPFLb/Z/zSjqKqlZF6gII9BvagsysUPtjyYyq+MU/So3A7MSIa9V1DNI\notElLsO4CX9F4Vt/NUlp9TouPCwkCQv9qy39IpPyDtFY+8GDECxS2Nrf2+0R\n7JSHRgPm4rXscuAUOCsA0pIYgkvABg7PJrf1zj/MMEt1lMl6swslNSsbZT6o\nCQrrBUPyRb30DwAnuEuluo5qOwZiik4dPKFFqs2Fz5qwmi5+tKwjblMMKBhR\ncC/J2P1jjSjTKPwFFX/AGHuS+QebgbjDzMFlHV4rDjpVmGYiWVn+pcISREmR\nANnJ\r\n=+yV6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDX+1+i1J5ZrgLDx7WrkX4BtIA5+NpjtLJJFNKHlb9lJgIhAMqL65PSnMjfOzC7FTaIJHWQ4IkSRPHUpa4uoAUZF+08"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.7f30b882_1548541375647_0.7762647817814539"},"_hasShrinkwrap":false},"0.17.0-alpha.58610d15":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.58610d15","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.58610d15","dist":{"shasum":"c58075bb0daf282e6ac35f7bd152ce46fbd05323","integrity":"sha512-rmp2u/P+QjuGevJUko3T3qcqMOtqfzr3KYN/4jlhJ/JKfYUcpfJFwXaELVXxWY5BOdUd5nqClWfdXgQMAfcN2A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.58610d15.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTqRmCRA9TVsSAnZWagAASDIP/jWDQUPD8AvyFghxOWiw\nfWikog8RR88ZXL/EnH4onEUpmEzwONGQsO5tJA76nJF1ODwRLmDdCqrc9/kU\nq7nGDo3BTsxLiUSQ6YslW8sUcZSL7VLTF5mA5dGxuR4yvdYZ2jbg58hytxhD\n8m61R/XnS7IL6r7reluuDrq7nk/H2ruwfo6/hnLtYjX9yfqwLmyYahliX9ON\nSU7RbG8XpJ9QhPR+AX8Q9LwLuB6U2Lx4XsQXPkPRVPm96ra6akmm9hNAJ/Qg\n8HS+MceDJIpK114Z5JFnjYlLKCM5KMoeKqypm+KE0Ay1wq5pW/3RS1CjyShn\nGYvxP5lLUndyizUZ3kzDr2oYobMuWrg48Gqk+YpXtwD951JnGc0afrYofwyA\n3Jk5Rvxs475oAo30SI4bZi1Sv/voOluVmrlUA1WavDIstLgHzXCef+Gdgmo2\neZp1APcLj81UHVmh9s0JJtpLcuX9MHxQyp0xNH5eP6CF2bB//Qa57o+xYQub\nGuAKmw4YohmjBMM68482JzDIqEbVTZufCw3WxKWPAjlZDDLqQBuMu+jp7UZU\n4D4HGQ6Ok84FZ5qD4zoNpqVVvIIyJ65726RPKgO9tJyxvvNIigrXekfnv4rZ\nT4fEzsQ4Jj+3LuEwXPSyXmOh2yWUdA19+9bYxQQZ5O+bAVb/LQfs7QsAwZTW\nyp+V\r\n=EKzs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCH1NAWZgubnfHUPRc8JI6vNBCygiUmsU4PLKXdFVJUwkCID1XKliZcPyNz3bhgqOMaj4zdm6GA4Kg8a1Qt/of6rLl"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.58610d15_1548657766211_0.7495758563624149"},"_hasShrinkwrap":false},"0.17.0-alpha.9d589b94":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.9d589b94","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.9d589b94","dist":{"shasum":"115626a1bc55db3cfc7d8ccef900b09b085bd45b","integrity":"sha512-q8164z241cr+Vk5iLbIRcgn5u+kvNvuxnCMEPkWWOhZ9FzGSuBcZ5JtvEK5yelV4tkSvYVODlrly7S6AEo2vNw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.9d589b94.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTqRzCRA9TVsSAnZWagAAsRMP/iU6Upu2PY+vGYWhBWMf\n5hxrua12OntPK5hIAC80T94LFW5aOSqN5kPaRVgGtHFgfet1iloniEp9tzUq\nw7Xui8FxOoEDunV8HCXhOL0FYZoRzMPTWRQc0YlnRuw6G1TQdz3JRHr+UF/x\nKZ9NDvFcGo+LbeS6xYXNM67P19m16pd2zJGiaeaPeVobKqijfrar//1JrZbu\nhJQZfmSHQxBDIra6xBlHIcVTcRptwoaAH+bRd/nBRYPpJtwABwJxvVR0d84R\n0hUroZN0wS3lAIqilLCnw8ullEihaAeepyn0xY44jIRYTdKAA91SNn3OLiCa\nPtQmI0PrOHxuXTz6xrw3uOQ6Eo6OypQh1Iq2/aJGllWP+qgvJRyQyW6eEXVe\n5WXzzVi9LaUJXkg8I8aLecdXwZQnU9it/GY4CK90P3IkjOFjFqNIfje+E51G\nqnRuNrVxS0TKu9ALV807MUo+oXEsFopu873gWjYtBfwZIe51Y5rMUqliCaG0\nKxZrZDucKd7QJNfkIR9+CTovq0ezZCY2XXgsCRz96MVMFPvLL2r/LThgEpCT\nKvpKH9V9oiJc1l4LZ99NNtRevSywHVstkFZIYpSyTnf3pOazoeumHzgmi9s6\nKpyJxqAtTnKfGMaiicaPWpbZSKwcADKkGuSmqsZAj+KWcUN+ySN0RaDSAnfU\nMYbp\r\n=b6bG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhwQofon4DTa/5mMDsf3hTejIGwek7YgBFA/SIoPS7hAIgJj3irTJ6rcCiNqkrQjVQQgruvTGd1ijPeQcE65BMp4g="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.9d589b94_1548657778845_0.543076552200249"},"_hasShrinkwrap":false},"0.17.0-alpha.b52a7909":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.b52a7909","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.b52a7909","dist":{"shasum":"88c71a3db74605fc7aafc3f2f51dd496920b059c","integrity":"sha512-wI4+eIn6behIPhGeawxpD4EKH6bh1Ltfdc3CDa6wVZjXnrbWkJ2IGUxAZZZbB61J3t9e41u+Vkse5wz0U0lz4Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.b52a7909.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTqR8CRA9TVsSAnZWagAAXGIP/3wF+YMKzt91kv2UsSyx\num5LnL25gP1Ik8KBlbjGMBw3wFur68TELH3ZScG0gCpLqmWaiW9UXBe9H9AE\nll7u6b6klwLEtN29d11L5ZKodtcJgNNgCklOF1k35TKONMBnkLHH6hHCtbys\nkkxw0lI7Zk+kzc1ZM2LDaLVmt/oYm9saQ02nJwKBadNVyp+ooYKhq5g7r6EV\nr6wf02L4UV3qSxf68QFUaVLdx6p6YG6z6mKISrW/cjy76/xk13mKzrwcA3eR\n8t6VfPsIUaMx10gyPdZE7D02kTop1SpwcemeicOta5NDeTqh2vOkKToLjNLV\n9TpCU8jWpx3CCWfVugt5Ys1YABlVgYVfsCnclTULZONCRE6/bwWSchuxx+8S\nplj8K14aLaINacPeNk9t89YMlZ7K9pSLxiCEv5IJCKlOo3j8N+477n7zN73r\nTXC56mKaANeqYx9PJ868JO5Csb4cP9/jluv+OfurXochssFQ706sGsLM4d5f\nhaendyXvc/EDDW81coWNmejCWl518ryKEYdPx1qhPIxGANEuYsgQIZvel3PE\no24WkugfU9gLS8vo9O+wGSKqSIkYTLJVraSzeJsZ2ypm+HV0Fu7czyfpe7cO\nEDjf5sxj1iYf3C+QXyhffhZmwHu15GAi7GFUKXedx0Rhth7huY/UuaK1Byxh\nUr6s\r\n=905/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHYnBPLfzTgJ7AyEhziIGizzBYk6dqhU3onCRc08HqhQIhANaBXeK0v4ojTxHY8XUZGbEMnkJS7Xq/tWY34Y6I1oJ6"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.b52a7909_1548657787635_0.14379999786298137"},"_hasShrinkwrap":false},"0.17.0-alpha.7b635c1e":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.7b635c1e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.7b635c1e","dist":{"shasum":"3ff7bc453b982d079bcedb5e07e0572bd0350166","integrity":"sha512-tqYqTtVhzlP/vWr49TGEAOlKjOcbINFLCXPokuF1m/4Uu1r9WCSmaoVfxC/JqIH6pAzaH1kjObaZn7OQ9D4bxg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.7b635c1e.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTqSJCRA9TVsSAnZWagAA4GgP/3a9jUmm+QlstuwdLMxu\nBlC8ptvXusZW2SJFzVoTpFydkmBRjuEgetGEIIS3fVqnbVFP33+OgDVlNu9X\nsacYd2wu2MeCmy47SM533a2tpManZmwEgLGUhMQX/Z/vK5v2CbO2uk3kLQ4d\ne/pS4PkqJqqYON++skbPY7h7HLPlLD3vQu5bcF9F1y+Xj6eM0ilMeffeYzuj\n14OktKw7T0w8bx/Ne1YuAIMrHzbzkqJQKt7xthpkZM3o5lSr5jhO5NnGz2bB\nk/N+0Jl7qrfbpIOgaGFLL4TaL5aQeszepMQ2aQ3wtMohYj/b2snufgFH2MJI\nZ4c7OLXbw1SsxxCtgFXI+4F49Noa7ssMRDyW2Vlw1cY8o3/C8Tysr2w8NMvt\nEcH/KqFmGj6JKW4RGkW+InkXe7FqT/2l6+bHqyQnMWE7F2NOIey1t0qtIwq4\ndBRvTVPkFaAvLj+cwnRjumjoJ8o6afeU3j1pHpGysw1XzXO4tDGs0Qu42zGb\nE3l7tvmPs8k1Npa/JWdQho1h3UMZJBoqfYBizwymPKggf9SKW36R5nb0mc/T\nA8StYebgO3ws6usPCMBpsTfFMS/5H7HRycuDxkqd0okHQLqHpNkN6CNORSWx\nR1yoBmFyFr0BE44swwPkBrWTOZ390z66zRv7o/KVsM2/tsmtX4wXD4hjoAM1\nOfHl\r\n=hlq0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6HQEjEuPBuPSlad81YFcRZZN0pNxIK7+Yyg7iEkIABAIgOcSQDSqjgwYf8BG8wSCVWaiAdaj0inCQJEHseM0zBf8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.7b635c1e_1548657800567_0.36666575167919"},"_hasShrinkwrap":false},"0.17.0-alpha.1d0aa274":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.1d0aa274","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.1d0aa274","dist":{"shasum":"5b9ff12438c8ecca5535c5ae0da35a07a2a2a4ba","integrity":"sha512-EElYUyAAuLNUlffYVDxrpDCmek3czSQHiEBtNuK6QtNqxWc0JGWrnkl69EcFzKQgODEC3UB+bNNMwANAhHJZUA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.1d0aa274.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTqWICRA9TVsSAnZWagAAeqcP/jlui6pxXN8vt4wBt2NC\nVbzmZFtSWm5mnT+5I3dgfmCq4m4FFMT00fIGJEiWn52X8DZn0gmuj67E8T/M\nx3FaHeCm2ZYUb3F4VTrz2K1uvf2winmOjtWaSX+vZdlk8aNJMK6yGunm9NAi\n8HpsZsku+ij5J1+uF61n6gvWYDnn+kxZbhnE3GaefhDYTCzuXYGLnVXSg2Th\nr0YoSwVabOrznJF7YsnK9sc7TmRfu0Rsx4q0nIpjSuD4XCz13RZiBO9Evsil\npWyQLa1dzvOHaD6C+BOF1skJTn8HphBU5xry4XdKus4jY4erNZS5xs1NTLDL\n3MEAed1dviCzDjJ4Hju00DtScyEXWh7Bwj4LklQPBa2ZxPzKmeoQ9IxrH3X7\nTpQk7XURB81BiEPE3GE2ceD8EGplrWxXZ6I2RZlDOSwyHI0jC5i01wzZnZuw\n4VHV3kSkkQmE0xWkzjcD0SiMQJuoRz/HIpP9NXMePowojUqYnZL13Ymbzo4q\nN7vkn8rF5t8rewBKSIM+mTfsrstiq0H7u8Ylb7xHn2J//8Q3tGB3dEruwQZV\nzmGRmkyDbcCfQGXOgQIDn9UMqvktcMop9wU0EWPj2Y9BQNdD+dMH9qE+Gdas\nuwSVYmO9HTBP7VMJX+aeEGVGUz+PEc1DB/hEBodHVOMgy4dAcOrzlBxS+mtR\nPnk/\r\n=ph0J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGboVCS3LlCnzhGtzWn2AVzJtiVx7igp7hthZ8GaEzqdAiEA22K87kNr7m66BugBsYqWm/3DGF/ZYL+KfVD5MBVl63I="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.1d0aa274_1548658055563_0.11634858371360357"},"_hasShrinkwrap":false},"0.17.0-alpha.6f188ad1":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.6f188ad1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.6f188ad1","dist":{"shasum":"cef4159fa3b86061d82b8e425f0bf49cb1dcf467","integrity":"sha512-u89f6qf4Z9siZCf5jRbIY/i2qiW+hjnb3Ux3+bUPDyvj4XwUg0IVZT5bULh0uPOysencaDWY1WpY1zCmpOg51A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.6f188ad1.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTwrICRA9TVsSAnZWagAAOjAP/1Aya2SCz15A4bEBSV6j\n+HXil6kUEjfnH+eD67E80hlGjNsUuZWCZSCAy2gjhJuTqUyBfNBY7lk7QBQT\nOck7E8tXdXgTLHg2xSEJmS/gRJELcQFNBbpErBhHk2YIV3SqWqou8Yx3DuQS\nX4H+2IdY5yq0GHaOEP+w4ZO1SXIE9r6Lj4yLSPQrA0obanCbBscE7YJJYMK7\nVkABR4fRgxBALcppAPVjer6rIYW1QuDruy5i/8Pb3FUJiC0vqDELcDTqdnLm\nQEq3jwp6iQZyuFY0EUbgNp94v0CYCzztzj5H2MsQYQvrTLJVGkjMJ/js6jsL\nANA/0sid0p32+M/ASo+s1Kc4qeamh1heALqAD8Ayto5pIdrmr1PSatnv+5hW\nEBYXek0KuOrf0OYI9H1AIbPbUFtN8fi5ZvCLD92VTBOlQGq9MBgeYdVREns+\nnTTPo6erRvFjaC0V9ok3MQ1+mM22i9dGKyMdbARZnZkLYhV2UpLg9Ia4hm7n\n51WQBiqGTRlBvXSu1bA76C4V9IVL9pZxj6LejNSqe2f7ZmZn1w+XkJLxbAC0\n/EdmpJdC8xcnrN1tGLk4+jHF8wRiN+X2VMWeL+tYJOZAPugJg+w0/u3PqnWK\nEpZ5u4YjbPHMLXwGG/IPXpJQfu9NVz8JXsr9tCJP6+5+k/y2jGZ6tXZAaUak\n5vlj\r\n=IQt3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAlY7vsOGrsvmnswhW21MUXtU1wmdsEOR2YFKdjFKJl+AiEArUZVlFz1SQgZlIFSUNkWy7ww4AfRw62Z5y/PzKKItwc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.6f188ad1_1548683976250_0.5603799832476319"},"_hasShrinkwrap":false},"0.17.0-alpha.457ad1c8":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.457ad1c8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.457ad1c8","dist":{"shasum":"cad0ba7d7e3e4e76edc694686367de6c5421d4c5","integrity":"sha512-VuKjOqjZ30bx2gm0P8FNE9S0ghLiYadPJdV0qJsi128b9AmVcXVs5tsn1sLjFpUNyzPOSjFEVN50sAORpoobLQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.457ad1c8.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTyt1CRA9TVsSAnZWagAAGUQQAJdX9v8jrrt3mio9eWuq\neRwawTjdHUa/x+tXzF/BhagdwOtewdFT5xdhE1XhgCdMpKJcJeQafRkTTl0d\n1+HwDdmCXgMvmE2a65tI/iIzgYaB6L0YXoi4C7SZEO1CV2Diek4Feb6WSpqz\nWHzOz53pT1jT2CjsXSenHjnv/kj5dhxWDhoYFT7yQU+tYclk3C58Fp86vDHb\ns4FbKEkNflOiSZspIvdHmHXJzR5c0kTyXYdHg4txRKvqF2MeHFGYKe/j42NY\nW5aXC+A0uQHBJpFjGSEDIn4xnEkqXAe3fXn+rRoa/7k01WRhmQXcO3RhsCDg\nMtIbODUzhgE44QJwsZGLmVwE7VpSg0T7POLZLSlAZeioYPki8vSZPAitcT/j\nEfHup8JHLVCdsZ5V6w/LT4GWJQSyEn6HPOWeoHxj+ma3CLUqLPgFjeL60lDV\n575fUVr0FdNtvqp7LjHAEgqgEI2yTQQCVvfE6Tt2FXEFlbt4fvVRTVaoZo68\n28Jy0M7r5lMdq81GHbvv0l2W2uIhoqoik2uEDMV6zoBWKxqdazukVodSR1+d\naIsj4/bLBKLYl0RXfd0owDqEoDsWWWpoOjAKgB0hSodMMXkY1rg2jktjSdRK\nq6PY3hNrTrF6bk8LFUiT7W/dOWa6zaOck46lbPbp7kkSXdCRP65hS/R7WXu7\nvyiJ\r\n=zuVe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbD1vlTNY2nE5cB+UCojVg2HOom/vhfIfibuTUKi/xpwIgQeibx5lTokyrh+yLTCQXnbNKMSuL99x9XQbxgavvrKs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.457ad1c8_1548692340699_0.38463562749224045"},"_hasShrinkwrap":false},"0.17.0-alpha.fe7fd51a":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.fe7fd51a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.fe7fd51a","dist":{"shasum":"e727d2c0b9feac7863766039f9e57fcc561d02f6","integrity":"sha512-TXT0uXp5vG6SnT1J+Ck44zUAX2/xa/uAwPazUabxCClCzPw9dhNWmTTaCtypUzQjQwgoOxzULr6Op/thgZV5IQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.fe7fd51a.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcT6NYCRA9TVsSAnZWagAAfJEP/2zU2xoar+sIWNg6+P/8\nUEngGfX9XDjhpi4yiUsE1eV8LYb3m+M8kfauvJuVTuuSxLGL6Ru+UVpQLmwy\nLDTP0ZTnWTaZGXJOPFcGM0K51tYQzNYLze6zXOKZX9HgGvbqP2oJXfVjzSqp\n0Gee3MjrBI7vrAMPhZNYwfLk8K1MoQHXteafl6/an0xsAk1NJB7Qx0+Ck0ci\n+KEa2hqgONhHNlzWvOLC0YWbNodke0nXr/C2WuibKJNPGXQS6FeZtXbU5j/3\n3SErTRR+tCRAD6l6iOcKcpUdfVBvrN4hZDmHsAXCOiNPRIs17SGeRHTDjNBP\n6Nq5LzCZn+a9UjeZDSkIVmXU6Jvtyo13Kz/gY6a6xxIGQdHyZA+oDvcaKtbR\nKDgF9yjhBTHdO8BUgieG/cMwhtabUnQ68lo431VYPTAiX/B79/KOJawVO+hK\nY26NEam9S25nvEMkayZgKfbZAJNJ0la1MqGQ4RRA3sVKa/SVKxEjVLAs92d4\nLQGXSiJXju6AZodAoZASNMQI59EFOQ8q+GQvHuniApVYYDfCTpq4Kc17gYKz\nJiNyF0yKCXPgKkQ2dylQpfnuDrY0pHlDLA3Dko5U7skjBQFhJSZCczrKefQZ\n1vYXVsSAksPNQluCVnqzMVLbKwFIvxT6xZboBVZIBjYRFLHmJ4jwEaUPL0uw\n4UHQ\r\n=PZ8w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEVOldaSVJjxbWrYj/qnCmjRuVDaiHV2QUEC6QQTc6StAiEAipu84ws4xHXB2SAKuFiWcpZTabUzAKqJoKGr542YjWo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.fe7fd51a_1548723032053_0.5298178993878004"},"_hasShrinkwrap":false},"0.17.0-alpha.0c94f218":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.0c94f218","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.0c94f218","dist":{"shasum":"6d583ded2d73deb58a0c0cf3c53d2f6664240799","integrity":"sha512-9E7xct1xzmmXJ4nhQXaRUkEthjRDH0oR+Y805XNcUhFy/pMD1nXgChfy993ZTV1UoCFtyyRmb2cxl7iX2cT0bg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.0c94f218.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcT/KPCRA9TVsSAnZWagAA+eMP/RS/NPONuhP4zgXFKr1n\nR1NVlLyjFYam40D7O6+YoWQzTDR46bj2uqCcOjAxZX3jIJ3cElhCRynTwDRl\nwQQUj1wxP3dORIiX74SXRk2FRcAxgYxQe46d6pEOd2qLz6z+ERLqk0OMQ7+d\nUBNULsseGhI02swjFMPNJ3+sL9sIXDk3rSi8TwyhHFBuc+KwpZoY2l62TbeP\naN+SxYIMpIQ2D/HUfxU376VRqgAxWFhpnGnQ5B1eYAXKxm8KaVYcYe+CemV7\nUc3XUmUQHG3P06NzLAm/dGSBIYvNQzCoyQPIt79GnZsh1ccV3qjpqTcwG/c3\n6jLSzcjhqNlh+pFEUDf3nVMJCKgZYTQnwjE7pLnpvAdiRzw4LrM8NDNYrdpI\nzGbvcy+C9QkMoHqPqSCyHrxsHAyjwky2fd4exyN0A1Wbvv2lD7FOI+TYUnln\nMAFYXhsw6vyMPFsg5faO3cKvYh4vsGP31JYeg+Tf3w+QV0Xr/EU6DsRcIptc\nt7Xw5g3W7X2bHmoqplJ870iIMnwkCgc5qjrLCbfy+FF/YCpSoNx7cEop33jR\nmTUZS4/iUJyFjBE8FsubU6hcYq3Nc9sCjHOF5hrrpcwB6kc+eYSgGqO80Di7\nERKh614F01Cs4KHdxrnAS+B/1igC7pkovmKbgwj2ER7WdUIZm5An6+brQ8If\nRMdY\r\n=wyw5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgFau+I6ma7fBfNzoGG2TRytptMI7YElKLIivK6ISPhwIhAL5DH4pghSjU8uKNvYOJMQ9I1aLN/Pa37fkOe2naLrpT"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.0c94f218_1548743311229_0.6655141522834362"},"_hasShrinkwrap":false},"0.17.0-alpha.61f01d98":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.61f01d98","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.61f01d98","dist":{"shasum":"21b84e6ace74713ac6abd97c57375020655cd55a","integrity":"sha512-oNlfHyBj2KWMBrnkXoCqgqqi9WxUYWzBpeCVkaUrvLgieR/1hbyop0pOmBfX4tsieDQWq2/bY/jy99UwfOvMUA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.61f01d98.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUAyMCRA9TVsSAnZWagAAhO8QAJTVn7M4dtpBCfdLD4g/\nmdX5ft2CfQ54XCuu7J4yaE0tNtbPjnQK4xAzN3z9cFkWrsR4d7nHgIVXVtGO\nWCHge+A9kAU3xXnfmyoKVdQ620ecsEfX9kBR+YqgNDhkOFSD3fVAwy5jcIhg\nuGCV12yDb6UUOHbdkb0RDeQ30fd/kFyn8+CsfbbHpN/bPfpgXhaejAHLJuHj\nnN6o/QUau/3mBZS0cWPKhBB3Nbg70vUKkdteQKQ74c4PPp+keY5VsuLyRt4Y\nsYUXgkjJsOrnyboXK4V6qUsWLGNXkg0zxcOxhuk1CQuHwXak7+NgZtUnqZF9\nDB3vKgXGy6iVbTDh5nruvo8zwsJU8MNJuy7Po1aaLLjdRWFGtrHTwVyyjwEj\nQ+kvchKUOcjpBD4uxSSylX7GUdWiKU9j2KyexK7Fe1EbGs8yWOgyZoyaTkKG\n7qwnK3tZTyQAOo7TVRztzhRWd+OHJWY8vVUJeu39EI6lTX2XtENOAnGJZC+a\nVIIitBSNz9IpbJJ5zRv6FhFhSFaNVulzez/4/ano/nEjuf8uodOsPXdLZqOo\nPczqBXVgUz37tqJY54aOWRX5RJE9HsxlIMdCvM+TIxHfzNqz4fKQSO8yNBko\nqjdOwcazbzqE8xPhm1vOnIulkBCp+BvhdLlPzMIvXVqyETYcNeHisgLz+Td1\nd5Li\r\n=Uc0t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAeSsQACLvjY7tBH0en2g0tJMlK88ba0YEHhCyhSA1bWAiEArBtlr9pIVPFD/9iOkmNo8/yRVi27Vl2LpPPHKSONKg4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.61f01d98_1548749964110_0.8657319577378266"},"_hasShrinkwrap":false},"0.17.0-alpha.2154faeb":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.2154faeb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.2154faeb","dist":{"shasum":"97d4f332dccb260d0f42acd661df2c504be74f3a","integrity":"sha512-afchVG5a8TA5gSN6y2HWu12uhVMng9Knd6HmXozWDiCPFSd0TztWuwscWwqIiK/o/2/MAjZ8FJFilLuKyCjAsA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.2154faeb.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUAyrCRA9TVsSAnZWagAA3WsP/1NkXgeHH0bNIgYQy2eG\nxZDkh4EsYmv9PRvWGZ7j8sJgAX56+qW3vN2DX6FAbVOmlKDfWyBjPU2X6jyT\nDKRet048TtikEoMZV6yVsZXaFvWuex4J2EVuuXs2Wo30xolqk83EmVb+0Zv1\n/QD+I/q/UtKqNwxXabK6w09M6ue39RzWer9RjUC/bUEmGqqoOUBTRY1oOLHi\nUg2dhVLFD2VYj9pm54rjqvK4ekvBKQ3RgDOlYcnhfBGvXQ9gHR3s+0QBGcOo\nYiHT2e0amj6RvCLUeDg3AHL4BUuZady46hl4Gpmf2yisze5ca5HerC3/GDRN\nUh1gSUOJ9tu6Atm8Ksl5THkA6z0mrD7irpBOLUvIySGb9xlNHmvtbocvAGD9\ns7esGYw2l4/rF7+971TY8N0yMUttg3VU7tzGM6YE2h2O1Z6dUBJc9PiFUnb9\nF9SBFtmkVbJmQtq5GwVFF7YV7AZW+3ob3KyxWGR6N7cCbZlosUmMww+9WiSD\nzG5JjrfjLdGQgcNNqcmBLc+sFoMg7U7nxwufOSIzVeLuAzTDuHYTRUxp4axi\nEQSFAQrgrxq7KMtGdNnOFFWPKS2kV/k1eERPHKKS5F4KUDvEfX0XP2Qgnj0C\nwHnk6FuTm8rlnB7/H5k5+x3+PIzwgFkpG9PGkcAkKcJZWk6idRXfvlc1mFzX\na5MS\r\n=WA3r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGnvDZVqJ1nIE6eWY/+UD9YsQRXqakrVVX0ZIIUXgEG5AiEAydtKKkoJKYLxC8B6PHwbOIk08aM0MWZC3qol6tUFydM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.2154faeb_1548749994377_0.45809264408071537"},"_hasShrinkwrap":false},"0.17.0-alpha.44e983a6":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.44e983a6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.44e983a6","dist":{"shasum":"d0bff40211f4e03bafd32309acffc9af8225113e","integrity":"sha512-cHq509zm+3foAKHGkh2ynYb1FbUuWYksNI8IzicR2NuI754e1B4c64iRMvgxZ/C64bX5moiBi25B4o8IRgylVQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.44e983a6.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUKYYCRA9TVsSAnZWagAABbMP/1lvfKnNg51mh6RM9DCw\nr7opR6bkl59EjrijFId6Dqt+lGCVczxiH+ZC51EQTaBkjZYrmwwf04s2QWIQ\nodKbNVtChO546CYvsnnc/Z8bida1hPc6dqsR83HlZxaRhRVCJlvBc/YE06i6\nLwohjNOeQyDR1yXPkp68ZdbGrPr3cwY2573YkwiXNCQf7wEos1EzjGJtPIcg\nxCsGb+Vs5gjGazNOexeLZxvB8ur16k82UOUzUzFOA1rUqXZUW5oJbaNJvDdE\nTNIW35HemIp9SHQfso09yAZ0QFt1elPAyq4bhZF7eVXpaqf/xMCrL79THcg0\nhSYaJEFmstxsC+YlqNTy1+pdXZWB0ROlbWvzmsotLVLIdBHhlEqe58Lnab5d\nNqXgEN0DHbt6zeVrzjBDpJoIrcLmuOmj5MaR3A7qlTcrUpf4u51FR/35HmQj\n8nLDfN0eOkqwGNUWWl05E0WuBaj6+YK/EejgddJ8UeS4er+Gsth9wH5cXzKc\nQgpACuSBIFUU/XomBl7Yp35be+uVjYjRDL+h9ncIbfdolmtrBhO7QUX46ZjF\nEEF3Mw2Lb5fPrOtHauuP9vdLFotMM8xfOR6/QhE9130HMycipxENw5GGng0S\nXz8zMsPvQU5FQvvnATWKAWqjWizqDLf6yREmbZ5Bcfn0BaDA4XHIyA+kY6mZ\noTd0\r\n=ZEMv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDs3qOw0LVZE3GI3Bg5UCfcgoeemZbJL6qrtLxbBfkJlwIgdXhv0tnxzkofFqWEA1xoTX4cJ/A7TGN6ls9uTXjGK7M="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.44e983a6_1548789272196_0.793857472229291"},"_hasShrinkwrap":false},"0.17.0-alpha.b7ac91bb":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.b7ac91bb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.b7ac91bb","dist":{"shasum":"c23ed7d15bf59fc520fccd66867d29752b1ed6f7","integrity":"sha512-HT84rDr6Vs2uX//eF9OiDqZWmOzCrQxmuKsTKyuBTXc1fe0h7En3rCUecI4yNK8WCbbd2AAnTzE6wnpBvzd8EQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.b7ac91bb.tgz","fileCount":22,"unpackedSize":16726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUWQwCRA9TVsSAnZWagAAQYUP/itgpo4Ln1GhPv9mslcp\njYiRUCHi4/qHbNknydTk/uzYP/s5uIFOcbEaxPNzs0wVv2nsSE8b2dwDCCb9\nQUo+0gMc9/T0GI/5e6gymQWyE9FnhoIfYoi9QERCZY/tfVlRfha70oT/KcpX\nvx8mmOGcUbRxjN+cGznBjCJYNUV8f84kGzkFYoaJ5axZ+4k9n3fTXTRMDo+Y\nnj4ZEkm3wI8l+RopEc5HuYz1NaVNQZyr+MQ5L+xclB/OUU0rk342nDMV1Qzx\nxrembGJB7jaZ4/dkbskB8eT8jiSHUEEqyKguIq+OokAqZHeCYxg2AjtAkJwJ\nMedTQ2ruL+U22amZbXEOFDmXZgZBz/jpe8mpSgsnRF9EAO80SPQB/sMS31/Z\nmezJaCv5uHA4lVv+9crNPZqXuLJGTxyy19NI+c3P4UEgojgeyUrHXJuTPR2e\n3wm1LZ0Q9feHwyDxqPC/rSaUxTuUN+F0/k5r+yPON+cM5hdVdVv8U3p8h+nO\nJ3IA5G/deGJqALfY1vJ3YpR0p3eHE5N7sklvNOG96VRd82jvqvOOymEvoD6i\niLyUEpov+z7yhFsPOt9I8eTx/gYGSZgr2iGySbhKq6Fq9t32VkFIQn9KVFlq\nZtulnzHNKuWZR3DirrMQa5Mr4qqls9Kb5bfb89uQF1mpbnDY3awmLi20F0Rk\nvyEI\r\n=eBDo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVqMAOcMNg6wumJhj+SUOSW++HxHi+oUuFNbB8U2RpcgIhAKO8DDK8gaCxsfInaPjwau0mQpNAd5U9cxrl/MpWFeqS"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.b7ac91bb_1548837935203_0.26094261245577477"},"_hasShrinkwrap":false},"0.17.0-alpha.eb9d6ff3":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.eb9d6ff3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.eb9d6ff3","dist":{"shasum":"4ebf88a2358c3009bb4a7142efc5ba83a2c36bf2","integrity":"sha512-tX+Gc7Ntj5OOaw4uLF1rBmguUHVWXHWMzzFsoRJczgexQqQOHmszmX+Mj05SE0hROnqt/unNOOKRGmnj+vM1Gw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.eb9d6ff3.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUYINCRA9TVsSAnZWagAAxoIP/Aklps4qkEuCVP2Qpg3G\nhpRpWGqKucGFWfR9/7JSQo0olLLrhzob3rTRQ9KHzZzIJcVxH543yOy2LEQ9\nP5XHc/6kWa9s8reWxtIpdn/PlhW6MvuzDFvtiA7YfHQ/8Wt2k7TKMbzOZHdq\nk9Za1v+prwxh9WgIWYtFOqDI/9R5+pkT21HqB/F0LgIBMNnvMQAx2kJqiraE\nhvq2YCqgmZxLA7H52ligYqjDQ8kXRjRVt3AiuzS7SlwDoa+79/B7/mI1LM2z\ndf24ewuDb2T5/dt9mID98ooVp497k3JpZ2jvcph3Ajcx4GrVcq9YCulmYZb5\njUGM0ZB4kLuu4gW7rZ3ebiokkzdtGQ+/ZMk8VVSXuUGP30n1ZOmw7oFGT3ig\nbKBKlbFLwZn6RhANiRte0qD9IeNq3PNZSLsS1PXchw/bTRBxWezbTDwhbbnC\nqcaYCrbYaEjbYGPhKmBPhZENUSJ0B1GtDgJlwxfffrZ/ukGHXo085WMXHSP3\nbX6IcCyEvaHP+I90MJ1PlHwuAHcQj2AdJjGECDsZY7LiVe6l024qVM7+eiDq\nCBNa4g6ClldItUy40Wf/h+Cj+NjgxGj0DY3RV4zDgkTCHA0G7NnvOua5hEzr\nyvKUXeZKXPms2gotIcluamswcxb3u75MRxLHbubhgD5z6rNGwqri0UQM4ZQv\noIaz\r\n=LtPm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBFHCv23RIp9Ho9kjjhWMYhmccZNYWSAeIx3f1pMlQIAAiEAoQEPybghfzzTuIUUXfYcim9NUqzHxyx94L/L7fjU5uk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.eb9d6ff3_1548845580343_0.47899378572650475"},"_hasShrinkwrap":false},"0.17.0-alpha.16cdd6ee":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.16cdd6ee","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.16cdd6ee","dist":{"shasum":"28e97134ba36d148cef1583ae1e34b325baf470f","integrity":"sha512-3wEQab8IxZYg5kteFDMvA75V8GznUvvk0co7/vtyw0tSH64H1HKxG928ru0BwyCRr7jVcQEXK5cpuxJpe552FA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.16cdd6ee.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUYNlCRA9TVsSAnZWagAAJsIQAJdcgoXlXZI+aVvXE8mv\nh5ifLFZpjTabCFpjSGbdLHa6wQpgt8VWsv/rvnKj+x/0EBjfQK9tbrOoHTce\nN601d9C8ulIas0REtAqdzW1XQnsXjX3jEDK5Gp+O6U0Hn4cVkuw7QeipfG0y\n8vw/djbGaJ0prGNgOfUJ575e/RL783TX6B9iOzkxyo8fbndOesU9sPuleBkJ\nE4t74djWIRDFidI3PVIiQqtzT+mwtQMe6rcordS7mZb9n7Vy9VdrcXxP2KXY\n48vegMdkOwKX8RKCtnYyXCYM2oN3sdpkcW7ybQWey3VizHwbkLayzY9KPbpH\nN1Uisnj9m9toBQprqXvoGUlGEgoSs5quz1wpMTO/t0M7I5RwKs9QzwEHnngW\ngX18J2fe4nDbcYCARKfW9RCsuHCARpMF4lDkyJvCisQICwuI080l7YKMaJ7i\nuuAaRkhXHsAjr/RBs6MPzTPgZwTW/uXXJmawz9aZuxyUULYKJwB+ZjIWEn6m\nLu7dudq1dNpzSbAFGKCi6JWWvY0Gyq0NJieZgtZmH9zVz212O2PiFmSzqFmn\nuep7CCGue1nnK2V5lS+jhESDcWipeT999B24PeO+DQX0pf+/6uYvI8Teoa7j\nJbbW3ZjB9d99OwRBQOLM7J/5dbtD/dQNK2WqOYkzwHbin3WgkYP6DkVZnHKo\nKyjw\r\n=jqMU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICOItUHuXH1NgD8VzJ27rbVlX6WRrK3bZft/Cf8YqmWAAiEAm5m8/KjsA14Uuh64iGy00ku3JH+bwBBIja5moxoRCko="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.16cdd6ee_1548845924993_0.5599289991367926"},"_hasShrinkwrap":false},"0.17.0-alpha.1f181a9c":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.1f181a9c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.1f181a9c","dist":{"shasum":"6f4f27df53c118d0750e2c2a492df2cbc2d13496","integrity":"sha512-tAl6/LakrUlBXrRHq7fFUIC8FL4Hj4C1zRrmpex4+bb8w7GSHqsDq5TtBZzj0uLNoL23azs8bCaVu7s2Y1FMKA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.1f181a9c.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUYOUCRA9TVsSAnZWagAAL/gQAINQgEibB1jSu3qviirT\niSvtbNoY5gv0XcHVJBcPXr6rUKs4DuGVFKJTW/+Bu6VunUfZMm4VodrtgZdq\nExO3BZbSkClM9kL1AMF2Qo5Y8nTR5yk6RCI9jFzEM7IU54gHOHImtHgehhP7\nBM+88o0jQS6kWpf2Kfsj5kiau+cWeghfR4idGr9INPmP20QtTCeUfmq422bm\nI2saO7ypC0D9jF0gcUHzTJbEBTBvGmUDWZ+UttXJ+WzQuZ9tov+c5/NAzUJY\nblupMMflPULB+pEkaVhPcufM8eRGhymiWvKXUPVpsS+Rn6JB2QuJRBqNSAY8\nla5iBGmmcPO5bvkVrUO1mMqeuYIFNQ3H0KkWrLB+M9/GaCkWySMWc96nKuxS\nPwD8gHff/zTQyb1dYwWK+1dAMIdVWsPXUzBJsp9WeXiVCWMT0hGhy6K1VCEl\n2Q4+M0oyiLRWISSN5dExm+OzUxyABkaEtRweTP7dIsusEqLZJcoSbMSex+A3\n5n9pCt5RCqkw2pkdPcwQpvHHVWIoonhT43PYNLo11AEQnPVrC08Y/BwrwZgT\nlHnV5mNZtLb3vuN/a50fMniW7bWf96p79BHttlkWQl0boQEAo0KxzergzDwa\nxiNmgFZuu7BjhAIt8a7USJiO8iNmEa4HNezt2ZC+wlwDnBr7wDTnk5ebfww0\nFMh1\r\n=ONMB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGiapRZKZMETxYeNMq0UNgcfvVx45RE9Us9no8ib5rCWAiAIcrJlC/VnxTmBpA15WjrKoL1k4CJMQgNxUuPYgjXhjg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.1f181a9c_1548845971377_0.9121262401670869"},"_hasShrinkwrap":false},"0.17.0-alpha.ee165a5a":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.ee165a5a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.ee165a5a","dist":{"shasum":"e634dec375147990d49648f85e3d3e9f6eb0d837","integrity":"sha512-VtvDdutos5x/7D5Zx3m9BfFPPVc2dbf4JQXfjkTYO01Xxu/PvM+AoybW+nffJ1YlSqfqCAtREe4FwITnf+3Yaw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.ee165a5a.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUYOdCRA9TVsSAnZWagAA1zYQAIvZBfXqA3+2T0G9Ty/b\nCqFj5s9gc8IzetG6yxEZBgST5hVPFvGgUdRba1OlUf4KxosYRIrsLjnLtbAS\na3jeMPWZlAsmp0jyFjb0b5lVasMj8fXuv461pU2AEPsaJrGX5lTzSIOB9AXl\nacWJVXjcM1yRa6efBbQOFgcmC5FOdsz2p4mzzZbxdpl7ExczyH0mtNRiN0aW\n1LrCRUfN1haJlGllzMJLFN4CImEdokI6OP+4g/OXB8S9p43s9JcHhYEcY4iy\n0rCt4WqbznIh4gfLwFcJ3QTl5d2XYj85YDwbZhLAy8gTIlnZUoTJne74giKH\nimp/FeNn4fFPBjTNEw0p0m0GzDjMDYnBLJl9S1k3Qqz4l8eiaa2aWRh7C+ML\nJ2cvWYR8KgOVTHhbrBmf7rU6dV2Hd1ndhJHmpD5nt96ANNwiOoODcKCMDIjl\n0No4igVlTCL+2CO6bawsiiUFJB6F+o2yBjpXjXS7l4ViRZjLk+aG5XODC/x6\nXpA654A92fiJuw/H9jGhU33i8eZzYP+hOHe74l45Y6HHEMvlVCrBI3tWVB6i\netNEUVkqEbb8f198iD1g1JLdY5G5M7Ym68YHPZcaIaQK2gmJW44pkvBP6VXp\nLtiTeH1xSUbhniO1hvrmil3GLW7VtxxovtuL3pwd5J7KBT1lgydEVUjEy8M6\nCVfv\r\n=R+UP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFLOP18qrg5R1w/tA0Yu37V+du9uIU+9z2SF6nypoqgKAiEAwcpiT20D4aR0ee+hbhxgjb2YFWnm8WadbovIC+abGIE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.ee165a5a_1548845980496_0.5994696641766042"},"_hasShrinkwrap":false},"0.17.0-alpha.709ee7ed":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.709ee7ed","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.709ee7ed","dist":{"shasum":"e6af864694f89073738750bfde0deb2d551624df","integrity":"sha512-6l5WAIZGdC3VVBgO3tnXDLH4ct5hQJ2wAkP/2HYbELR16Uq/DrTf/1CCogFLIvFyytUxSEggBYTzR98JhjdE2A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.709ee7ed.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUaaeCRA9TVsSAnZWagAAZ5gQAIX4NqZghpvxWiGYttk1\ntPjV/VxdheCnU6CanPFswkpk/trnrsaRgPBIWnNZ0ts5Nsl+ZNCVOiHJu1rJ\nKF2HHLWxQ30CbEEgKlvmyxgbeppxf++VL9mjhgD9CJn2xuuHdm76iuWQ4GGk\nFszLV/Tin+K0anuqwSbukph3yLtZwNkMLV7TbudCAkJ60wtLKxDRX/Bjfjxp\n61qbGX1hHpgyq/1+Jj0NET2CXqmZIVlJPzmJYpPHdhjUq9ogoZwHlnx+zG+G\nXZg3V6TqS6iPw0evv8e7dChgiWjiwgxgluagpTgRybLK9KfcCfiz3+XiEEry\nC6MxBcXLmTO8E4lS9XT/C2UytVgRCuyxOWc3lo5zt4dZbe92a8Nzfu/66Aaf\nXDF9gfeNZ+qNKJkoOq/Gdv0gWWwppP1EDN0Rv0HcQHX7ufU1IFTWqFiioPxN\nEbTSLLW/dVSRidJHORgQU/BxUXrgUaonzofizE7+ntSuetI8DiPjvzyYuQWM\ns2k0v6Qcn6sU8IAO+C2RfUMJtOmM8eLfcsyCpVjwnmIjJumuTZ9pYOHQ4r+B\naM/thlFjiMdpE61Ge5Tq/kGeyO0G+0QCAwpsAt/AmRao90Eoa+UAqUTH2jtn\nsKgCtXjnvRsWltbULyj6QmWHPjIioEC6RkmaVS8x+6e16wdmgKPsksdoTf8+\nlTg5\r\n=JINq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDN3Axl5KmgGy03t/+hX/nQmMDanO4OMdx+TnF9rneAhQIhAOlCwpuuKGTsiYYrNLMiE7jj2xVB3qe5jU96MCvtIhrK"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.709ee7ed_1548854941592_0.061273138482637934"},"_hasShrinkwrap":false},"0.17.0-alpha.b71e2725":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.b71e2725","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.b71e2725","dist":{"shasum":"2310a62bd0d849f00ca3dd7cea7dcc048f06a786","integrity":"sha512-MDbFs0buAyv3iK3jmur51wm1eOe8ad4nP5uv4G21xaUL5JWbX/KV1loOdCmnl7aVtu8PSefEiJjyjmDVoFGsiA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.b71e2725.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUaawCRA9TVsSAnZWagAAxs0QAIVtbAAc1D0lM7HkxohB\n3I35SbJmp/94nNWoEPKUdMXp6tsdkNJ/nLmkNrCmYG+KNFIZ2wusf+gLF0pe\nZY2FUQrDdfwwGiJJ83+O2OyYF5vAHtEs8f7S0h0fPdaR/K3iek7w6SqUw47v\nrjHSFDJFZFUs0VyMN7OYpfKjM3V1NffWIpN/NfRjrkOr8PHUvWz3Sl8jRYGz\nRLy/geh8H3V0pBWQ+6kiOP4hvtjOvjFIHpDeW4FOc08zavQAtZ2f+i/1RB6I\njnM4qrr7/DU6bqaxBUDdc07KYcvs3zj4RKJpsjjuJjJ7z5vEHByu/YDbC8kq\nfYwNajsjfUxBQN8UByO6XEf3pjvTy3RO6MBahK2ld9Ri44/ODZoknfbc3CVo\nqPdpNOrl2Dz5ui8k0UAlChz9ZANX/lSozDsIM8mHXn5aImUlcx2o5ZYuHg9J\nFJdVoQilaRcqyT5D0UQhqkDar0iGDwmYxnAO8ATudgUEYp0DcdbCwB4sGXG3\nJcfGz/GjsmAra5GWTkONgqghsXxQEkX2+1Y/Z13iSekWWP4MYIktyr1Vtk/S\nMmoIHaW/qec+j+s7ud3mUETp6I7dVB1lVbgAHh2OfaBInDDrNbM/jdVyGubz\nY4xK/vu8v/j6tpH98mHCNwvB/ZiwBlpUED14EWNlQZIMkgFZRJD+QlQJTNVp\nZ5ba\r\n=HlyX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQFrz8eAD6L9z43Q0+MtnfnMs4Fy91oKdnCnGSxpb9OwIhANd6SZRpwQMaXzmHG98UCjRhc4mR/zfilx12tMznDLHB"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.b71e2725_1548854959608_0.6241117979403714"},"_hasShrinkwrap":false},"0.17.0-alpha.4317ee16":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.4317ee16","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.4317ee16","dist":{"shasum":"c370b0c60bbcb34f80f3fa6601b7686436e7d40e","integrity":"sha512-TM9fV8uLba89uzGDmy1zbLp7Y3qH9Y135oMG28TmJCShf7Ca0/qQH6NPjtEjcpb6CopQ3BGBdzwkiE4iSR5m4w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.4317ee16.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUcnzCRA9TVsSAnZWagAAW5gP/1cShdiKvMaV8a8oIClN\nmAE8w3Vnjd4Q+i7UDVY4dSc1slL06DBvwt186XM2jzqqnkzHUJXRZJSOA/8T\nQBT9k96j4pZoMhptyaOdCJZmJNBfNEyzI8RQYOZKVHYfysKrFfSmlSKEduHP\nG76w6Em9hht/8EDJgk+8TPBy96YSc5WKNG7A/G2fCvFm74I3nsQpLJWoJOdj\nvn+7V26iADjMuylBP7AWjHwfiHOVxxW23/61dT18+bqk1MSYjzkLpgNTXTfw\n0roYxtt+roOHI/XVnBlb7mdeWQjuOKkv4ECMkemAjsx/LgkD0BrZJH/ciU+I\nBiSpEQ3MyR5WRubruwJB2wymHvfPU5NulLJbzFf18dp/9HeNkk5UCXxghK3/\n9EHEfUyZp5y2sEoN5U+CHMI0VMnC4NwhVoF6IE4PYhMGzZ4rvg+V0bZbzkAI\nzYXoT419K8O7gHzz+PEHyvUoChb5jN8ikB6Gk7Znky75pJ4NPArnohzffDZr\nY2yWS7C+lUn+6c1gfjkWPkR5lcHUFhduD5gFQCEkjrdv++35HfLSlRAVjbzg\nQZ7eLtg/9eQ2yTThklZkroj7k5Uk0t81mJ6IxaOUjki1/IB5KRgMGul/u4c6\n34ODvo7RCgcfsXHiGtkZjlR4qyQwY4VM1b5ujCu3D3QQ8V6jzwVARbbRafPl\na5em\r\n=Esz/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDN68B14ETOiOmNccox5No+ZGBXK0+fpJOK2B676KbpMQIgOzEk87M/ZMsBXTzvARL7JtEOQf7YqOEYkuBR2w5rnK4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.4317ee16_1548863987145_0.6096146110002534"},"_hasShrinkwrap":false},"0.17.0-alpha.fad8d485":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.fad8d485","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.fad8d485","dist":{"shasum":"a6becfdb88b9d62910491a219d9736ed4be02f77","integrity":"sha512-nBwKn1RRVPw3DcOqyW6FS9eNjTd/L19t1Nj/719HB+OsOweUrZMpI2oqWz84HCM016hx9nKO1goXC0GbFEgi2w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.fad8d485.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUfs2CRA9TVsSAnZWagAAPI0P/3sCe1YZrdfWgIdHH2w1\nU9qZZnvMhhDJrkn5WR9ONWPYiwj8YIMtw8bnZh8Yp4kfOAMXCeX4WS8+xaFs\n23fqxXBROZkAA6xDPdkulUQMmLZe6iHWhK6MAjlQ6iF9mXKaSUsQb6WTAE+K\nWPy5I4xtYvnov0QknfnlBfVvSOHbwm3s+XNvK76eUxV30rAP1fWgpWG5qeBs\nSRsWwSsRVTGh6aLVCLMTTCk+8DvauI7ynpTR8WYHl9ptz6SU5H/jyqPBiBF9\nkj/E5e3nA0l6AJxN4aa2Q1QmxYRUV4wN/35lGZw4v3RbcPCGKzajtdRdgJm5\nPZaCbUuYjCrtj+PYGRsvd/jRU+IVKoOdQAsw0smRZ2hBbr6iZh3fL/Zqmj0X\n18ffVy163eHb5qJOUpdAM+tlKbZll+eUIYjZicTWH+qygAbwckD2xZHBdr1N\nFGYzMryeCQShOJHUUB3KmPOFGwn+9fHcV7OklSYeQS22BCGwq8U/AZaZsi67\nysHCrI+h1+XNZ50fYbwNLBU8iDd5V7I4v84bMQNx9E2TzC8Im4BJV2nYt2eQ\nZVqfI1E4V0j0aQhZB0jIZbOC0JZ0Tedo4HLg18xoCU4kECA11lueNBXHWXS4\nWHGfUNO7X1NTL0zTqn6B9zOX6nY/CwtUO8wvEdrcmwoSMC7xk/xiLZCeTxxO\nlv3N\r\n=A6aI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbNmKFJcKE0S7MelxHje6e9z8yLWdXI7tPo75u3jzwqgIgEIvEqyViCQuvrBUhj38VUxd/2VUzudUgItNTOirKHrs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.fad8d485_1548876596673_0.27267368689407734"},"_hasShrinkwrap":false},"0.17.0-alpha.805da056":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.805da056","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.805da056","dist":{"shasum":"558e116227af21e838d2eaa1b9490ae71f857736","integrity":"sha512-L83J3DfTJYvaLZrz58XluWD49z+N6twcD46GVbAW5YvCb4sJxn4Oqasq7E/+9oN6BMwwLJxJXJBN7WB+N9yNsQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.805da056.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUjVdCRA9TVsSAnZWagAA/eAP/RmXHeHBw2PUcN0oGU0M\nNH4MdFGLhumMjbhBi2WzL68lB+yOc9O0J7NIZLdWp+44wgdeTB2J67UGPXwS\njacnPwYkmcIHVNA38wqSnDDqybwSsrh2PncoOxFn0jREoqiNMq5n2mAvoq16\nmW4ezb2set+aN/Gs8g69ZzhLU/jk94P2A4Fs/dLM5F7K+K5FNv6n5X/K7Nx2\nVJ1sEQxgCV6v9sgKyHccN0AR1bgG0hOQ+wXi4b64VtvIIIchTYPGk9aCcl7w\nTHs21a4cHab1qGpXwH9BDBCNv12aQOVFmH2Y/y4zXsdVvLhlJNqAh12GoMkU\n8VEvVm+1fOy9aGuHMpPyCGaMfnayQH22JYBTXKAJNw2BVPhpfbYgjS0T3JaQ\nzq9ZX0B26B7J6Jlw032HSsvSa4x7PNOc3Phw/J4oWzcjtkI3j99wVG9pn5J3\n32+rQ6btYw0+ehm1zQwI5Dy6WOOtSkoA5w8hXh4+NDgRlZVqRkPYqEw+cKIK\nih2vJqagySVHrOrOLPyCiG2hFFI8D9FllvUMnfOM4aWOrZ0bVJYRUjPjYIdg\njGHTqoDHHdxJqRvIiHBenu+fgk5yz4IPDjMnW2s+HrSQLKvxsSXiXZmc9X3R\ncdv/+E7rdZCpXz6tYSE0lipJbHzjUSakBTVuAArl9rWo8V44X4aGVW72Mm8Z\nMsqV\r\n=5pmm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBOg7s66917TRGUoPEh/b/4FIgZwkCkyB6wmstjW14CXAiA/JkveV9Jo277suY5bDizTajnUypZ7S4gOiJOVCqw+yA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.805da056_1548891484852_0.17546005659148145"},"_hasShrinkwrap":false},"0.17.0-alpha.d1d114fe":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.d1d114fe","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.d1d114fe","dist":{"shasum":"ee56a8b2139fea3c2ae45fea923257dc142e0dcf","integrity":"sha512-Lve05b61N1rolEOZPtSPScBzCzNadydqvrIuA8KQ3gPIbpPMDTgtbLV+OOx3FiQeimcX3zmOAXT2xREgQbEYOQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.d1d114fe.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUkJ5CRA9TVsSAnZWagAAgzAQAJ9JvZxs8csqeQ5QpEpw\nRovG/8TBUDl/02zWlgYjLGRxr81Vv1MQTLKKKw4xK4DUwTejnmnQExZKu+at\np7q/eATpo3eL1cmhGa/pXRvMslM7JhCnJS9tmZpItm6R24hgF3HddueDb7Qv\nkaRnwNTzPVPIDJaG0SSb6SrOWys2cPcY3RX9vtmaMHEpPHmZAQpkCArSW3KD\nzeU5/fgmDyfQaBMH7GEjfoU5ick5QaLthc5gxWhB2CTlQ5kuc1iKH6aFEtG5\nG8InkE8h6BOAjhYLcY2/hhENbeO0eiqH9YKc6aWJc6h4th2q9dVhrfy/ZBwd\nsV0StN+1+bg9S96m+bGjKtX+qvSZz4+6wAh0K9uPl7YsjT1WwptfueAXPqq+\npWAg6QowltMX/z3aAQYu+cpDDA8DEXfw56xcDV60OXIboKaM2m67nZ4JiW0I\n7j5oNWVhrWTUv+yxkMcmgxyXuLJjyen3wgijIVkFjDPYrSc29o5LbtlPZarK\n6YQa5K8gPxGZ1knfqQDlPte1dfmAsDJNhp3sIBPEMkt3RykYFmM1j9bkvxyB\nXeTfTvZ1545H6v+TJB61MRqjjd4yJL26oS1mrFK6KW0sGB8uMfpuP1aummMy\nlEXCCMZAZBJ4QBehNbAyj6oNQmO4d2CRIeht0Z3+qNR25MNshwMEZiyUv6VO\nLDnx\r\n=EQAs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDL5h5e2lS22Hvrdnh1ig8IJHNAz0cD4XHBEz7/nQ9pWwIgXxORpYRGHDNj3s93UK4K3qrEETgWwT5gUBpsO+FL2go="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.d1d114fe_1548894840381_0.34550818794857174"},"_hasShrinkwrap":false},"0.17.0-alpha.30946230":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.30946230","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.30946230","dist":{"shasum":"594ac6e18e0ced2e8f896fe03af519aa1be7c49c","integrity":"sha512-cqcg3onfx2NjqsSumRzxjSRz31lvAVAVUHoPliJtma4hPxDsA5n5OWOPjSaDwnpsaAYoY0kuxTufBafSKp30Tw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.30946230.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUn32CRA9TVsSAnZWagAAcHUP/R5nOVSoY1xvqSAoI2fB\n4IO0dxlkCSfHNX6V8kxwW0HwKZa3QBXVCTmjBvLNT72Ely6mO97jjKAsDZEm\ngcJLhX302c/ZRyjk2eGlq4eWzBzOU8ylLaElxNpucJLJsE3c/YiWSjasC+89\nMmQm/jqKWuoOZgNyNIYjVe/XZNWtQFeEZEs+B/9sWapVrd8o03YZ6wZX2ssv\nnOYPhQQmd1YMHvNICeZwA+1OATbIjeJccRWYPxK4HOCSitd/4/PGiQcgVOoF\nCF0hGpOw5O1E00xgQervMAXRMLnYcEI1wV04jjpEkrhthtzZCKeTLvOq7kiA\n6mUbfTBeA+37pmucOpPyLU1qwrranwqOGnWhQ79K9wcsQ7gJyPTzYwrfyHSz\nNEpdxeybt0WbwOSDYgXFoLmrwOfYrL8VrHF3KcqqdZm2+/AXGHDzdofMu99f\nR+uGvO1V/Oe2D7S1ycFDC5m3tWebdBWoAieHm9Ayklg3uxq3xf6LO/GkMgHO\nI1d7J0IsEVo38l0NpnPiEFPRjHMDbz+upSpMvGUsAExSyJQElbLiEBMNs6cE\ng+cipVDKWd+rzpFuBWCbuodZWi+U4cxJD9sJLa1XYagqBnXCBzU/DotM+cgi\nv1TQipLi+mvPUU7S4VKLp3C9ENYNtQdOZq4+PWAaFCOfIpZx22lI0RFsihbj\nKg9j\r\n=CBfq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC8Bje2xma8Ekdc5MfPrUj1CUBVnsaEqEWx4vXseN2vmAiEA9c+UMGDUMWdZWpxkkGxn/rEZhMD5ZSFCcvl/Dkgsa8c="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.30946230_1548910070130_0.5665565542513054"},"_hasShrinkwrap":false},"0.17.0-alpha.ed37be75":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.ed37be75","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.ed37be75","dist":{"shasum":"abb8542f63929a130223c76ec2a0da2b88cdda50","integrity":"sha512-QsJC1P+s2W4tpqWAIvZgg9O85liKQz7szOftC02cIKAoKnWF8y8fWxwD3V1vcyxKH+jjE2MrBpmte4LWpbnsyQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.ed37be75.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUqa7CRA9TVsSAnZWagAARSwP/2X/JV9N1fsuDIs2qn/E\najCS84X2o4PpLT9bbox8stMRtHXMy466E1JRCm9JkYojJfxDHah9oTAaPqt5\nDmG4rAXR6P1sOOYStYN641/5sxo5bBZcSEJC9HtclJGrQ3TOxzV83BqhbLY8\ntoqI6aBca4LPWOxESKnDDQLbMZ6jPFzkz0+y5CKneJRq2DVDqlxyuc0lWfyT\n7xD/trKgK7a0r5MT/Nk5d1xjTCwvwd6o9t0cddR8UHHY0lp+qFDu18TpoI2M\nhPwhnSZ4G0u5u34TkUlu+Iw6v2K5iFoL9ERqrsnXSU+TS+RbAgwmdZtw2iIV\nU3Ks65rUi9YGJ1k3DEjYDFW5OjbqOzV4As/f+iAVvoaCqu1lN3y6hu84v+jy\n8zIMkuiWgGot6OvP++TBfn23Kg/RTVR6DTAQlzlZia5gO9P5Sg3b96TYWNet\n92qlqAStaQTC4CVw2e8QOs86TasNJL0at+hn5ttTjRrZHv7Js56K5tX1foyZ\ndF9zN0q3P/QLNmze4OZQ+0MgRNuwKKczpLj845DjHZubl0NIgBKz8Xug9k88\nhCsG3yDOEdvrvGUZOZ5FmLE1EyIywpB9lgYJAKXnnnurrDBH9wnaNvu9G8fD\nfgbE9ARxcnxFGsPfPPK7DDyyOmw2F1brS6/ESFHRGn9ptj/3LshIgy58P2MS\nP5ks\r\n=CXUF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB6LUU3GCYahPWg1blbF6j9qV64BtEJEHt4mPIttJXD4AiAWF7B+HabQhC21v0109ZT9DmTfue14nBffpAWWJalpQQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.ed37be75_1548920506765_0.9431708503783558"},"_hasShrinkwrap":false},"0.17.0-alpha.24448bfc":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.24448bfc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.24448bfc","dist":{"shasum":"eb4844f3c1faaa4294fed739435b5e402d4533e8","integrity":"sha512-4+z/n54Ps/BGbJ3VQr6Mh+qcQTbCifjupoW75zulLRwFDEozxZHccMB+RMqUCWBSMQhIRb9lvHfINNka0u77Xg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.24448bfc.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUqbGCRA9TVsSAnZWagAA8VEP/19WldKUJu9N6TR0uWz9\nl7Q2MjSFfx6hHfcCVmvC4zpkCoyuOKqF8C27r2x/yRTzITyrGai6NnZXUiHL\n1L9pCUI7QoWCxcIFhe1kNLzJk3PtQk0MT+j5FmgRz3ZCNi/dFxIgw37r5YLr\nm5nJDgj+FVo8AkBsrlIuscNw9HdiTh5ynPW9S3snTUWJYr9zbHyZSp13KDdP\nzVcpZIbjW45Lwmdk5QdJQjLZScHqDpCxiDjt51kqRSBZI03wmRMVPMeNiT5L\nD/GqKWsc5vgeJuCDy0dQcSm5c7PMYzsTSkyIXesJpLas5ZliL1WjP+rX0ZJd\nN3y2aAZbsBw1JQvt3eGGH7jMmRPYUXTdkRwjKskUXhY7KV0kXSXv/9RBZZKY\nEs8cK1LCwRi8NwwoUtAHdA9kYXlT/QHTsiawb2KbR4dsPKMAJ4jNyVtO6Vm7\nwqCIyvPKyCX6cMvqWx9CcwWWWnH+YcbVzFfPm5mGkLrMnDL5gkEbgFUSxB2b\noSX4SMbVdht3TqhQq038IxNnz2wjCVnwOoOVSfn/QdEz8Cc1km2eq232ApIz\n7xhv8rIyoCIN8eqsT6BBE0mUTjh2wpJcxrbSNUywQj+8Brk68vNJ4p6qVADE\n6re5TKtSvSbWyrAmyoljjTkantNys4TxEOW4tK7j+u6zcnSokQWnFBe9GdIi\nsOcq\r\n=NAx7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8e5sW3sO7Uee6jrlTT5nnAGrzUvZBKPAvXVbAQa9xZAIgH9MnlOuj27c2HbzHz5JtKMfzlIiQ/b7T48OJS7OmCnY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.24448bfc_1548920517791_0.02571718388674027"},"_hasShrinkwrap":false},"0.17.0-alpha.a51f5553":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.a51f5553","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.a51f5553","dist":{"shasum":"1d5ea97f434e3e1e840c1896e4d57a0e262262f2","integrity":"sha512-Xnel1UWL8zBuBjuct8B6+NKwRiHeN+tGiFtI2vYLSWooEwPBdC+6l3SGAHbwLJwb66rIc6S/NazotaeUko6rSA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.a51f5553.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUqbXCRA9TVsSAnZWagAAe2EQAJ0IwUWpTULOcc07467N\nIeM/EaVi3sJSORpOYVKRdxcc/pNe3eiLq0MG8FtIi2CaM7E8Ajy+kylKB+nS\nKbHAOTk3GYjpXsmmrX+054x1HfpElvBcGV6RG+LKddJi6FpGYZfsoUjcsl1G\nmZkENXwVnZb2IGh2XAF14/hYPBKnm2M1SV6nkBZphkeWaM7IzVquVj1e+rx0\nFAM2BMm6dvJIHRUUXsNaD5jkNPOhWJEmlsr1LEzltXR0epyqjhqRvC6PGVHS\niga2Eg4UEEex5UupQSlCYOsRnoVC802ISxSAjYKOUo91DcaAC+3jKXZgIZhF\nRlApf6uDzUd+w9NNVADVuJ4rjLe3vJhdRjXU/zKJXFKUSCQzzSCMYS0FETn9\ncPfDI9YgHte15FGSHqr0ctRPLWRvVgdN6qjjq8Sm1DmWQrTid+swB1W+Ip9/\naZ6eYWJRN68kvLflD/LQGoRNvrQhYBEzTHHHQXetvaUHCvvVMykkXNnQAeV0\nl/fRL8froyN4qPaHB2V+Do1NeoEbilNuZGos5UGFmj8mnqSe//j8jAMOIjcO\neVVjfqs5bQsr3tvuYCEseTAhU/TMy4D/7G5hF2E/5uwQoWz70RRT0AmbAFAt\ne0ixCoVAcmRDPxlosxxMHC87tAMUqvKBPtH9kXsgNE4YX5iymDfK6k110H8v\nEcp9\r\n=Wfsm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIrTa8sBZbNpDANOLL90zB0U1QzFqVRGwkdH76GlJeegIhAJGiI6zrip8KZ3O2K+XQmm0fNXvnlD+Et06WT0ByuDOL"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.a51f5553_1548920535193_0.5606375889188937"},"_hasShrinkwrap":false},"0.17.0-alpha.e0e357ed":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.e0e357ed","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.e0e357ed","dist":{"shasum":"af17de2441b2fbde3276ad85ea58555b8145194b","integrity":"sha512-Dg1EvARTHJ1IurwhZUrgNQdCTaXIr8REBVT6vR4JneHcuJ27kLzW3l1iGo1xpextIEM2eITUnCKNrsYeABwiUA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.e0e357ed.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUs8ICRA9TVsSAnZWagAAAaoP/1FsR5dZkopI/6wZBfMG\n0Ae2VLuIrk8gCw9dws4vVr+64I7YEvLl5KP7erUTXxhfI7G1ORvnFcEtWLT1\nGHnsXhMb9McIrdOfeoE+5+jCLP5+6cpNZLLaVBWRX6fM/6KVX9ThD3foGgfS\ntxh+sCsgn8c4mbDca0Nwwirw1/qROcqx4SG5OSmPEZJl+p/HQi9f8lZ5ni35\nbHZ8wbXSAbzGqGoJOPTzpvGKTJm4yNOp5eomypYRhrT0/DI90HPtqZohHlAb\nV6XcTm5iOxsVKq4IGRCiGulZnaIqArzMABz2byPfWOo0y4AVng/VkkHZnuYI\nCg5V08gTbnqCMtmIeW4r+iADQRLMtpBp+8t/KUHGJhhqVGUjw0nCwyuv1jLu\nO1gYnbMHsEs8sJqyucpDAwfNX6MGxuOFNSsvaRvstUniX3I36f8ckdNRml1c\nxEjCXLfIqWt+65X/7TjdP8drKQQyFLIBe+cd9xCaY80lkcWRtI7x/Sm5tfRm\nQcZ9jpOc3GVeZT08lFqQVNvh3dJZpntbycFZcHTIKJoSZOicZKOahTJ8MAsv\n45u4eTXu+zebTZYh8128kgSkIVDPMaQwY1mCaVlzsiSW6GsPvRkZ/Na1dKRb\n1TduaTUeQ/18ZWbm6k5YLZ5uStIiz7ySrHqdSZeTVS7VHyGpnSaEWfzbYOKq\nMY7H\r\n=FpqI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDB8z338xo+xX2vKfU1/SL+q3iVjBltM6ZIZk5KlreIuQIhAItTAzDHcLUS1sxpfUf8cF7gcM9jEAmqJi+Frj26FjK2"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.e0e357ed_1548930823521_0.9804786609571652"},"_hasShrinkwrap":false},"0.17.0-alpha.c06f4e27":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.c06f4e27","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.c06f4e27","dist":{"shasum":"0700631419bdc5cd0275147f79c0ce2fe9176305","integrity":"sha512-RmXDHMOOX6KVLEFgWPb5wyfITBtR5g3uR1s+w6gRx/IZOlNIGsjRMAdDgQjd70qyFAV/NCKuesuyLEdWALigEA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.c06f4e27.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcU1ItCRA9TVsSAnZWagAA7acQAIcUcDAajZRVo5tePFlL\niewzuVdWwLj/T6TmspyWe8NVBXgMJav3pm5xfyBhod9wZ9QNNCx7Q8dCHEAo\nxPQiBaH1qGWa0Qmi/lpfZS4VSIxAjIr7EkxzhqNm9hm4vPczaSLMdInBFls9\neVvcUOMmr3mGyUcTiXX9rpQIrWmu7epX8sjvcTaG1JYms/kVWmAe4BSduqnn\np5NX7yUiOz1StTFDrBrpkzLLvjQoT9lw2gZ3+mFGgRWeQ5RVR5JqE2dIhMKA\nGVoUjWBeykYHCHa1J2CphQepJ/1pJQ93id0b6oEj7B6Y7l8yPhYBO+lLUl6V\n66BI7osHb8ksao1GPg317uDkfK7EiW9qJpxwXzqGVJOpN1FA5rV24IjGv30e\nBRm83GTQ0i88AE4FzZuQM2rxPlGJlTNRXoiNZj594C+SXM2C92LYgPTE8CXm\npuuxx3n5yv0YCp6ff6OFeOE8X5BYtZH4DA00eYjVSJR/EGxMpPfm82TEfwst\nf68GCi5JkB5QaV7zqnIosmss1G2qfCJBWaQyR58mIXeX8mn1oqz6acSvDe9+\nKR6gyipvYxTby3+Z+QQUFrDSVLd7ndm5buJfXfSdzE5fcdgydYRCL1xgvn5Y\nJ9CJt8cgCGQz/XzcMzJAP5vhcz4mMNNnpsAoEAYNbYkCn63u8Yzvf0xgl2G/\nF8R/\r\n=HyzU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDnIDyUWaNCfFlXfdGV7wYTTOshkE6kO7RtAtvS8tk9nAiArFYD2wML2Q11gj+7ni3OYnDHBBUh1Q9coUelUdTn2lA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.c06f4e27_1548964397057_0.3217822711068028"},"_hasShrinkwrap":false},"0.17.0-alpha.cc04e36e":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.cc04e36e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.cc04e36e","dist":{"shasum":"94c9cbf36d3fa96ff88a2cbe074d5e857230ad33","integrity":"sha512-IYp9kBQTb2V1e544V6rHUA+WQ+Xb7JToIpGer736auJSYeHHY8KCtN4L7LR4UCc5QiXFJ5k9KU2/MWwrv3m2jQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.cc04e36e.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcU1JDCRA9TVsSAnZWagAAtp8P/iGU6k0PNmz0TNyzFuaB\n1lZQr72rxFCOw9wbmPU2KIQa+Gtz7IBX/vi86XjT396hEs7q/ffBFyPfxsHb\nJPOf2GvgcgHwBr1/H+3luNmozpNI/YYXz8bG7qJpzbcCs/QnqKie+c9QPEC2\nO2OGmNscCYAcgvYZH/PxfQzYCJXsrP+pWWyrx1F+os0WQVXOK5dOl3TBhyrA\nQTJCadc9bmRSZDSgn+IEbJPHIM3CLddGWUWWQEcJNIUPB8O5r9cf8p2PyIS9\nBCA/NleziAzIMsyzWbluXxNqsP7HkLUCztvnr85CIkxRUatv1LkPWn+k71Lj\naau2eA1oYyFWFizy85+glcsmiwJOgTb6DGlmo7wZf5aFXQii7EDxamkUZzZq\nr6OHGXgXj+Ug1TctCGXNSWSaNaH0JhrD3ISg4fP9JPZOfaJI0IbwWHGDL6FR\nHMUku2uTt6gcfgAt1vVng69zHzQ40yucRYRnr3n4TkaKYzGZjTYNFmTf0Sry\nCLTDSGAwe/iXU9z2ELvuqny4ch12H0YDm9AqqJ0dS1LFO7/ArAs3AqqklDG0\npTiCkJ7OLZtrbIs/zKd0RwWeucJ9TwPqmS/SXzb8rTFudA+Pc6Bs6GC4B7oS\ngJnjODJWmjqCEiBY+6J2xq/dxXIFU5pe++neyLSWwl5UhdXIS+4e6OIHNmgN\nm0Fv\r\n=UvfL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHtteKgQVbHPEYquNQT76JLkYG/bkaQeGSMaPYw9TxL4AiBvj11Jbu9L1SagF7tjUnF7AIOwWwBtu4r6AMBNfvM/1A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.cc04e36e_1548964418819_0.5370671234844264"},"_hasShrinkwrap":false},"0.17.0-alpha.9267e6d4":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.9267e6d4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.9267e6d4","dist":{"shasum":"b75fae1fb7ac9d43a93765ed8a60cab4f90ca33e","integrity":"sha512-jcS+aSwCvanDO9JelvqnPYqmOCx/WUQy2xXqfLGHVuHH3ldbQy3xzeBlwhvogGr1pn+Q1h+SR5bCTuNGJMyQpg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.9267e6d4.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcU1aBCRA9TVsSAnZWagAA7nkQAJLPqyBHsyDHpvAIQsO0\n4+BsTl5BDbt8X08druC9Wksd5UtJjB6fvCBjng9HOsA9QO4x9qRSnkRlQSJ4\n3h+Ji91K49v7KHTD6DXpb5ESxVNZAVfnJOkl1ZU5D7TxamxchfLtNl/kbSdD\n/EPaw75eymgBKf4lB74R1D8Ru1G5U/LrR7f3+jHjE58v2WeXCZx3YpLfSO3u\nC7pLhVcN+tm/WgO00ewnGS+g6fOeax1w9ABWpdoOleN69DcNCMCEykVy/kw1\nSduJyzfjwgffVi3HXUlfrs18Ql6oykfTWA36OTCYqA2pC/QWOGCKyKTHMci6\n/JvTdSmPVcsDlaXr7Np4y8gVGGx3ll1ECvtaSvFguUSBPZ6HKCvFgS/e5zLT\ntkY9ptvZZ4uC3z0uxSmzTtbfvtou5qqF1TqBfwj7CjrzM3v1EcTmQxFeGt/L\n5sEbTkDs21rfcwlFV1onZ2t1gd6crWjF/ov3pzG1k7aasaSCWdUay8BY+cmp\npbsGl9drIwX1Rk+rWEX5GMbu5DDRis19yiyjYEMv6guYA3CkJMaH1kXVVJ1I\ns2mSaXS4pTBrPUuDedL0KS2oxc1aAGdVINci107w6pYfQ7jHI1mv0M9dAH+5\neqQbhEMMadsILxemivJ/2kRrvyoiKN5mwU7v9n0dG3k4SAS1gmhX4nOKGyeg\nDlUd\r\n=xKh0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGPaX6MKk/ezjV480NTI0qUKu9mW42NjBhveQkHIuKzpAiABQhRKzssw/FJzgospVjXUP+Gb1NladoTNpOaWdWRH0g=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.9267e6d4_1548965504284_0.15938569251100754"},"_hasShrinkwrap":false},"0.17.0-alpha.d9c6b03d":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.d9c6b03d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.d9c6b03d","dist":{"shasum":"602ff5c9fa9c4ef3082c3cb76520eec77045e0ac","integrity":"sha512-63zYP4aO2M8Oh1IXrK5an4VcM1bh9cUTD+wsk9rSuyuGvgpGnQIuAAQcXc2KeB7AgslL2sCnrMeUM1qLVgF3Pg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.d9c6b03d.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcU1wcCRA9TVsSAnZWagAA0VEP/RLv8eYC/dHPoe3AeKLn\nUkgoFzJdtjKXdU0fkMfS0sRLFgeAxl0Z4crxMWtD3UaoIvRrbvDrEIOiko5Q\nJSEHSizzkGsDCtJh47COEJS5aEUvHp1CnDNTekCi/v66GL77zJysG1jDMzZI\nw6WpVciRT7z37IGwS6vOQoGyUo7z9yTfbHPGoRgBQBsiJtItqTTilWAPQVLE\n36ttm4mGhJxAyrREXDqSkBWd3HABtemYqjC6aeuK7mv7vK+zGJwO5aDtUx5U\nU/4Q2xDG4pvwUeNTa1u5uTWHbqJZV3nR//2ytNq3Zg44ZaTDIdJ1QwjEUJ+9\nPnFyg6U32fWKykNrT54/L/JA2YxKU1b/coAlFGWPgLKbVZrKvkxJSgIN4G1Z\nVbJKHj1IYHxyNz1tE4Y74wqxVEMwUIhh0+HK7a3IMw+5qVzKCwor2jExnoMA\nv+Jg/n0R5siiBXBRsWm0Il9IQYo5ueciQg8VhLnJz6y5GqWiXDDrao+xd28I\ntzl6VK8XXCRvA9vorg6oK/E2j6S7xPFZiSofGU2/D9frbHryn+vSbkVLTrDB\n79o1G8T9hwhQ8wyOuhBq+9B0/ftrMsODEUE0sUqgRXiY6DXBNj3O9yLJ54xZ\nPgTYyvuIh0DR4Gc4v7W4I6spUTobWCrvNTG+Smo3PhW1mqFEoU+bsgYJ7kl5\nQFo3\r\n=4e/E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGCfxelij9+yDm40lsuVEhQwFSbzBvqXAlWKwhdlcPDQAiB0Bbim+HycXNAEj950gkdxWyMrAEhtqzw5sr2nIH1GNw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.d9c6b03d_1548966939898_0.6522690291948139"},"_hasShrinkwrap":false},"0.17.0-alpha.67da0b35":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.67da0b35","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.67da0b35","dist":{"shasum":"cb7ce1c76f28fcd92336b91f32830cd131429d99","integrity":"sha512-2KkqeSeej5hKggN/XsNsy4P1zvvTwJVv7oE+d2lvzpg51OOWAxHYT2R3IqpNqAlKLY/0UJPShckEQvR004XPnQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.67da0b35.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcU9wBCRA9TVsSAnZWagAAMVAP/27cmhxJnGUg+5Oq+aDV\ncfa3QPIgVb/ICVC76tdxokzDmGSOjRURRLpJhSLPk0XrFGqSnKW9L/Nmddoe\nDlMNV0RP6yngfe8cJa7JnIA0erc3u6EXsCr8hi/cwEWzex4P/wgL1fDrKrtN\nMPZlZwIXTIf5RsWhTXRWfzyMDSbve8T+kuv47rZwvnG/8FTLrzftJiGkntkj\nIy78EU7xlz/ZrygNnEa9SzRKrtJpkQ5vXJl3DwNHW9ewLTtgVVsY94ntewTB\n9RI9N96nZr73U5DdfPuDziwJkTBKqLx85X8Htl+YCpgsuLrADELQ/pHk8SPO\ncpZduz3aoRR01HPOfviN/YmpcwOemFFuQ7jysA8gye83mLR3rNmQFYTcR9aA\nfIGHRLZ4ZI2MFWZFkQJjkzMOF1UbtIK2/LdHM3OozLfRC2Z3QWoomNCRbO+f\n6v+gSHTbinm/NMn+QEkrTRpBdsldMkZPR9rpIrZsndbWFs0mVjSx/FtTStc7\nYxO3zJiRNuwQEp+PQx3wr5ODFmqjX4amKRugcMvMERNJ7w3+OJ5DD+0eibkz\n4ngX85pv5bh8QThC+qC5y/SY0OVykHka+4p6hNbeEGY9R399tBwIvJSwVQf5\nxQhRkqqCnt7hLwbbVNp9ZySadGo2rEThA9q7H3ETLnHwWmR9hfolA6tXBmPJ\nMonS\r\n=zqlE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCq+1U4v6Ygf8pheupvkO/uElaQacb6A8R36jfUCGdXMAIhAJo6V1msGF1c4qj+oOFdc1tgpyCu6LnIpAF/cXTc7mWl"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.67da0b35_1548999680278_0.317941580631002"},"_hasShrinkwrap":false},"0.17.0-alpha.ccad7a11":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.ccad7a11","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.ccad7a11","dist":{"shasum":"a0fc0e5bba6ffabb2306a5b347b3c2f39181e285","integrity":"sha512-xQ/Ltc4YYUqTSsq+BLvdD/4uRXE8HaLTrZYqvjBDd20gJVdrioFEwPJjz5tQqKMnc76l5oTK+hwlM2fsnoyS1A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.ccad7a11.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVKMBCRA9TVsSAnZWagAAmqUQAKUG+gPpZ3sFQmgEw6nx\nAFVUz13sGUzmkNRwobBMS0ztgf9L2ayZDE9d4Yc+2XLKbjSaB9E6U82vUBRI\nPYfWfuAM/XSN2BhYHhyAXJqa2lM586DPKJK9gElzrqYGqzfF8uPzVFHOxeVd\nAj5p3lTQ16DirlwBe/IaHXhTPDaSudLKsTN82muZTUE6xScI0G0xGjrCeUoF\ncKzkFmuh/OUmjfjzQkrD81r23CX8XWfpOd2Y2wHROA7Ia8zY2wX3pBEfs59v\npWwjiy8fKph9I8Rov50Hgl04EzhTOf7xNuFSPO3QEEdIy/jSWQMzfXGlfUq5\n1N/tnCh3PA9QK1Z2EwtF3rl3f5fGiYHAO6wCwk+AxwFtnOjalGh1Dt3F1cig\nlDoe0HjV1fnaWrBs0zZ1daBgAqNU4Fy3HDhzTqHXNmH6h0352rQTsEXStLij\nEKZEITUfelaGjw+ENnJWwThM3R3WK/I03CzL9Trd/1437BlbEQvo97W9c01E\n+UL0tRMc+IwZj+UERnpgF6kNM30KcdgTnoYSD13uvla2fP22D5X32h6A4K2t\nBlNF0MtsH29K4BCEcgwMXrxsauT/sLS0rdgUNwGd9qtg40BKQVBNyMEgDaUA\nN4CD840a3rx1eMeW/PFu9c5IC1Coo24La/aV85KkO/yHRtvohXdMb51l9GSO\nmJOX\r\n=spbr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7MYFXlbJL2MLdIZiHZgRb3DOT7/yQzST42Rrcb5J6uwIgWae/w33nCsuIRJOcCdsmT7Lp7frqi/ZBHK1dzRoRP+o="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.ccad7a11_1549050624289_0.5591136502337075"},"_hasShrinkwrap":false},"0.17.0-alpha.960bbab0":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.960bbab0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.960bbab0","dist":{"shasum":"9aa863a41d23d7e7c6df72d8ccb6f2f93e52b517","integrity":"sha512-LRL5VuwODcgz6HGSWk1M4mYgvxU/rw1KU4XbfLtxAD8SBjfmItoYYjQoyJomnONiM1BdDonJNDpIsxq22ZhkMw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.960bbab0.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVKOiCRA9TVsSAnZWagAAd/MQAJyngJkspeRCGYAlWKWJ\nJgs9ck3kom4b6Vp0++eDnpvEktl7xI7bxi3EB6uC26H2P3WPCzmKLGbuLmsb\nNrJrw/fWrzii6zG3BA/KnHH0TNMHZOHXBD/8C7X2teHc20ZEXETK23zmaG/S\noiIUeWDANwgmV3cl1jL61XCLG7xD8YYhUkatepTkSmq89zDwTkNc0rud1aoK\n/ezn7e99WKxgDk3fSDIwwLaSdhMZpREhTaPl2USbCgQryNbr9AZ1PxPZL6xH\nKlymFWqzyEtdTnpYJgyu+MTDuvi4Q+bN2qoxJp07rWZbKbq765wY+ddkxmxs\nt8PM7tLoud31lqrZH+eDgdHEcDJ0NkGiPOS3CBNDXi8xOWu8yhnhkfbUjblk\nDASCbfLL+wblOzB1yRutOEftk38YT53O1tT1oUbvRlmY0efC4jkVhVR2XoK3\nAG257zmMZ5byOLXp0lrra49nbHKYCpoqUNBgMgYdx4ZuTxGMn79E2fPJBfJZ\noNPaKZhipBTsDGzhOzhts40xQ299n3qP/c3Jk8dcc0tVG0M9KRRDasGlJUnh\nLUCoRcXAvmPOCqmGrDeAn4H1IP2lxKezS/Y7tm4BN7m2EdqBCBRTRzpJS4Kd\ngbggocmsGsHVj4FuuVkH/l9nREPSJNrMaB6R5zaLqsPfWQbe5zISgCHmTPCe\nYE9k\r\n=STaJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIChG4+qk8Ms74z5JiWHAGDodIbBlGwDRgxdrHCwbKbo7AiBCaN0qe1sO9+itqGK4DZHwaiVufvYMPnaYNg6M0FUdXg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.960bbab0_1549050785656_0.8028348651648425"},"_hasShrinkwrap":false},"0.17.0-alpha.87bd896d":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.87bd896d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.87bd896d","dist":{"shasum":"c754ee1fe83e1c9c9f432700f12bed0dad621656","integrity":"sha512-QFF3v4X/Ji7jzBkU+Co/LgynOHLDBVcUY6K3AKqujQwz7BEx1Gbpvh9BSbflv41KeEjaMHvhOVrhZPrq+UMpiQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.87bd896d.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVK+3CRA9TVsSAnZWagAAZz0P/jV2ZafqM0PHCmt3XJuq\nINNTbtcYCChOVpIgIyrcbvWlYo5oSc27tC9DidcIfr3pNDVwbtyTp1whfEgT\nieR3wX19T/fO2U/ceIcxc9SaEpQYJikIy1XjiQeLqCSDUpoxP8xPN25hHLN+\nUJN1SHWTfGeM2FLuBys6tM7JSaKvGysmSTyXG7b6j4eO6Mzx5CxpZMJFJXrS\n8Vm3Sac72W+hbl78ARqLqoN60Hc3rThbq//3EZBIZCY2GbE+89zLxHc0k+o5\n/IH+2zg8yuooxezf/SBO1Gn9AMKYCc0B/jqAHIhdXDixt686cRBvMPDd+4rH\nSeGErbO7Y/4rEdnZbK02ZpjAnC59SrMsx6GH9Gx13RnBBcTwRi42DsE1BQtS\nldvt6JuVp2LmKlEWQGX0IPeQz/EiX3redztnIjukF7Ii6XqpltS4YNmzcqu1\ngnq+U0UGEa1PNhWcWWaqnFAxlHjEf2Da4HoYH550HmYMH9TWwEr1v02iRxxu\n6iYfkKZbttgPHckTgm+ICb6VZQKRLQWopwBcK42UwtTO8ofAZYEBAlvM3vxo\npNbYwMaCUTnUFoBuFZUPumgiE5qUKxq4YK0yLc0yOvIxGrNbNPX04/ATwcz4\nSrhUGqPxDG2mf74mBQVlnp/6d9DJi7lU4mqIrENFowMNVVZI5GmoT09ewcSO\nWjDE\r\n=TtJy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCW0KSFxccuUFOt0n5IB1HQMgbNcxdxv7zepgRbZcLS+gIgYDPb7o2fZQq2VH0rQ3zYbu672aDsmJlchnNtFRsMnYM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.87bd896d_1549053878335_0.19210583025333183"},"_hasShrinkwrap":false},"0.17.0-alpha.bade86e8":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.bade86e8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.bade86e8","dist":{"shasum":"31800dcd11cbba2e1124db421ff2c3155891fb3e","integrity":"sha512-9+mnShw5PkzsscxhA/EjO4QKmM+mQxVJ+hhlmY5DjAVjG+V1i5agT7aCGin+C/XI8xuY1nZbSwL6GdLbvhAfjg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.bade86e8.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVV0zCRA9TVsSAnZWagAAKboP/1a2vlx//v6h0I6sefLE\nHhS28SlZebYMXGMljF1l7ZkvCs9fWsUWth2wG4slkDTy96pBC4FGp+cC2g/I\nuUHBBIpX5wB9AL1bD8+6g2ylrqELvurRB+lGeoPi+vYGTrMU/Jgs5HAGSbxo\nzHaMLD1TU/8sPDLCCexqpgInFzMgbkHXYtngGMx73wwsW6wmnt+OabxlHujj\nzJiTxMQrfka9+H2b9qM/Enu+MKeMwUsa/jf8Zikiaf4u/D1clgy7+gdvJtjH\ntzNmRaz+j2czb6L8oIRwkmF/Ys+yQf/MJoacVXicfV9KDwzuDXi7WcFCIsHa\n2YVs4iOkR8AHBDtnhHvMv9K33NM9pols4Zz6dL+Oz5EXlXVUjwkxz3O/uUDu\nSZGS4WzaPDo/P0bZdEbO1q+lHIyoNCjX99kO55e4dkejHFAnSvSiE7dC3UOm\nVAWmSlJzOAOCYyhKO1+Z8Yh3aq+Zilgtcv2iVkH/f/CW+ndr261uayE5ew4A\n4+MxdiTU9msNSUVEItT+wU2RQ8xf9YWvaFCLhDkWbunZYDaNuGuDk3lxPh03\nk57qosK8Cll/42g3NQZ6pIHb/nd4wndjG2nLcx9beuNBExZFFiDI+50ueWlo\n1BmiKoKPRmR0uFnUjMwm6BYH0MjJhCPlT87GYuD4TK+gYFkDYxzAX9jqm8kt\nw6Pt\r\n=+EGu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHkTb8l1RZucCLyelmdtF4EC9ck0z27mqeL5ZNCYxOUhAiEA5QQKEzFYUWstqyH1vKFydmeGiML/VsTbUOdcshIDHao="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.bade86e8_1549098291204_0.8676741951699933"},"_hasShrinkwrap":false},"0.17.0-alpha.019c17e6":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.019c17e6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.019c17e6","dist":{"shasum":"ca271c1b769a981d794aba6e3918583378dd83ef","integrity":"sha512-0sbyqBrwSXzW2n0z5JmYqcJct5Jow1jcHB1qLQervnUO0gNsAtyCwlB3s61PFqzNCMePnHVsAJSfG5dYmzxB6A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.019c17e6.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVeHlCRA9TVsSAnZWagAAiHoP/3ZgF9wEm7s7omFL5FWU\nOZWz1BxjTIdKEhrWsaQpCUefBu9+N9iFTTPGSvtK28b2MJ6Udr8hM2PRC+MO\nydK1Nz0Qio2mMmLRQQZ+fIYHe82YxEz2PXLjBV92TTgtx475L1hR1Q0V7nJf\ntPhxTPpXqafbdp2pU0UJP0mgxgHIk3KXsI0fCc307aOKO3RovOr2Z9x8f8O+\nbu8LrS6g89A468cgw8DxVd2T5p3MggcQSNRSdRaSGRiWSV0GK0aRRLRU+xkL\naoJhhlOa4K2gir41I3XRFR122Rw6W5ToymD6oAETCgmpYHqswGuus1ULxWAa\nTEKUYQc5ZUgDbT8T8D8aM3hVhts72pOPaA8Jwu0nmks+6kEMIZZY+wBWqM8s\nfLZzBmkwUUSLiNnyzw2r6A/MpGytfqwW4pidxlrTOhlNhSPqgDkeLee88oyg\nrqCQLtvv2m7asTXjpS9yFKAFeOYB1IAsmAlKzm3WutqRNyu3Nb/f2p98zkeu\n8WPN8zNlvkJy+w17u1Phb7DS4GqXDGE2KE3lZDeRTZULfgy3YgMuoNyrurAg\nX9z8q00P1IaTqBZFsLTT+Apli1SvmTXFflZq/C/tCMh6nS5f0fq/mQBH3fQh\nBQFVt109+Z9HYmU12115BTqs3hv/4tc7rmIrmKxz+oIkj8G+BnxvYjOlbGIH\netds\r\n=WuJn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB9ydD8FVRqd18Sst6Ry8UYYATgx//3lJxit2i6OhbaPAiBA+keGZJ4zn9mZrHmlP8eo5CwLowy5VU6BgoGl3wixYg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.019c17e6_1549132260679_0.671277621820715"},"_hasShrinkwrap":false},"0.17.0-alpha.97ddaae5":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.97ddaae5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.97ddaae5","dist":{"shasum":"f5bd7a2b40c7cdef7d13031e99959cc7006762f1","integrity":"sha512-DP3Mq0IA4Rz42n2f9wvfORTubS1l/YSJ12tbfCx2c9ESexX2hpEfHtyfEsygGlgKqYruzrJL5ncGU8m249GbeA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.97ddaae5.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVoZSCRA9TVsSAnZWagAAD+AP+wV4bGuNmlrxfF+OCEFV\nx3JEX+ucOhw7eVbMDDQ9FOvb6KPS9YcFX59A5D9g0PlGbG6tpXRqtcaSUwAg\nYm08kWTkWdQoTj2LuabFDPrpbnLaqpN/+oSdOB12IUfsCOrO3TD8BqObm7co\nuTT4X90qGP2XERiVeW8mplZVwTWzEjeYU+OzYAZ0Ek7BRLxUPn20UMfOdShk\nEstJlTQ73hSS7TnnD8BjoKwBqADItOTgHbKha7cVrpIv3qmjr4ZXTF3RtElW\nCuZNcmvKPnC1X4KrdqhWP/ITfdD3F41Ad8femb/X/c9q+YeN5lVPr56fimlV\ngBniys3cCkf/A4GQJrmod9LPmXxB3Nidzs8/6C7+ipr2AHrbKXhFXttAqWoV\n/MNoJXYQQbo71KZj6Na+Nh4oVVUptmPRK5gLj8wTFcfd7fwP4LiV1+koNPk4\n6NoB8mK2CQkWR6vVmoORQNr+I+08977VulvTq8dfiUxHjZu4FNlSe0SjkKK2\nlCV0TgFpeQv9DvqjH+kQS7bu7rRM8ZU3LD3D/CrVj0B1mBCp/WwEFGn9IOGG\nfdg5JrhNBPYlYhqDCnBKbPvVUo1O7LrulPHHnvpRzky/AncQsxMxrsgJzyc2\npvgMXbL5h/A33oLuA03ShdCaICVIXchKWJ6thjJGlrGizcSlOjdohh/o/PSR\nTzn1\r\n=AN13\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLeWAbZtmF/yxv5JknIpnHSaSjYKLNV32Fg1tdEB0d7gIhAKZd32BPzd5rKy/AfginwlfmfAiqaDbbKQWT1ulEyOxk"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.97ddaae5_1549174353313_0.7341855895972178"},"_hasShrinkwrap":false},"0.17.0-alpha.06e46cf4":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.06e46cf4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.06e46cf4","dist":{"shasum":"cb8f3b8f01be9db11253f957d2aa2ce886ee25d6","integrity":"sha512-EUAXKgWfL8AwFa2zs5wLCK6TPnqhpo1yPs9fHNPaCvpkJQd1M6VVivtcvyrUxdcVoEJK6C1Yr3AaMZ+r2S3ZMw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.06e46cf4.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVoZhCRA9TVsSAnZWagAAZZQQAJ7dV6RqEfrACQgUyvSL\nOugoiXjDUoyjHvdZ0sTQ168LT5ju62D1PqhjJWLqIklnipYp/j7I/KbVlup4\ne2ulNeyBlay4x4gYsWeM6R39deyrpBMbihTPoT/PI3wHz8MmEVb8qewmXgzF\nspvcIOjeEh1FaiImChJfkTUIK1xirK3z/rsfRwcnHBhT134/MhHL5DsCyOwX\noiERUp8bTHXyAkbR0ihjAurJFrckpoooLmENhQzOOyGRuyQFlimuFGitlXWn\nQgGyl38sAJe0xAOeAwXmoDAjbEKvr6P4khw4lwkafJyO8sUJtvTRhagcH1DE\njImgn01KikNopRRoQtJykYGyGQPc/OmzRo0pfVHoJFQamHjMWIDODgVn3eOe\nOrYGyL6j/uH0jktuadNl20b7XWt2+sqqAsuHVJcLKLjY2SpgP2XA/emyYEKo\np05duXloKOLCo9pugbH6XweR7F/2wRVqyMoY15UZJe6VZGsQbajLv01u6D8D\niCLtS7Qi2giziRanARYaqYX7N1qIdiAdBzQaZaKx9ABDUP17WF4UnLzItAFo\nLbdxgxUHeEJKilnxuqzeya2IlFcYqWSlpcloieywNOWd25mzIWDFrQADcP76\nyJeP3D1EK3HZrGG+1sF2UXmv/1vnbei/l3sQ5ZZGuaJcbDMA33QCqqzc/mDA\nQZVC\r\n=jZa3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7jzDsxkzxTDPC1vhmTERFUI6hREmyi2et73gV0M2hBQIgWnkIQrko2UAePIJc6cVmf5fa0dJWvwWfRJbeCk/kTc4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.06e46cf4_1549174369009_0.2783189284213081"},"_hasShrinkwrap":false},"0.17.0-alpha.353b916d":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.353b916d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.353b916d","dist":{"shasum":"3caac287f07adf2e16552a5537253257e8aa49af","integrity":"sha512-PeuwOsR45v+8po/NXjXo6pp3SsvA/BxUe+OzT+Xdq0xqkm9c62brZUUlufGDunNEWjwdv1r/AaBp6s97CQcM3A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.353b916d.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVoZsCRA9TVsSAnZWagAA5l8QAITky3W7yY3tgXJ4CB7h\nuBuvwIck7otvT+zmGsBxxDKmmdCNXUdDDsS0BR/gxzoOQ9HIty5onOfaRp/S\nGXzCP7+2ouhMpF0qqo6Z/krGLsY1uRpnkecaUrR39BX5n4oFVllA6h6cvGvs\n285frSa+Mv6pSGQDKUTNnDFI4SeRFFkfg3HROPPSyos0ff2vkuvDs7hEebyZ\nadmxIAa1Wrf662raN2Uk5iLo4lhYMmgcZfqGGgQ98iUGTTpc91Cmx85iUrgH\nJitlKkzFe8tNjU2JsYL4Tt7eM3kQVqJgEjYJzjR6Iqh0w4J3PipsmkRXk4WR\nRLaqgDCLnslISKaxcFzwdnBVyp5x/Cz9ALl/xPk5eRv+Dqx3fc9zkVD3FJnh\nqmW7APjtOmwgo/nQ3iFsT8/YTgglY3Rcssd14bcQaLgBbt6JyijF6hrJXPQ1\n4YuVyt6gYfe4LRlr4o6TO+qE1zSHuuU8BTSS2yVxjsyypjyW2F4oVsnC1bR2\n2yyrcTwY0/TcyOb2P0ASFUOrT/UsoHlXrxDZX8xS+kOmpc47n5NiCroajvIU\nDppPkFgb2BM+vzKVAojzIlq2tfj95s1/WIfT5447dzSWP3IjlY+7SpsrG88L\nUoU3vRwPqJ+Y4hjDDUUSa5gaDybTAKnZ/BxOVGrAam3IL80dYees3/M1btTA\nBnTx\r\n=78mn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQGrEzeyobUw+NbmiW6daHuN83szic++m2DG8BRwHUewIhAICp3XCWIfTbkbqothSHgq1Ve2ehdGoqfW6zHEt2bk+A"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.353b916d_1549174380065_0.34880940381005776"},"_hasShrinkwrap":false},"0.17.0-alpha.b1d40543":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.b1d40543","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.2.4","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.b1d40543","dist":{"shasum":"6a2d41c8195b6e757a26ed70a275e6daa708d9ab","integrity":"sha512-2nBbzlZR7Ia99dknWE1P8u7knZtfkR7Y50bILF++7vcKuqrSV+oGl6A/aagbfoYTZRd+xCemqzM2IOdgIL1GNw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.b1d40543.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVoZ3CRA9TVsSAnZWagAAe0MP/RqEqouiS5mrYO/I86jH\nK2c1MV9/UYMrdjnCCDFNySHl61JOGoeySlreAJt+JZWxDpMKGyARRbdh/xW3\n7Q+ieQk4ZIuOk7D2fGn8/mT9TJTLlOb+KDHqpF3thw7DWOEdLSck+ajHu6wl\nk0eyfM0dOhiL/m0sLUiidoB38uxDH/Jgo7pvJPEFNbYhkD/aOfSDHGB8A/SN\n9iglaHGkfeO9pHMNtakrIK4u49COyQ7nk/9ekfjSR3QUp4k059RO8gcW/1W9\nFiYHIwEnbXNmqgds+prEABRqyb3L0vXrRD9/adxMAW1SIflPKWFFsrC2o5fu\n/rU2rMKqkKhE5Ye8ImfE6P0UW/w/U0C7FKpXO7DQL37YcxkOGOXqNAly317O\niUg7MhICBW34PjXKOB/QLxxcK1J7jdWqL3wPNC+HNkVZNjnsSfmwMcAHS2pz\n5CAwFm0ZhBuswNx46ORh9hYC4EFFvEjppA9Zur7GqctYk3wHQp+42qUL0pLo\nNfwuBA8wBaKji7VO2VZUHDAU27sscHSIy7MnmKKIS7/FxfeUynTPXXy6l+Sh\n3k/C7BRXE8SNsDeJ1agyFfPo0HTMl/0mLyPJSJSegZgY1eN45KWfBT7XF9/u\nOTMh401i6ujwFijVXk+eYOVRrueL44FXm/kj1/sO2ocXxoKOfHKE/BeY7Ipi\nDNSF\r\n=QnQH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfUAIkcu2UJirWgRVY/1teohda8dpzKI7x4UbyFx+WdwIhAL3jc2WjEa5EQNIYxzqYcdSL/HiH5Z1cvvQJ0IBlKgiR"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.b1d40543_1549174390589_0.3374831547947259"},"_hasShrinkwrap":false},"0.17.0-alpha.7e68e4fe":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.7e68e4fe","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.7e68e4fe","dist":{"shasum":"795f764ac979cfcd5ed583ad9bb6d2bfbddc180b","integrity":"sha512-vLXKc9MxhkBjAbQfYQCVrvLQtwo5IxszBRWb8sNPsHE6ZRlxvwZPz//9m+Svy2hWW0Sf6WKaFGkm3oXe9GoYIw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.7e68e4fe.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVodOCRA9TVsSAnZWagAA8vcP/iGdCIIOqNpS4GB/VCaS\nilwszdmgm8fPP4khP5WH/cqfWhchSnWFvr4QhmeZ5mPml7pNy3hDg9+SNXEP\n/AF00pYgIjsjyqCXcwCjzlaDzkwcDWnAVcU1Z6CxYbATsEO1+6o3ShWBcq4g\nF+7afn+yhqxedeY6uyqQoYIimtGvkMaVijozmhoLJUc1nEugGS6vfOU3ZIPY\nm+9amghNNApe8eITurnRq/cbuIThpavx0+Kh4tZASrMrRnn08xJ3LjgVrLLQ\nCAqxHELUHzta2CGaL6WlVtFN27MZt7awPELVE7ozpqbneLXzl1HU5Yk9M8J0\nQuLiPp45H09METkO5AVj++EbQl9NfxLvsLB0lqGb3BDoNC5Jh0PCVE6o2fqj\n5miPzYGexyw93Wxaw8OXQVqrAU+o4TMvaXBIYLVXHZNI/m2lb6j9CpO2N93u\nAFRprCHAv7BvkfEkPgyFv3B2KjVKRqDnbAn+QORK+NqcCZmIF1eHgLxDkWGx\nVg6upKwv+BWVDWH64veeOhEmvzZXFkPno443JUo31QIHP53svUFWTWhaICkq\nRwD00JhcV6O3K7Tcr2/BPqPYEEfXYSBg1ZA7nSS3kbRvRyujapLjeUB3rRpD\nuTNEPwyMNlARwKxOHknL0NCe+suT0R0euAJz3jK6w/BvsYagkDG2oJ4C5AFj\ngjx+\r\n=Nf/y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxkX4ipAjdLobXeJsHJ6EEBg+TSAfpVlRSOkRBqB36+AIhAM5TyMb2cRZS8IpnWgV0wG+uReiHaYuTDczWMYiUZ4YD"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.7e68e4fe_1549174605471_0.03557788765476766"},"_hasShrinkwrap":false},"0.17.0-alpha.39bfcdc3":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.39bfcdc3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.39bfcdc3","dist":{"shasum":"fc6ecfd7a986d34625e2df9280d3f5eccb74952e","integrity":"sha512-fpRx+NZRyuIsrow559qhEj7KiLHoj3ZRgj0R4NeU6vn50bi10KYRc7k+IJoTO6pIJRYR6Ttn1r8XWKScV+fW9Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.39bfcdc3.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVod0CRA9TVsSAnZWagAAC2cP/RSKmowJYXK+sAMNccti\nSfgGwQwqvi45z79DuVLmWWf2ACA60wQAI7E9VofrtVQtJB8OsbGCXxQ+llJZ\nSiDmxz96lXeNEq5QpSnyIo5QzHSSbxHIYkmAASJeU+xW1sgxPPdMxRPSA9xg\nI363Awhj03ZUcdwviAv1fo+PiirUxwdMc3DvBGTxAELNR3SUep8f7R57uXKw\nQC7uX1/boBnBS4YoKkIpAIokIIT/2InOqTPwF3o+5LPG/QQcm9Yqc/xPt4fk\nmarhHnImiA0iQy0R3mLv6SZwwzAm6lSSBJieZr/1O8F3neOSvT0eoTSbMVbD\n9vUdUzGXOgRSb0v9K6cNWeDiI4DRHSCxq1W+DJ4c5vz/9Oqf3jcdq0bSMAnc\nmOb+e8PewcZOi2xyr32sME9uSzImFr0Gs5aAY/cAPA0Qx/7+xEvT6Lv8C9BW\nymDnLmCXgQmFRri2fH1wezDzeMG6FfdcRjyscc3qIXLFdyGNUeWHrfeONNAI\nrwfZ/stTNr9+MWuDyX3sSNv7oZ5luwlzdlyt/kft7Gm8mES+NOYxprtQwiFG\nON8EiWh+B8YdbxN7hm1REpfXmWJjj31sFxJtt/XCUlqNL1V5+2AymnOlqo0d\nGzm0e5EtxR6hCq+b2rpTPOcyM33VmAWke8rf42vryjN+dn05l639aSQq1aj9\nc2J8\r\n=R9zY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGAsInLOFHmPJ0XQkGiRcjZ4MVJS1FyO+YrXE1xqPEKjAiEA67DHMLSHluQ8t0KW2phm8c+NMjfFN9H1PNVUzjjcRPw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.39bfcdc3_1549174643836_0.6360036054022538"},"_hasShrinkwrap":false},"0.17.0-alpha.6f8b0fbb":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.6f8b0fbb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.6f8b0fbb","dist":{"shasum":"8588d48ae0cb051a86f5d631223462f2ed1160ff","integrity":"sha512-6oF4qudHCJC8otd4ynhp70jAVq+/Z++MWcErjW6vLLDKjvFsTy+W9+vjNA6olHAQ3yG2SaoI+l8R9FxqD6F5iQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.6f8b0fbb.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVoeCCRA9TVsSAnZWagAA054P/R5rHwyumg1oUqp7xqvs\nMIkzEKjL9oF5+5yjS7dLqsozzpbHrZ9nnsqMyTlEMCKWFVua/Htue4tJO1Tn\nH0i1Syfz/gWoPauvKw6XgqHDfxP1kBmBTgNH3izdv8dPKCYFMAnFYj35T44u\nPzfu/dpWtsPjjNh8gR3FyIv6wQ+lDAfnPUe2AVBIx+1Eu9lNIMlMyuJSW3np\nwwXXzqox9duGqB25/EaGud8b3vNYWzuo++EfwGf6QxI3kIDyTRD2ia+dyhU3\nRWzq35Tw/nHb1ncIq0IJ42xUqmuW3NM2gC9P7vq+Uab1+L/JyZ7fFbdHYwAF\nF6+M0tq1VTkelbsG9yNgAprN6r5dVLXYBibL5ZYxMydKHbuiD99beIczLOlG\nbypAschuk/8GwfAeBjVXjFzLA8TeJQup0q+594K6ve0ylEHZwlsEdUpDb6kw\nHzEVtgtzPXO0HIa5esMqfzwCWgx2mQID7hND9jUbVXc44Vt9/ySpDWLaZFDO\nDf769pLSh81R3aGm81jf/6AMpB7/L4sNmFlPs14bdv1g0GnJO4ZpymBVzKtJ\nwX7/oAAIy8Lz0B56knkld5hKadbHOxs1KXESMzV7JbqTG3zvfQOhdkp2JSTH\n5ckv77wXE5/W15U7wCi4TrEE/NvGP4SLx+S6CHBIZ7ZbCDhMT9+Gsw7nsKhR\nLwG1\r\n=OkCN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDForAgk/U/jDrT4kjm5zN9uQacEmAaBghIrDMBWJ/ztQIhANiCTCt+eALn4qnllTAM4uKfdKQnvUS3DStfryZZg6Fx"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.6f8b0fbb_1549174658024_0.4801918960358662"},"_hasShrinkwrap":false},"0.17.0-alpha.32cea6b2":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.32cea6b2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.32cea6b2","dist":{"shasum":"e2fdd88dcdb97821cfef5797d62b5c2f62fe2656","integrity":"sha512-SPavBfban0l6nXXeRmJGcH+gD2WIc3ddoZ2NPWo8wbuTnCwaggVAK5QOW5FgIj3sz65OJQeVAH26n71DkQVr6g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.32cea6b2.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVogwCRA9TVsSAnZWagAAUaIP+wTKnH0sFMHTY9q9B4mw\nRuKrHdX+Bn+WnO+fz9tZ8ryPT1ktoLZIeb9WOfhAGZq++lHboPzWy0ZW4b1K\nB5zfRRmVYNfgmmUsJKodk2VD6VPquZRQnJTfdDNJhH6DH33QTlO4LXcSpr2Y\nNQu5pGm0v9YniS4/v3MxccLWpzi9KVgPwcsR2PbVtG71w/JO0Av0RP8nZEu0\nzmC+Rep8SO3Ruw6Y5NPQE4FmYp/P/0iF+Hlluoo7YsB1CaNljL/m+r5vmTdZ\nEk3s5TPMGPP+p6+8Kq/qiA04VRU8FSXaMuyn31MDKZxJlTQtls36gjLnsa/+\nsfqa/oo8RPpXj5yy4L/gQALckHa1Iq9Foa6J0rupOe2u/qvvD67YdZNcJAet\nHgkIHwaYDeIud9+oVCjnVa8ixWzHQEdmiUWKo6OoPF0oHyLg0tD1A07L7ffo\nRgjKJ9S71nWTB8N5e0j/KWpQEtAhZTAyF8kZr0uzJ9M09oJKWraIT10FL0BO\nc/CiUKXyhCuPyM4+zQQkVu5fqT/un57U7b1poO++MOtNgULLiNgSb6CMUl88\nrxxy976OCwANNoKWMR+bL9DLqyILt/PUWGnboziXyAZS/wuD5ytOh0sSBvVh\nWI0eMyBLsuwD/6hkXQR8H0RIeo5MlUgWT8uCKuSoZBfSYIyvcfP3P0TaQ8+E\n3XG7\r\n=vG1d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC8yfc7Byb7qQOvO90UPJepRofjziYVLlVzmqFrct1eWAiEAwr40iXVuEb2lJd+dThsab9FRU9K0m5MJwKXqkTRhYaU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.32cea6b2_1549174832289_0.6984262942154109"},"_hasShrinkwrap":false},"0.17.0-alpha.e89bb71e":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.e89bb71e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.e89bb71e","dist":{"shasum":"ebbd6072a0f63a196677ed8317871fc4100b1ce6","integrity":"sha512-jL3l7cRsPgXGLDQBgUOBW/NbQX0CoMLYdQ6nt6BsR9AZWIeOLdLtGkPUR7aCghi5Gmnx5S7c+H6hMX8ZW8HCHw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.e89bb71e.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVohXCRA9TVsSAnZWagAAC7EP/2F2l88C1z0yZzeIyY4u\nfXSwmZosUXV4xRnVeZrvYh53wi6GbdI27592OLfDH/fUVff3dVslUCrxWLM4\nj6gg/C3DcPvW8wm2YtYIySzTQDkiQnsmmmsL/YSKyZx9LKswpU4QEp3Lykw9\nN1LwoZThuDHWff1qUPaIC5qKKJPYzNU1ei7Ayqoj7kw02tvANAvU4ZZjmKFI\neE9wz5D5XwMyWJfOPf/5nl15jEmlIqQErwtiJjgfHEEwfmVc+psBUAkcs1/9\nmT+JAipNhbeyK6r2my52jq/9jCGWwaXK68bylf+vcqIfChDVZr3haqOe8i/6\nD0BiNhuGFfxbcTYv6lemxxeExX9snFPgm881e/o3Q0f2jZaDG2qx5MxyIAcp\nhknraX+SpHF1pi6DCFIFDVfdcasJ9BburNpngOJZvEQSraz8ARcojPQZx6Eh\ngRiSe6N8ea+RwozGobhvoiLPOIZyIz0C+0kMQDU1r7AMXGbONtYh+kNRimAm\nU85LHEM8WeyGp2lpK7meYdKTROC7X3kna2YGVal/MWtmTqMlS/zGMK5SEbP9\nbN1jhRrsLN3DSFJNw8EH4bKqLOfM2YbiEaEqx5SYulYVhOHL2vaZOlFVWuWr\nwVDBIfSV1x07I7ATCX2HcxJVfBaXPwTXXpNjF+IaJamoO5Mp74kSlQMPUsn1\nkU0T\r\n=o+Ef\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwTIU65rV/TFapxS9k552UuyVzN8WBUevxyDPt8yQQJAIhAMbqkb9i6vQ+zeMMp+U3bR7BDF5wae6uG5LyaDbBMfO+"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.e89bb71e_1549174870561_0.5211397779573403"},"_hasShrinkwrap":false},"0.17.0-alpha.38d1a021":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.38d1a021","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.38d1a021","dist":{"shasum":"9108db86162e1ef0c73d63cdfc7ad0d2597c5a68","integrity":"sha512-YHVN7QuHm1cUEw836P7J26sMWxsC8H+7UH/o0XfINwgWJl73NNPRLlH+cAEdYPQwSYVrAKL+fZpO22J94K9EXw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.38d1a021.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVpBHCRA9TVsSAnZWagAAWEAP/inXLAoSf0hw3EQqIgD3\naJDV+Dvo9IVK7osBWg5IXg51vY2X/O1cyvRILMQ+lRPEN2WNCBcUEv21Vb6Y\n5/NYvexlFu/peeVpX5ZAOFQDgB3iZT6N62mdZsB0EL5HN9FzI+GFgNfZ18oW\nGox+6qYC1VSQYqLA8vyLWYulA12NQfn2vdsGmf9DPpFA3+ZyfC29+MPwBN/v\ni063Jgdfax8666xrWpDZqiQqlK8oNnihtfIxT2GnByhN4xPqA6czfBKauvQl\npgVI2kv9ew6gDWh9vbAkQ++uDZjUJmUkccIgmhl9qca+S1HzG1XAt6xG/+gh\nFPSoumnYhx2vbrOaEx9hcR91vu0nr0+WegNAOqRy5k83iNy5TpVETxveBH68\nUQ9FzFdrKuwDnVcxorMuQgJhcqzDarFBdCGTv307qBjF99x8w57uZfMqMoCh\nZ8X8lfgQ2Ph0eVxFZZauzXkGClNCb5EBTLBE6agcmOug8BH9a17VELszygQY\nuZbWk6ckiY1tOwaF41wqTexRCMLmvd7H0m1T6dsgzIbs0G8F/GypkKT122uI\n7njPWCbsaHo0KFelAr7b3VlkBg4oi/SOAC7oI0j86jCqdyneFbRzBY0saOqA\nmcPMf+mZn7hEhyiPCaVdIKaFl5ttSAvThB4MwM43fnTR78dNyC5IvEHdmgru\ng4R9\r\n=KMro\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHtKLiW+R3vELEKfw0YfJBCa0SQmSCb3hD1Kt9fzmpHWAiEAn5r9XUwULHpcTzZeU08KzEXRfydhBZgl+94CxaupJmg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.38d1a021_1549176903256_0.6150740250971156"},"_hasShrinkwrap":false},"0.17.0-alpha.15f2e004":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.15f2e004","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.15f2e004","dist":{"shasum":"d0f92c7c4e41a8f3933ef0e1d31719f7d1ceb31f","integrity":"sha512-FzPMWSso44a8QH9133NBZmL5MEsgDtNvEswfxz1kpAPWIdVbbNkolUUdkxZJus5BiF0/2NKkfkaJ2p3ci47oGg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.15f2e004.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVpCZCRA9TVsSAnZWagAAvg8QAITIRE6E0Mob5JoV6HpV\nJ/dnNQrdRRiSgQmxlI2cBYSQDZJ5KoXr2Ya0IIVyMJBXyhdCkGoYlnyGiNXW\nY3v8Z8kk/Z+W7WabAcOtv//bsW6SBhHL63F1S+Sjzlhdzl8C1FnRALNyOu+e\nTuMmpA7k9N1NTvNQeleNcPaiMi3zHpEkWNtxD5KVpv2sYT5YCuBVA1JVWHJo\n7s0gJWttUJXHBDqfrYRRYEAoLDLLL3rr+a8/xG1cronFJ/ajYVmZF1nl3W4a\nV+qp7aArsQq/s1X8a1X/zJfbnBhUQ1Fzk1uY8ghhwopExc+hr6NQkvipNet4\nna5r0aL7pk219cO34LTMlYtkQgz7xNekLwhbjEC7Nxee9fCJ4ONNLlwQmedu\nEbOjFL/2hEaEcanNPaRhCZxh6BZEPriAi6Epz27olIoeIMrN18NQudNVTyD0\n0N1jeht7XxrtuYFxNoq5BIyN4OpNxZEemC1b1Zf7Z6CQYL+ph7gxgXHdLujq\npgOViELQr4JVDPSEBM3rCxoodR+lEG2rDja3P1evlom3WTFMCYtghwy6//JM\nKf3aADojz95qoRfyGzG00lMNUBFRL9gSYhj8svgCucywyIT/iv2sl8QeowpF\neJ00tQEWuHwqzh1nqIasj9wYLTlhkImKGD/A2YoYcsLJXNHZT4KDlyqRzOOS\nQyXo\r\n=QyXX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDFcd+cXe0YsAh2iEFXU2GEkZZAWbld1dUUklNsvpd6uAiEAzODmDTjvwZFYTI8z0GgQTMUrly73odFxwDTSUkp2hJA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.15f2e004_1549176983686_0.20814125909770365"},"_hasShrinkwrap":false},"0.17.0-alpha.519cb25c":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.519cb25c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.519cb25c","dist":{"shasum":"2daab88ac8e2febc6ad453d7321a634e9ada5a11","integrity":"sha512-ePWvwFUpP7abpPiVBtBYhy1B/MTqgFhSs4crvNTtvZ2eHNYbXB4n8zs8h5aDxivTZDWpBirRtFTkciFTrPkTfA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.519cb25c.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVpQ4CRA9TVsSAnZWagAAhMMP/2wRvqjp6y7CTkGBmeVO\n2SNeY3JBkDs9VelX3aH2R47r4rCVfgKKcgf58cSrNfC3WrS2EHMjnXK+A2Nn\neRrJt6VISIatNcwInboPM2lMnHMNmIDjOI45ESXLkh6k6qwRoifhdOg9KiPD\nL3i3PzxpVPhZz6/5oaWtbEhseYFoasbfqgpBxX/VzEhRfm2uo6phjd8BVzYX\nxAsYH1FDe0BkAurN6Vw1XkSJ5YC2PP/sCX2l/4kYnkha7ziwhfSb2/GsCx7u\n0WZCmmQeBN5gRiF2bIvPMtDQiN+QZpto6Ws6RM57SP2ngpZgHfaHEBtA2BW0\nH25zKFQysV+rTSxkKIcgO/TVPNI0FrNWi73Fqypw31dGlaJPNefK8kDzhsKD\njo5AVj+N0szPMf6kyPES9eVLUwD692znxoiu/ke68NI/BdMyxfwOPyK9xdMH\nxZo9qhXIQHOvJbCskQhtAoByVmSHNqKqCwRQx0wtHi6yHYBVXFrbzPZLARIB\nzl182HAm4pdTMmIMuxPI8bF0qby+FPEo7UQcLAiKrdygeNygiKTxobHSYjyP\nFVDpH0iIY56TNFw2vtodToeq0rgs8Bg/nr1srymH9cHLH3xhxqM6e4O5q3V1\ngzxWEZHl4COSI/tEU5GDE3/UQ0LgmBO7qH1Hr2k0MTiy781ousma/OVDdr7h\nDF+1\r\n=xV/n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFFwzGciqpfv4iPbnwTuS7CtX0qKHSuPZy3T8IsXn0DQIgKg46eRro6QZOU8e1VWm+wY1RyeWOblKBdE501aMLFAA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.519cb25c_1549177911576_0.8530707437773657"},"_hasShrinkwrap":false},"0.17.0-alpha.7e3da843":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.7e3da843","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.7e3da843","dist":{"shasum":"1dfefcfc5ecc2de63c29a3a8460f3bffd7e641be","integrity":"sha512-jr5+auiwB+u4nrkgeEmF/1qZAd3ixznOVu39/IDckd05+X+7QrFyKW9ztjzVU54XkJY64X7lcl8GwvSxtFwyrg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.7e3da843.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVqKuCRA9TVsSAnZWagAACZoP/ilzOhUZaE4acVmMfeez\nvtxoxDK558U2/6Agx7IrNUAEbw66baB9U+YajCwqhVW8AfjgVmHI6m8phdzw\nbx8wtO8yhKN7PQq14v5pMpgVPPGwM969wczApbf7wYvKg+3kel2bO3/losYB\nCKqfNz9fQed8I2cXQe7TBxLPyMxi41ZZj1hHv8OSMA4Mc0OFPVrG0yL47qqg\nSEgq8w33ro4lFWA3cdrCqeI/zw7Qf7O/bSUzeqVrnLAqBJh992uHIB7ZYlLN\nTJCWgU/6FaebkfvXBB0fahd0Gx9F07auKl2vKSAmPKMI5tUqvt3NLrJs78aj\nqz3Ynpx9K9xkNGhrNCdUzBJQKB2wMnh4BqB274QH8jhEuf97uyuRfIFqAULl\nE7h4hYAMsbCFm+zy1KSugtLSYuTyNq44J9Nr6a27M26DQJsl1j4waXqn7bXU\nHwYGvvO65SkPc6ODeRHq9eF4TXT67bYfIvqrPWbmqvArQPnFU04a/lM3nzHY\nwb/waPSh97csN/MGcItRWBtOlCJ49GUoRMN7qIefcCQGxoFd/y+6EFNJxza+\nCrbF18J4nQzQdolmlRXBElDuSH9bwnVP0dYygP/qa/3J2OTiPy4AawRrTpsN\nK2bFRUB86nVQuHIlAv2nyqNCScHlICY4ewdvSZYFdMIFMlaqSe9cpAumLMpR\n7pkA\r\n=A7lb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC+VgfDycgjwOJap8zVwgxqHrUBBI5M2Gc0Kg1gWmyjwAiEAne8xPMzKi3gJRRGMXvqUJPNvsEZD10skbN7U4GeUj0o="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.7e3da843_1549181613445_0.5736610994195237"},"_hasShrinkwrap":false},"0.17.0-alpha.1dfecade":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.1dfecade","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.1dfecade","dist":{"shasum":"b062097d60992fe041141cb2b3a3def7844dba75","integrity":"sha512-nHvdLP+cyhlEGTddS2rOINZs60/lm7ZutH1hblk0CXMotcuvtbqjnZ+juc+j5WdwpL8V7BQtifDBoYeZYJ9ThQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.1dfecade.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVqenCRA9TVsSAnZWagAAwjMP/AnVGXUKeCv652QtR421\nEumGwB9Qkb81O02AmzWFuLNQMUd+QURncG5Ss4BhXXNVmHn835lREw+fuuzd\nKzikQtWymwxGK244wqmccm2PptIFAKtAL5EYvR3v7uRtnHZzDNRGGc4UlRee\nlyoIuTeYrSxW37K5bKZD+4M9WtaMCd7a1QXnDP0mHpMSvono0Kz6ghgxmf6n\n8cMMOkt6uPYHPp5rjBaqttAGU6zunhKhfsL74mjUMcCTCNngfS/hTgM38Itp\n+/6yAIWgCtZiyR4h8n5ksa4FOdAsmdIoKNSwpgBj33Gj++Pfj+WXd9LmaFyD\n8Trp89gI0rrGfxO7gNVpvaBjYZ5q50LMyNSe1YtiabWcMCeq9Gi4dO0oVmqp\ndzdmmdsM5gfHgggGqfBi2RetH06uvziYS657d0/0/k6CZojojlQZlwO+ws41\nT+NgNZ/Csqba0Mt3MugCmYwFoZFiAH5wRFgIbarCBsggB8MbQ+sYUWguzKow\nJ7AZzm9/+bk6buPkuX9fe2XrjwHw5QEIsko0dycgeL5SSJOh8sAlFNyoI34V\nCy4CunvlGLAmU7oqFOxwilCTJNgWMSEnDtm6AOp5+AIfjphy3etyi/C8wJqh\nuYkyHWcK9iEaOnPQOnL6YNdIzRuiQfjs4wZHxhrG0AN3lnoecmArePwQcQHW\nUAwO\r\n=v/rd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDb3yYmWP02TKYcXqt/EHU+r7sajx1alcYYFwk9Qg8+9gIgTC/3miJAR75XPKHuXfznISQmpVPBI5aI6gwx9kEi1WE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.1dfecade_1549182887300_0.5024305182676574"},"_hasShrinkwrap":false},"0.17.0-alpha.d32099f1":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.d32099f1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.d32099f1","dist":{"shasum":"27e4f65abb6fd9f123a2e3452baa596c652cb71a","integrity":"sha512-F8hGbIsBBXEBsNTDayg5iewt2AGJodNETsB1OgXjG27vMCRq2/qlyDkXRbybMpHbPkv2gLaPvQjhUTTPTt0Ayg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.d32099f1.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVqhbCRA9TVsSAnZWagAA3b4P/3Poj6to0qBgECJF+5mw\n1KHKsPicT2Emp9Q+ULGZG8cBcdlcmk5EfJvUjCncn4hiq6K6EDXRoI8ZTBIM\naefRUQkqkjNc5jjSdrUc9HM9vutfg9VejjiwYN3NZNeOWpWNUYSxbvDJ3Y9D\nLVhhEWkLaSKKgbeJwFOfy4Hc+ADUwlOf69+xOIp4vUR5AXYf3IxqzRQs0a51\nLQU4gBLtyiF0xNUtiogqPQnZjeT52Tko02xSvfSKFeEJNYQaKEvx4usRcFm8\nQDWpXvIsTABhQJnRiRld9TU3FMiO+KB3aoYnCpjNei1smPZc2/Dvx+lgnusi\njMzTl3txOaYEPbHZKdt+eLhCEBtSnpJ+wPHs3skUMTUjU6UFWeQ9kfFn7F5B\nUD1X1iziE3q4MyE4ksFIB+82kH+HV5VvRKnpTyXDLmEYf9Zdk9X4Wr6h71v8\nblihf5vGeaJCEMN3MQa4WJ6pSLJOxohxPtOsnletj9xSwsnYYq1tVMdVgU5T\nQeUQ421qi/GW/jKxPezLfBwVpTGKKpMNs/WxS6uaawDRUZkwE8wBKe5MmyQd\n0dxnW+C4IS1ty462DIz1zm7h5gRw7A64LM2t/xn5nqyik5eEmV4cKdg56ukF\nBBcDVN6sJkjXOXMOtL8oGnU1335qE9H3yPvI9XBbRI6qTOHq4SquI7GXBB4z\nmEVU\r\n=qA66\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAErec0VpZBQS/6vanJrJYBbgrK1oOEUrfENxUgVj5GQIgOAgyLsW4y1PbFbylsx7raSZNd4u4pUq/8iYImFdhQSw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.d32099f1_1549183066780_0.5643520535451507"},"_hasShrinkwrap":false},"0.17.0-alpha.2b6610b9":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.2b6610b9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.2b6610b9","dist":{"shasum":"e3e452e43c44a5a1ddf4dcff66ef35343ee226c2","integrity":"sha512-9lDnpe+Y+ar80iIKJOdUPlPon0/aqtrKeZJIucZqbVQTqPG8LYc5wewxuj8VarwH3nU81RcagHWDyto+yEz7EA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.2b6610b9.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVqiQCRA9TVsSAnZWagAA8OUP/iNO4MaAEI/nDFtxMBLT\nDq15nH8CBLv2Ns9R4qXiCwQa9BCmZrJtwh6/IGen4V/obmuiIzOaWEEUwfXr\nzh8VVuLrI6LJYrOAMVXRV8mys91fCtY4Co+NSbgbX4Z0jQKuGMKABA6BAy66\nw6iYiNi0VN1zHTUOgPBfV1KQwFHweT9Ckn1UO+ww+31Pwx74s9mTELSIdyI7\nMnajDGvwKbuz93Sr976V0OzMAg5mldhiUQVMeohxCCbcYTWvITTYJeQyhGH1\ndaRueMlBE7cTN/33bElmgDKq3ZZnY8DqzfRk0HeVrw8uer7bqVbqlHlyP4Mt\nrxTb7bCW5JNey5gTyo998kAwlFmD1oZU8KuAcI9o8Hnc5VhxRXuqmE9xT6ll\nC7PV0C2ULapwIIrG5IAFAzg0S2vWueHgSTBPcFgD8nskJVODgmpI/xz7N1gi\npds+tOGAl+Y3YGI2KUUHXmnA+FsFMFI406dWJPfk+2/nu88OhZ98JOXqvT+w\nTIxMM9mxSo3H5+fHCESb93Tys00bs6bxujajNoylZl3Z0T5wzea35Gpvc6LD\nmAEZn4JR02ICS3VpPks7DZ9sSq4M1dnAgT6jB7YAZdVGJWB0zN6JeZI/w7Tj\nB+cTvHEdh/v6q39ptXKCf/yFgYtg/7bo/Te8fMSORHJbEds4UyY2t3J0QAkG\nlo4i\r\n=zKJO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHNhnpm+WJ+IrCNePk+IPGJffuA1ij5TsrFubbClGYzWAiBINY0bMjp98elO3ct4fRGs+LNu7doSIS7xXbVwsbxsTA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.2b6610b9_1549183120057_0.1382621821075809"},"_hasShrinkwrap":false},"0.17.0-alpha.6cf5bfb2":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.6cf5bfb2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.6cf5bfb2","dist":{"shasum":"5795c38d8245834be0e4a1e8c9beff002e907758","integrity":"sha512-NOs5+VGEs6yp6PmzQq4qqyqPfZ2am4dUFtMOwwOZeMtVS9imc63XLdmKDfCKD/fro5+f54OVsGG+xN09cS842w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.6cf5bfb2.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVrKSCRA9TVsSAnZWagAA800P/j9g9z8594WF61TQbQjh\n8dr5xcUR3z5C809MuNKJzXympRa2zW7BNTZxoGyyhPRm8t6GEcqaqfekCcvZ\nLevhUfKfHCsQuQDv5JREXa0BDGao/sAH0m0dzHa4QFhV1Fiskk6BTiEQwdsO\nKjQNNJozObY6DpXrwXMCAwwMLSoBhViEQErezo2Dzs9my0fHdFX0FBEWvmzM\nmSQXaClPlPOVN8Q63Dk7oiF9HnmTfW7lCFtBVyhFLEx1G8n08UlCodqkRn0G\n+juZGXtXyVQhCxMueDpuyz+/t/E/CxJ/5gNtctzBmXWT7Z4RgxXHrCIRC7RD\nVBUdYEVQUIIUtPDXlLqDPD99KfmNroL/WJKfbUqUOCtEzfNseOWBlyk0RHPO\nR78yt2FgOqxxs7Ka1M5LyTFxhWMsCTmq20Ehk/5hTrOKhEqXMLjZOGnucIYM\nyEUSaUJivd6njGebYoPW9fiihSJSmik52dLSY7S2YIgICxLB9Jq+u/REtmmm\nToSLJPBrzbqq+XrDp1wv2KRP4Ja5RLp38TdjQUSNhlCMyU1M9t9vZ+ixiOwr\nzQ9fiJDYUrYDWl3TAKe3QlKoc904jUb4r9xqDgzat0f8Cd8EjfsPjlbDFRwd\nQJ3JhgEWbguRtNnWCBtIOOcD/j+8Kpsdzsjbw/fFFsGPSvqoFBbeGQTnaKsB\n+6x/\r\n=np3u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFiFqEnSkJ7FefTiUha+fSuc6dh6vm6qFz9QOiDYg7p2AiEAuHjVYbUdjvFUMNsVOaol3Y/LbOLMac1qxlBawEYC8f8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.6cf5bfb2_1549185682084_0.05353569936872238"},"_hasShrinkwrap":false},"0.16.1":{"name":"codegen-templates-scripts","version":"0.16.1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.16.1","dist":{"shasum":"c1923a10d8d79009f837cbcfc5ce38c0157ef2a6","integrity":"sha512-vuPla/w/F4trFmDd06kphoA4Wx+8ULyqr7A39v7+MLgbWi9igZIUtiz+gl87NLzp6P86+5y7oZhr6mFN8CiD/Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.16.1.tgz","fileCount":17,"unpackedSize":15985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVrMqCRA9TVsSAnZWagAAJl4P/i3dPXjQu8SdZndp6Vfc\noqwU/aj1oqsc+tF65SjXPona1iEFPdRO5D5z/E+5/fHufGyRj8BrP5gMJG/o\n2L3bwly2EKuaiKHB8loAZI3sLX3b59MixHHm2HA/JhiufvTXQJHVXdwbR/aN\nPGoyRGR4/EbwUEt3oA2bPFM0dPkrDwO3OFSeTA38gVWOpyowvxTNVEmk/7wm\ngkkBpJTyqG8zl30P4c/G1cyOiHTcTYOqRfiCYM/BiNuaIySxOBc+uFVj9kgH\nt+IncEAPrTTCDIuttYSA431p6wPDd82mWt4NyQQlQjXcqm015m/n20Q/SDqQ\nmoul0D1mhp5CqMJbzh+oukLJr8R/prCpeBHEuxJ5ahoHNRMOKftUT+enVyKH\n03iPk457f/OJqU2gWPcAj1v2Sv86p8JC0YS3TQTC9H2fpznxdN40IlsqlDnU\nIFM3dJOeJ8DDokmbL8lcdh/+kLprd60J6V2iOhAWGI8LCFTI6xgIezwDxHDt\neQc2om/QEXLI8Vn5+0RlPDD89Q/q8WJVoHuzua6iphx0PVi4DwNxrIG1dsaf\n/UOUrngaYDCBRG22nS38OlDYM0uoMZDQmMIC16LeEcmSABTPrPa5BU5TNqAf\nDcWQXb4dDjhCdnihiiue9dnlA2xmgPNVEw0ffIdPPnIcM7vrZCVf/v4fUwbM\nSqbb\r\n=fOma\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsmgjIwSsllm//FLTMpcOYFGvg6YQ6Va0UjKqXN+6PyAIhALU9x48mHGiknvUgDcvNI29xp0eAEsB3yP6oiJ4gH0eF"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.16.1_1549185833724_0.24526814490375548"},"_hasShrinkwrap":false},"0.17.0-alpha.530adc56":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.530adc56","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.530adc56","dist":{"shasum":"528cfa4562a3d5167141353f1ac33c64ec667cfd","integrity":"sha512-BVAIz7l9HK+bC9hqpYwEN5ephHFDyr9dTqFVYAPgsds4uoYAz/WlgzgNL+nObnvi7vUc/DQi2er+GO/1z1nDdw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.530adc56.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVrObCRA9TVsSAnZWagAAVIYP/2B9JwAALDZUfmDWkzOe\nN8LJ1ywni8iG2b4cgFdvr7cQU3tdcN0wg0Iq/gzAOJmPwqpIH68t8ABvAvP1\nHIBpXWbgmLI/Jm3ChoFExhaKM+dBpvawM2BpY+JnMQjpIG6YHiPrur4b3QJ8\nNa9m9RpDrYqo7RCC+ou3pb/zbP8jJ/sKUZFPSNVi/8LPYEIgyG/acpimLom6\nJD5LHerMa/8rYd02n8SaeCMkDQLdX2gWpf5+DAzolNfrd4Kmwv2j0/BT4D25\nMY5oxyC/G5AJPfeoh344RXPNiIQvCF5MsOqPx2bovsaoVv78Zddh6cqLKF5U\nvMeCt7wtKUU3txvzBni6Eto+AS/2MlfIXc70vlQiW3jjmLRfFIOjf/RF4qmo\n/6fImgS9McKFUYnlGxSMrIOoKBWz5y3nW58pHf0mo1ey2sp6m+uIw31MJfFE\nqyqvslxsAgKB8TCfnyS6b/IXGuPY+b704fxge7IJB7RuzPQXZ+48zYJfyeaC\nr/1r9u6XqGao9vEIB5LCkG9iULoFPaxnIVwOpjYhQbDhi5OAnFBrzVLMMt+4\njhPy30sYoRMjTkMe0/Tw31uFotbrL9QwXx5zSbxyVu/uDb8BoSdhp7ssFsbn\nid5miNb040RaeX3TmGRzBoll7tDXiEyw+ucFclN/tvuoJ4Mk1897RH0/Cfj2\nmmo2\r\n=owBq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKpd+gVXXIHNs89h3zs8wuj/z1u40lELe9XkkktrmaWQIgMI2AZiodkFNhZGnHz0x8YzRSJGca84on3rITAZI5Vn4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.530adc56_1549185946992_0.5471734690467167"},"_hasShrinkwrap":false},"0.17.0-alpha.206bca2b":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.206bca2b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.206bca2b","dist":{"shasum":"af6022cf2e5cba2e72d82b409b9a145048ecac93","integrity":"sha512-gzVYRpubZkNSiDnp6B3kU8fQLEiZlsitxClyHpnlXVTBittujjmru8URFv5p7maPWC55f5qpZFqfb6fzrEKxTg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.206bca2b.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVrQhCRA9TVsSAnZWagAAUhQQAKBQyAcmMK+xmZTlnz2y\noPtw4XMu9QiMsCRy4Bw0KO+XYHENZe/XEB25oEUFCZftmGSx20X6jA3Fp69V\nLGLgxeRWQs4w/prZnmP62UVFMUbw91iYxHtGh/oWbJ2igOzCu7J54xovGlYN\nhO4s6g84UiusncozYxYBgc9X+lRdm0/nnFB+awa2ATp7pd7NPVwxpJS2bNmV\n5f7FQwWWD7iUlZ9S8rC8xN+5Y7IAeuul3ChQxOeLPwHmTWeCq5EKAEhYsERG\n5SjVh37TIXP4tEFqiYZ7oT2SLWKguVf7xCgHVa16yWywA5v5KdOYqE2BmuE0\nIlZcHYgWutyX9217NrPGYuNR6w+M+ssH9dBR5qkPuimFa1aN41oUK8uqiGRK\n0gBIcbSXhjDjQqaetiNXlZOJSYHVexsEa7505h+HonsGS1dRplOjaRXhEtri\n36mwoezHAZPzmArHzYZbhZtnEnmUmKFWXGvA0ilWiOoi/kjb8ZJSifV4bZ12\n/+liREOP0wgz4YErPE0ZJfhF8y6BilLWnRJu7vQNZSkngW0R/9ek/1fkkTjO\nojYaTROqgElDIpkZ+fYYy4WWCfJPl2S57scj0UiYJQbRaNop7O9hD5JvwQ3j\nGfMAPzALYcCgu4svdshY4nLVf1+Z7MDuLRPJcSsGgcH45puOwBdTSbmQAcqm\nPu/V\r\n=1pIq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE2xcuFTL14hyeVf6QzG13T8fZRlwXe8XuEJ0lyBjC6wAiEA6E9BcNPV/BqFQeO+8w5pmDqIaU2qsjGkb6WMAt4LLPI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.206bca2b_1549186080946_0.4220030646402648"},"_hasShrinkwrap":false},"0.17.0-alpha.8e787c93":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.8e787c93","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.8e787c93","dist":{"shasum":"376cdfb5fc5883663d2ce94b8b7d412aab404335","integrity":"sha512-0puOVXbbC+AN1jlP+ZWuycre/WiX1qFe6ZUsGOYtr5JPfbR7cqNKSvhGxzN/nqM84Cs1i0T22wMWy2dnSHe09g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.8e787c93.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVrR+CRA9TVsSAnZWagAAIf8P/0LtC69Zxhl5y8E3Fv4F\n6RyfWoXwLHg+kOGaZXOfUAjP7bXg2NR3/NLnoqMF6hLkqnUnVkox34zki8FA\n1FSDBSauvaonAhat77IxbQ7/ftuF984ZDEr8G6MruWcQjP9QVPs5K34xfTkn\nsS29DSpv2z1J+NLv/HmXUdPDm6FOOmNisIhRWs8GavMvigiqqN0pvJQuwKYK\n4VQIgP/yYeZfDbljrYtABJRoSqBiJcH965XWaP+oT3j88ofIGnQMSnTYP/Xx\ni70UhiVBWiHmPbHwrZs9WaxxPxXBsPxhkH0yIl+xOEHysUQjWmmBuDp7c0GI\nig7u8oQ/K1PgyQHkDGddK7AK6x8aFa/ZI4w5hoeKGDAXhkmfVHPY0bvGl3iE\n1RYaBd3S7tIbiTwCYrGgNv+FMLOiDQmpwERPqy2qFXW5jz3fopsqCiW8lH7A\nUWUlgQ+4lXIvoc2PxJdHTN+IA/LbNV2nKhE8m9Q/FwncoqqsRwZgVHzBCwXT\nL426ZLFnRkVzWsSIHiMebl2WGMxJ6ChnoaWXglrz0WUeyL8ONx9Bx6SjJ1AW\nx2oeOoaT1vRwjwrFSTWZYLCVZjvDnOhatBWnWxx9jYuMdOof0e6E8H11PA2J\nt0Nu00pt607QF6ci4Gxobdffhb67W1i7b9pVjtVrvvThcxIP/l53jLW/45LH\n0qrO\r\n=gLj0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICfV2ghNpDkFSvmDDCi3LG+R2FSPnqYzPzlb8X05dcd2AiEA3vBR06w9AqgqNspwhQyiGKefw4ix0Pe7JX/BVo5RhAw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.8e787c93_1549186173993_0.2648357301251132"},"_hasShrinkwrap":false},"0.17.0-alpha.73c1b445":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.73c1b445","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.73c1b445","dist":{"shasum":"70c4389c6704dbab50d443248e9299469dcf0888","integrity":"sha512-TeLM4NyCbj/GJzNl8horxwpo0DqZXknjyyQw5r9rAo9JaziMCo4Bvuusrt4Ch04TSEeDbMu6W1gXIAo3G0de6g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.73c1b445.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVsIlCRA9TVsSAnZWagAAOMcQAJ6Q5Ral+a7uOuz7F4fe\nQGZQX/Q5zycPxQiIkIZiQUgpbgcWvIs3LGC61UnrKHlTVYdW+V9G/E8kUTl6\nay64yw/mIXmpDfsT3onUJAxjLMUCI9pmnqFV6So68lD5jYwKAKLlDN+Up3cE\nmy23uRG+5/549/80L4sANf9y2nTbsPZKYGdEt08cJNtor3BLlIA4ZoBf65pA\niAo50YB7ASmZWlcFZ7ljUwO9EULF208YcEx4+B+TnUdWMqzTy8yB+trIZ9zn\nSbnxi9ktJdx1nPKgOnj60o4i2QKLf9t988huOQMSiNY6BaUXxEtJCfObE3e/\nq3w5efxNkrvRREEjJdTB6pmUCC/XmmugNZxBoZWXqrgi92Q6PDHMvei9v7ZO\n4m9XAMdZVEoNllHBqSweT6CbJm2FdOXuN8bS635o0Sm3PcHY7YoREN9R58yp\n+7GxdfQLXKgb1yXva73IfRDGg0cywxf0WaGCSYmogTv1H9i40C+1TBFDeCly\nlosuBH2Ke3psGaTBU87BwzYMh52l9zgUPY87dpexDeErcnnOFPBe64SVSJNI\nJPkkIRyRwZBPIjPt66NP02PHZuL4aoZNXRsyIUA1jEpDPkm0gCSi7zfGmmrF\nDN6fNdqWTzAnbiIvbXHLp9O/BmRnrXxYKEugZFgVWHUInr08wwGQ7C3nV8VY\nPzwj\r\n=84ze\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCv2w7+mJ7mHbUEh85o9dCTxNr+4IEeGQvpUaa/SS6szwIgW0W9iJ+A46RAJxgu1J96j8HBrudW0Rca4sIzkTs/qgI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.73c1b445_1549189669083_0.9495231704750273"},"_hasShrinkwrap":false},"0.17.0-alpha.eeebef59":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.eeebef59","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.eeebef59","dist":{"shasum":"d498a24f67336d8b4a3861922274cfbd22a573a8","integrity":"sha512-VucvHO9l0GzEgoiza4ak42uqsK2m4YVpNkrWmedgV6jx+2yGwA5+2UAPw0afoxBMqeOZ3GBRgWDKM88sTxFnYQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.eeebef59.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVsI2CRA9TVsSAnZWagAAQ40P/3Qq22o18MJ/aLzA9Y9c\nnQ21tZpgVoMOdD+v2XUm51AadRibGh/G35pVUreH3Iwjz6ThrSol0jY7V5jw\nzVzyXDOmmsHesYnbPCR/6PFZfPXpBg6k6V/z38ketHOIHzLSSFgoZfjRoJ81\n0rQyYrBEh8MYpyp/DtVnq3iWEsAteEo8xdr+FPqCNMmoV29i7vxij8lqi0LA\ndqHQBxynrHbiVMVylZYeZBx/7WE8Qr8i03WWO+7uUMu4xIbaAWNhbzXNNxlq\ne+f/HvESIoQ8yV2+k9baXi6MkRxtRylMGcGvYCmP/o+/l/jvQvVUtx+Drvpu\niBbEqH0XJqY3MT3drPq5ljS6Z+kDkyBmpkCW8e4kAOh0hr4dNa2GfiTvE5Wx\nb1lEptIjsLbMTyfVfQGbAr2rmqfhCV1RQ+uSGoI2il3Fx26jFFx7f/QE46iL\nMzzjlEMvcw+X5d1crsAbXXavpB4DCdULN/aG+5T2yF7PMm9PrJJ6r3PMhVt3\nV9bI8l387nYlvtwKCNeN6LnN1Ka2m7ynTFIepYxLY/kbSh+Y1UnIPFTngVF4\nAq5SiQt69Qqm30clurUj/HmqiRZOMUnqpbYf9W7goZT9L717TNIdTG8niHR1\njZrsaLeSKwrckPR1K7RK3hg69qcv0DNNh1Bw0ha50K3eWnGz8bwRgx5cPA9u\nk7ZE\r\n=TnP2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICcA5QF2C1fQFM4BbXiRS/mDYvrJk5K86ohLn5K/gFVhAiA1JTPgBGfR6AYm8ohDKODn7Iy0dA/bNeV4dLcff8FrVg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.eeebef59_1549189685950_0.1973804434499078"},"_hasShrinkwrap":false},"0.17.0-alpha.131278bf":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.131278bf","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.131278bf","dist":{"shasum":"c2c9894f61d77638aa9ac643aa54d950249c08d0","integrity":"sha512-fAfAQv665SZnUsNlPgwX0l4edKPbQvY6X5bbuXkCM07uAS6t/7GyCUIxBRrpkDeDKktufPyz1vho+e6+4S4dew==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.131278bf.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVsVpCRA9TVsSAnZWagAASUUP/Ak4/6rf/j1FUUg3nw1G\n+VLPY0egZBECUrXFfoEbErY+Rl8NB7JruNcDLE1bxcMjfk2/nKd3knyd+1dB\nlThTrhwYHHeVw6p02jzJZOEp7xLTKsL339S6f1X11UVud7jOq0K8ouU2V1Oc\ncZoIhTEHb/1I9+AE2fVohhojCNxJ20BbKcCKT9cL+kF1B925yrxlJB/osbex\nLEVyPWEpCvsYsNQoGVD2VirxzGhijBDhCeRilYxaRQXov0an/7wvRmkJbjUz\nbZSNkhqjypWxYvGdF10e4BfqmnIrLjfUzFN4K4FrbbT4wMEyRT+tApKvemnO\nnwCiLptTsNBWVrQPR1wyIaY749uTyxY8uP5KbVHrCWqQIhpfxW7iZ7Ng6kig\nvGuzuWS22MJ7R1KkqYZ8WGfxXeCsPnimuqF07KCQHuLpv19fRmYYXkLrXYTz\nEEUqZ/QKa+VfEbr3EtfOxhgE5gcko0eDFU3OYy5XluLuee/a0xICSyYTEEcf\n/kMEAgR45HkWfYXGx6X9osTlgyRq435Duhxjzpa9Xcn+tNTZPc0hUByecFME\nBhuiA7aMqm+h5Xr1XyQZYqNuesNmSz8HLPG5iDTH50YCvvE7eNlLo+399C2G\nBCzT3SrYd9xh5gB9mwi7AiFcIWxpagbJdxtKBtY/2F/Uwx+5wO2frEDe53TY\n7OCY\r\n=TUkK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZ2vlKrSWS56PyfB2H63xOLEn0AwDxa3N1J38E5YYTCwIhAPw0ayru0YhT4VcSczae1cBmQ6l06RH/IsQtV6ESi5s8"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.131278bf_1549190504603_0.9916568564503443"},"_hasShrinkwrap":false},"0.17.0-alpha.fe3fb331":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.fe3fb331","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.fe3fb331","dist":{"shasum":"b0d3096d7548b25a00ba79e8736fdb3e6baaab87","integrity":"sha512-vVQxjHxXxkr/lH4+P7+nc5J+FqpDeBpRGzOO8hQv7T1H7QdVTGNQsYCo7UPt26AkXJ526HXwG5ZcpFnV9ZbM7A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.fe3fb331.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVsYbCRA9TVsSAnZWagAARNUP/iSaxj60w/ILLP2NEV9E\nBaifZOJnPlqJ/HB+abfqthn3drXNdWyuzZu/YMPwdXSgjFC5xNBe0adKUBU1\nL6aynF+hK/Wo2SPQSGtGLoM9/HJoIW/eGx2N7AKS07fe1GkGGF6C1NhIdcNg\nG9/SPLsMNvqVLOkxjAs+oMRzFmGgh8NO6VeqyOtlX+QZ+8R6Gs5uCOvmdlXi\nbmLlHwH7MeZ3iHoLvs6ZMfM+3NWy1ww7yt5G1EGT/lktOAKJeuppkSiW+iou\noKuceHvVpv/R8LsBXxXpfGc13cv/AdL00tGITClyIB1+Tvco1lTDPWcmgnNu\n63jQFZKPFcDAD33qA8bgRXMHv6rhT0vibj0KYW8PzBb4FAT4r/JTwBpRrH7x\nEYfXf3cXfzNPUJTvt0qnSeOLoar6lozWWOWylJXNxHd2IcEb2HBVFMuhkF+O\nJiYG0+26wYN9OJPcCOV9ZxWuw6hdyY1qe2ULXiyTO60yvSWw1SVnYovHs8vZ\nhUgFNLjsf39PAxDRajnDbC0wrfYPggiG0fT0Hw6WDTCb7RnEMkh4L0GRODzi\nMtfdpFKChhZpv8b8768A4hRQBq66BCWOfkBxAqwYRlV4jV6QkXpppvL5tkQy\nhhsFmf6zoIbsDtgKULmLDnKRazgzyJ7/SlNx03hb3AuY/nNtVZs3SNwgMdKM\nNq+3\r\n=mJ5Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDY8fk0k8MgDcAumuGGBZB6xFHhsiE7gJvue66sktEbOAIgKYo+u5AcP5uzFjOg3vAuLBbS6K4znHBNVelv35hTfNk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.fe3fb331_1549190682622_0.6394141037513434"},"_hasShrinkwrap":false},"0.17.0-alpha.1375489a":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.1375489a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.1375489a","dist":{"shasum":"42ca36a1231fb06e3cce2e1c919d6ef86b323411","integrity":"sha512-2YuhGAq2F8/6VRYxAElqk8dwd+S1GOoGzZg4oRMYh90gUJxxA/cKcX8yrzdkQSXot2Alb2nvmIk4iNb34M3XjA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.1375489a.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVsptCRA9TVsSAnZWagAANoAP/RDsY659PzHPC+vCal59\nECREuD+dqnaGbC9LidcNAGV/17gKsQV0G/8yQlafo4KNlO4frINop7Yh4jPT\n5AGFLIfT6F5+FuB9/afgpYWyLTviSlUnA2q0vWSu9QcoCZL4q5EgnFfv1Iox\n0MxIdm5QtGDXgQGW/kobaMn/qv85TbN86TypGFiz21qFQA9aO0c1xlBUnoxz\nPk09TLiEOovJVgjp9Ya4lwaICh+77g4WjDdoXDIZK4GGOdQkb3MfNewl3uV8\n9RFvhlEvXRhFosds4ADRBYQ7vjBKSMtbV4ns0NlpSb+557IM619/lKvgxx6/\n4fCkAd1N4l9kiAU6PBbgddQjGcBcEHgwxB34Mng/W373spl+sMk/YjMETO+v\n3RiY4uF/PdSysjJtsduWSDhMRjCUmBs96Q+XrE0QRjibWLwXrpHxPRPyX5Kr\n5Ut97jKvHxYziPaXvtwZODArfyR38jpocTcjqkB6Rv8dCkl8zyEXKlKcYjLt\ntbGwuZ5huREauwuRRF90dGl0T8m5bE30R8JCVVSGHDF6CSZqGj61MKr1Dslh\njDTkmDTaglPI9zA4jyo/sDomeRd3h0Nn/f3bff92/5pgaxKsHoJyeIN2YuaX\nhajLhg52Dz6HeskY48wCeG2+8vn0KWbyJISod47w6ANLsmZKzNsXox66JdQx\nsN0j\r\n=HN1m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFRw9uephNmY8X+DpVMCulEvmO2b9egZJPgthmfAelNoAiEAusEQQPJukG6ZfqrslmAtJGEgqStvZwusm2rtTEKujmc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.1375489a_1549191788630_0.37842137626697125"},"_hasShrinkwrap":false},"0.17.0-alpha.b9f7c7c3":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.b9f7c7c3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.b9f7c7c3","dist":{"shasum":"1465e990a41a9d1a74ba62fe0e884a4e6f7fc1a6","integrity":"sha512-GqaCKTvUnmGUgn668mZjEBlGhGf3QrptXRBJda1gMBWiu6ijpMLE1Y6LAkz4mHF9F/yfoWUzHCV+W5nQFiLDtg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.b9f7c7c3.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVtUsCRA9TVsSAnZWagAA8G0P/33PBQrS6Qsj7l2rqzsk\n2PYItZXIK8abWYqtnifHlMIxu8IeeSZhFVh6ucr0lFiYHRXmoeSzuuyGk832\n0k8Ln+RwQ9vpaeHzEDD1OTQ4/YbT+bXqpgbzFrfVyhT00Ly64AMJ8DmyrKHG\nWtty2nltJwr9A4HzjClWhdygzp/3Xgzahm7F3Yd+FKLj+2pMy7V1S1lWIsWP\nHxW8u47eAtgP0l8Bv7tMHW2tEEyT9R0CLq76EF+1uTOnTdPk9jqlSCVD+wrq\nWoxL7QRs7PKKsogDu6VOLmtQy2NLuHbkaSSJOPac+eSf3T0Q18zkcYl8A1qd\nzJUgDY3E6UqZ9kWrPdNn3p1i2ygfHl9EK7LDn4VaXJHWL6CrRtAWDGPhb7JB\nbXlnVDDI5hv3hMEajgSbvqyHRjXWW80Rr41m4ubAqWflKM0M220oyPSQvVDu\nYdNU5OM+DIPWGGtPY2cOsUWGtPqNUrlhtWWiEgXPMs3gODTRu0djEL9tl5z2\nqZLgf9rmbKRcWbf5U3pCug6Iv+/DR6LkHvZ7j0h2EJHoNL4Newb28EzaMGQy\nQyQsRs6gdUEbDZvKThDaX00mh8FcEdqs/kJV3nbCrqxO/IfbSMmHirISzIss\nthe151HgLLVDcTQbAEjXSd7uZ3vX6EDUcg8cwSFm0wUq0d51L9GSZLfnbIQM\nwDux\r\n=39bK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBMadJfxY0oMUhZ3GQ55oMD3aB2Bqd8BnVWQf0ACRgEgAiAxI/CDKX3bOAK1CXGdmlVCNOf6pG64cIbyCFFE/GMCRQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.b9f7c7c3_1549194539904_0.2751394930049498"},"_hasShrinkwrap":false},"0.17.0-alpha.2b22525a":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.2b22525a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.2b22525a","dist":{"shasum":"24b7faac61f068fb61da42ab8f9a903d7ee56caa","integrity":"sha512-7Hhy5Q+HbXGIYh0tADe4253Hlx4Zph1fg1ld2+8taaWaA7gNSpYAVN0EfgL4Wz3sz5T4YfyXg28gTZUkuJximg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.2b22525a.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVuBeCRA9TVsSAnZWagAAXHgP/RgU9wc8SjQ8k5GROvG3\nGKzxf6VGYFS3swQ/gjEzXudGBteQVuAC4edLC8ifuSbfq8H1N8ptm/hZuPkI\nVi6ADlkebE9t8BdbAYZ8JBLFhUrVF53IR6ASjCkhP0Giqefc2cQ+Ke8tNahz\nn5vowZGm+8AUwFK+0IC5wxFRMnY+0TEueEhnh956U/oPdwtfNDi7SQj2XZlo\nLYLxfuQ0ugNP3sJKIJXaeywBlgDlYtR00cJekF1j9sFamQs/nKtylH+bbJXk\n3ncgtGur75BYcoowCKLxKvwTjR0RkO0xY5RXuxw9TzdTNlBg7RBmzlWvj5Nw\nV3kilOra/zyN9/blhE5/JUwtGlovCSqC8eePzYhMK2cKYoKMHq576BrCE5tB\n+eymNFOFVOOkCI16EOt00id9n464UBSGQaqaKL0O4oB1tz9Bi/FmwTUJpQn/\nF6QptoIUpMXF2Oj/Ocrz+ZcSbK9solCx/OBQ324LPLNHn+sIxeHetOoDoN9p\nFASYG9Z5RNXI4wUnNdahREViC3B/ZBLzWJtNbxv9zJfX/H+k3eVzeIT2hO0C\naMPLSn8uybOOx9awuzSlDwTGkTNMqV672hZvJp0sZ7sdMqnQCuYgcS1hLtCU\nVTYGQ4OKHGOel5qrHlQ99Fi6/6qb7/rH6Ce/hTP90RmuKU90DFqYUMpjEp3F\npReM\r\n=Jpl5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEwaMTBQ/ZWGKzUWRHaPTB06KdX04whIKQGx/JeisXXRAiEAuVvYP2uIJyO5Ulp5W0jRVy2nIm7iTvGc9iE1yi5c2fM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.2b22525a_1549197406053_0.9209408224376796"},"_hasShrinkwrap":false},"0.17.0-alpha.21ea9ea8":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.21ea9ea8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.21ea9ea8","dist":{"shasum":"984697e21bd75bc1d36a6428af747b6fee53d9f1","integrity":"sha512-tsw/a7VUzHxrvXZGxq4YMrUMVU46oFg+v3PIxQ6vNxgBt5joTyDti7Wnk3psGIv+BgCWNb2d995vATZz1VmXzQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.21ea9ea8.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcV1D0CRA9TVsSAnZWagAAfIEP/3KFeKG7UPZ0mpSkWaw4\njH4iCxNE4Kymp0gfCP4mx64jypcwml+kVlfTiOknAiAZvOfA32X0M05pvOgN\n3VDGlm61sLHczSeZKF3H9JBX4Hfo8EldjuUetqmfZR/+COnZ7KdZteGM3lhv\n5PgnqCaTuVrA+X6CXaaBFquyTV68de2z3A6RlwOTG5MQQTEOw7cBGZEXVuQ/\ny5KlxGflZ3OM8gUqhFq35LmXn7lH1G5TmfHy1imEwVTb9mgLtgBf4iZPZfHD\n3xJf0gxvI03vTDAgaAkbmlijYtE3Cp0Nll+sqeRIjX8/QTWevDCOOo8VSIE6\nLBILdCt0DT/roqtvFgKDsozc4KGWbC5pg6TFwzC+yZkh99fn/xg/OJZj1jCa\nKR/5RSTuN/SUHrsZ8rj+OguHBKHFDtM2V+GO2yKc/Hn/WeTZ+Eq//0jkIy5n\nvGginZpFxuL0csUbybgEn4PESNaylRA20SL0MwCFo5G9WsiJrTffR2VUXhbR\ntQ0BVoOEyF5V/4bZl3vE86Q170NafyQj3fpnlAK6LziIKaDmnNlpdKik53sh\nbe+M7AQkk3FdGBNTps0bRaGtqtiaHwjDtaJaoYFX1YUVzI29KQQJLkjWpQMC\nm1DaYPQSEKq8Cpa57JRyZfrgqRarGZF5ZDLQZFGmMIJr+09GUKaqZoSFQihS\nPJuM\r\n=Z0zi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEJ1tSjD864YT24VsV3TjdxxiA8vI7ZviC7t3+gGAklRAiBVSfBZle1xwAixXbPrFHgzzrf/jto3qa+qhnOgpXnfeA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.21ea9ea8_1549226228115_0.03735109981532814"},"_hasShrinkwrap":false},"0.17.0-alpha.d6e4c2b6":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.d6e4c2b6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.d6e4c2b6","dist":{"shasum":"eda3ba2972ae7c74968ca2050f18660e45544e65","integrity":"sha512-NvbZAJCwhwk8QmcjLGlpfjXvFsJfTKS/0TXOOcGSd9h/KK3QkI8P5WALAZUyEpsKMja6CJcxZuUY+BQcyykchQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.d6e4c2b6.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcV9nqCRA9TVsSAnZWagAAwWgQAKUILZiFQGKjv1dxAjsa\njA1uM4fJf9Byw7xmWoDZus/169FW0hAGJS4PHLmuR9tE9rSDWgjKTSEvvwka\n6T5CRH6KyUPWFiCNPLBFCDUPrBLR5tsGqirtM2K33aMlxyVVhHYbf8gbgqN8\nZv9CFUpPzvH2sX1d8pdornx0ji5uhitrMXktzWC6hWBGO77OyUMUj+4LFnEx\n1hfMfDfD1+pGM7a7JGf4+W0eWJKVQ4CoYeNc713r6LHlsPOsqNf/R15g2ZXU\nDTX8LcZf1HD5nWjDwBjPyOYjCQRzJQuPhv+/VSWxRjZLWuB/VP/DHtP11GQs\ncoJIj+H0/Yix87Z7DrilvUeE3MLuJ5LAc1WiRnQDZPjEOgC2bjbNvWRu8Wlp\ndwVS4uROabniWSA6M6LQQK2wMif+g0aBlfuej+aSxHj8/4wtaHQwDH/LcHw6\nOpWozLE4T2qvCTNI4BuuoWHSJlvRR/sRRyz45WJEwKJl0wnqhcMBW5OO73R5\ndsjK0xA71H1xy1s2tx1GTLNdt1hvA7lwCmu9DQ+GjaEEDm8LR7d6AZ9LEauS\nW3sVrCmsXtvkrCGDRGB+kZHnB21NJ0Ek/d3O/huKPRntaFPLsvWUSDCYQ/v8\ncfZmN5/GpjBrUt7vIKjHK75ymcjZkAZCMeY3XzGSOLJR42haNt8iY6lwusLb\n2xQ8\r\n=YrhS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpEc7b9Pb3TAX946RfLkAV9nfz43Cuu4dNGUhfKnWXTQIhAOrfjzR3ZYmrU/PRC+49vITdFufJCp5BZ5nBwt8zIDiG"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.d6e4c2b6_1549261290123_0.8011807560559969"},"_hasShrinkwrap":false},"0.17.0-alpha.44540a2a":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.44540a2a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.44540a2a","dist":{"shasum":"81dc50226450a72dd78036bf7502d45b81a84ff7","integrity":"sha512-HZCA+LH2MNUPcfQHKfoQ7LvAb/9Me2iPoacIq7kNt8mMlApNwRYOS2u6jkgcc1/2Tmq67O7ClyAnzYH/hYKOOw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.44540a2a.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcV9ptCRA9TVsSAnZWagAAT7oP/A/UMDpKlJVJEIwla3wF\nBk4j17cod00ZaBnF6Gr+9HWMperc9lLKPcW/FXJpMz/HXpmT1AYpVf3/jnGO\ncpK7TSa2lTs8lX46sn7i4GDxRtRxw84OeuNZi2yhmqa/ESvypVhSIs06IfZn\nmNAUEW+jMZGC07K0MP4Nm/waAMK4e6kOKDWRc97dpZtl6qeMCEITDf71f8Lf\n/YsbA2RXjE37WHkRsGI7XH3+LxZgv4Jx5659MdGbBmFiBrvATTeXur1EEQ8m\nHXWDuGLGQA7kLKWwEPvkwWSTl4BP3omXRKp0k3130FM2qFa0P+VcS4AcX7py\nk+ZKVvkUGjXmjOnk2I8spDMdUsAPLMveTP+7frxK56bp6Mbh54ZzmQZmrtGu\nmXMEBg6b7qRvIdSEJHa0AOS7DWV+Ky8WlfqoiYefCo5+ZjAWtd0+Kqbm00Qx\nn+bSwhqdDo8/kCqOZVIkkE/e0bkASkA1Y+PieyVgyebWVSacZFXdyErgkIzy\nJegmbrBPacEW2eTKWQDAsK37c/1jshhj7yDDCzyLRB1kO7RzmJA76gOTMZfE\nYz/RYnDBbdGQ3SlJHT9B0aSYLVrSOWVIhofOFGkty9qRQ0I2K2LxH/oc0psT\niCX9vfcYpVTNYzE9zSoTIvc22anGOoFVGxWz8KKValZjXuXc0IcVfMUlnqCM\n+TgE\r\n=IoCN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHoMKhNS+HSIR4GGBwCAegTJQiccZHyCRRIojEkGLb2AIhALdakjFk3HeAMeAL635zsnMGhesqfz9KpPJhfxu4BbiW"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.44540a2a_1549261420506_0.9071511541046995"},"_hasShrinkwrap":false},"0.17.0-alpha.a9e19710":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.a9e19710","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.a9e19710","dist":{"shasum":"4018b955c62ad583c6bc2de31643f547b9af5ecc","integrity":"sha512-5bgRDKgMhuC6KKgzsCGwiJiv4IhTI8PajIhL4MuPfIeMRLs1DKtaxdr4XB/hunVGMfseRGWS9WHQVeZ3iB2EZA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.a9e19710.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWACcCRA9TVsSAnZWagAAklEP/ilJJ6dtwvWsZgqaJfvv\n0oVLBkFTtQ+A6q2qVABWLWJBb0DiNsB8Tp1Bdfo9JJdy5SXBFbJDyc8EgWg6\n3gq8zxlF+B0zeaEqV2+p9EBeM2tID94qfJGlMz2RCvEpJgPaVJYMAROVxKC+\nCbPjUD29GJ7Q1N+Nc7F6xXhqu0Sgkls2l1MOOMrsGfkoUJsQU9c86sePX1mu\nRyk0u+Cv5Rlvt/rRAlhVVlEy16bXfG82WKn19/2pdbGcRXxPHns41dno106Z\nF7RbWEarepRfUDIOVBBwe6u1vjb/lHP5hY1ZjuJDuiJB62g0yexQC/BXUJf2\nHQw+ls3QDWmzuxHXRjwsEByDNTyczzEDXDMGEeB5iTBkp8vl9pSjPrKbc9ik\nNxeUsOyewCqm75ZYPOGBnnJ7pAnygYDj4MGZxUxL2Rtfp4rbT9C2qYHruHWY\nFWr5NZIsa2rIumP0TjLOM7nmaRkc+WIPpYEMrjjs8+BVgSao7QKreAp+vGa/\nTwLC/C8Mq4LlWnWTUHN8oYqc4V3dX1GBXW8ZMDlnneeJHFKyiVJohFcI2/Qe\n+4WbSqnEbDeBZAXNhkPzFcv2u0OUqW+P2KEu4T4Sh8nmkMMiEBo2o2BSXCyf\nOtq9pTl8uNQ+3Or3YrP/PEMVqN3wkbVipwQGs7CqZmHaYd1QXreajA/gRKKn\n7f9v\r\n=VHjL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHqvBKrDmL9g475WYsHFyweEL0dLhFjI3XhHxahhGa6SAiAge+jLLuhKnryb9tW+UevFkIKjtrg54sqCcnn9217F7Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.a9e19710_1549271196068_0.40732068510790365"},"_hasShrinkwrap":false},"0.17.0-alpha.5645f490":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.5645f490","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.5645f490","dist":{"shasum":"1f9c15dba5547455d8c9ecf4705126eddafcb470","integrity":"sha512-gaXABLqf9D7QFXHXqbFM7EY4a2MxCOnsAcNRcQ5TGrRu3Odi3C+ZyOD7uQwrpeBfQ1Ai+4Z1QwnVUtOpJFNSNw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.5645f490.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWHWyCRA9TVsSAnZWagAAoWcQAIH1Wbd8+nVCLf76nsIk\nOidkumQLoYENW4PN8DsZhXVWctm1LWwvnH0gZHWjKWvaFaNoZNx7QKG0am5e\nMVOq1ET7c7WrOw0xsLn7k34+4bm5SLKgnaNJIGiVqWGbARy2LN99PwmYNXbv\nEjyDrT1RVTu2XfILkUzagChKyoiZ4ZAWalx5F0dJrLL0Kb2GKTC1D01d+WAy\nzXp3e6C3DtfWJVpNljtvofoSKzHIgcfNN78+obC1paX12rCQr2l1pjH14fbT\nme6W7dTPBxdS5hUcpww0jY9GVgY14ZHmI6cJvFDhwiRcLI85ZJeVKwaoRPsy\niObuVx06/lFTr+62Wqie57uv+ZqXn2LGJf0pqyH2uVmRDqmAoJIK5nacLBbM\n8JFJHIQI+lMa9veFFl7qupnFd5wh2etBMUjqDpyFkyzr9ItTlgvdkRgIjQjm\nZ+587JkXMbSAqxJw4BXMyOrapPHPNS+5MuNg+OXbsKrxJ2MCmXPdaxuwtuRI\nvLL8ect5BamPOLdY+BFzi6xQgf25IS3XKf2yN+dqjo7Nh+P/gxxlGxaPDpeL\ncvI8IRBCS8SfTf/SaZvGK4yckx4JsaWKHhT9A+aO/XayKsZR/+6BTXfrVv1v\n6VHq8oa8CcPw3sslGrNzyo2do7vNm1NxDKHE5GaI4ZCPyYWPa/8n9pgMeXZQ\nNhv4\r\n=G/X5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOR57niyFqelwSq/lRtCB/cQBngcl7uxH+M61mmg0cNgIhAM7+7d5Fbz+MfGq/0xXocvTkekghGWAORWj0xKPaAzKG"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.5645f490_1549301169887_0.8098427660572869"},"_hasShrinkwrap":false},"0.17.0-alpha.a46dcede":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.a46dcede","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.a46dcede","dist":{"shasum":"f76832a152f43dc89eef28df2aa272e3887dffea","integrity":"sha512-xngS2P/AzJzTZGWiO2pg69NcN3NDqbqZHN+VOJgMu3zuiEhrAfyqfNFgbQGxoyER+DASdkXn2SJOTLwUD9imwg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.a46dcede.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWMLGCRA9TVsSAnZWagAA59IP/ix9yJSgh/IkhAqeLXW8\nVfUjTZWbffE9RJWQTdrXoIA8PvcOQJsJBwSUiggetw6bepPHG12gHkPg0AkR\n9lWqMJqatSirydfVfFcCt1ETOeB8NJ+85cJLby59U7RggME4zJdkDb5GwDL5\nwJi+SjRBimUOQes1hx7z9LTGDOq9qbf+XVsVX8ASo8BVqc6WFsYcvgNjoHk5\nUNblpiZwJChovuINOz6c6x+1etM4h5dApg5S63q+TokjAP5lMClhYeBM9wm8\nEYftUs1vQJGz99m0gH2pU+9PjzhiZo3TUx68CfAi47/C+SBr5aYBWzYmyClS\nhJVAcvcX2iegEgJWMGSU5ndR01xexHeuhQrIGEbIFNgcoHR1WI9cIQDLEtAQ\n3rWup8JsVZHxKSZapjM0QtK1UrMjGjekQKd+m46KHvUM9pttLCg8/KAi1WDb\nh6rFWUkCKmZJhM1jH/cQTbqPTyicmnluxy5/YCDQwTL1kMQ90/u4eFTvAtXT\n1P7hPqxwGjJI2+LzrjBy7RcBuDQTObt24yN8wCxiQJUuhwXt7kjqCOOQxUKI\nAjinT9PoMcGwSZSxG3F/dI4LrZC38kCwViZLbu8ZALjFFBysysxT3SNhxyZS\nYFZKBa4Bg0tjtVRZbK82FZQA7xC682uW9T0cVV3CVZoEHf4yDqb1+y+/gOm3\nFYg5\r\n=NU6J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEqSpO61q8HOyncq1U7EcFDbYvZq6osLe+HIECAG+ZhRAiEAoI1v6NKVvGmXYLAxH2NqGhYDE/jorkGScfB01A3cHZM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.a46dcede_1549320902149_0.17328936039897425"},"_hasShrinkwrap":false},"0.17.0-alpha.5c019cfa":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.5c019cfa","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.5c019cfa","dist":{"shasum":"1895eb4872625ad66b75ffe34056b7f1eeb867d6","integrity":"sha512-gW+v6LvDGThX0/N+IZBLxJ/flRKT9vnXpPOgVN/Ab3EMnsB6lL6R7ZkqtYB5+pzjCc9IumIhQdMYTlM5XAU7Rw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.5c019cfa.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWNxJCRA9TVsSAnZWagAA0t8P/0e0lQLU/CzNs+38R+0F\nDlXvL9ao4YsyBNAXLKuNOqG6kf/ixfFj0VEHM1SctLhZmYo6PT14ZhnjsEIQ\no5yGb4sh0+FnYis3OMDHEIGXWFGEIKPgd8t6tdOB+pyw9gF7nFk4uB6iedZp\n9riGC+yIrsl0Auwu+baBSHceccQsn7lozZDwnUW0UrupdwZmfwAfnZDcHm85\n8VSwztBgLjpdHuDfoen6VgcJa7z3bwJdwFAKvFCljYdHzkQUq0RkG+gDUYO1\nXnmc8OE4hDllgZsF5JNIOLCvRS//OyD9qrkMC3Yls0tNaSaWvN+G76xd5MIp\njTsCSitNAPTAgkNjJALfYRnZcy7UdHKNNmnQdGGUpu/YUOWTEZ2lbBOzPkWL\nio+rlHj7EG5uiM9ywp3vc0pWdty7vgf7p7EGU9T6RRXDM743S6AtX2vf+Q4M\nEMYwKPE0zPT5zC21ZeNRsvOLfVna8dRXW0MUDxQigQG4RlSxx12SG8UtilXs\nvbHKieqbV6uzhQOxtDtwYJj4hCWczm0ejyN5DxaYMf8WLH5vraaZ+mI3GhWv\nsVL4DuU6WSf1LdczYZNoPCP2/+5+2a3Z3uMLRdiA342B0VuGTBEwjLST8Poq\nj0RQp5XcXVPRZFX+FI1DJbQ8JlYtONlDjzxaELQ49/vbjIM4li1LYtU9P3Zh\n2WTS\r\n=iUCG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBccPo9sPYfwuBET8GPWkxyMMHeWQJ1odWRKFMN4i+tgIgCA/N57yd86x+tgMORxfsh+qp0T7/emP2SVQlzpzIu7E="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.5c019cfa_1549327432885_0.1502213565911934"},"_hasShrinkwrap":false},"0.17.0-alpha.8b057617":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.8b057617","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.8b057617","dist":{"shasum":"04dc6337a0de33c8d16f825d1f4b1bc7313001a2","integrity":"sha512-HdrFPUfxThJoh3In43cM367paSBIF2ceGo6oEyFkwNaIm8M4QuHlQYE2l86LfRANYhwnhyxPJOyIKr5hagim4g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.8b057617.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWObjCRA9TVsSAnZWagAA0mwP/jbMrgnS7RH/uAnUQeu0\nLlXNS1YB9iD2j32/g3sJNnWkw3AscsUbF8hpg2IeeUHW10kSIuADzxLomWJ7\nEtI/lwZZALsFU5AS3cvhLndurR5IDc9wYcjcbcTG5pifNgI4NsUn/P3NIiBM\nrskkedAJvDKdBJn/qOCIMDSZ32a1kZmPdqUt6miAkhGVdYwHRxzqRjtvZpU6\n9O2omj5yt5iscwgCXEdCweL77Z226Aqr2Bkqz+qZI3seH6gLYt6S+kJZ9Ep9\nNllmeWjyjRQls7nzp7OSqAkW1d2T7FFLDGsPodMvULTAoO2SdhWN/Se3VY4m\nWB/0iyXgkxWlmYDfwIECdQjYxPfRXSg2M0sDN+ugtn64+g2GLTeVOMmDWTla\n/5MmKCrKCJi0cJOcnnev222itun7SxSfj1FU3dnFkt5hvz5PMvglWlK91tc2\nTUutakWKCbVffD0XYriL6vCNoJaQ3CfY6/aI1dUEFKUuC7FP+BqNkO9EJzZZ\npbuWWNEB3lkT9IKig7LJsQz9nhr1nUUc46+bOttllg7zY4TF2TBB4EQcSLvB\n2h1wENBNafGViO1V5B11ZQ3wU1iGWDqxlpvsORmGl6tNyK5KcR43V6NTDI6N\nyhRgi+pLmtxblux1q/eZpIBHPgKJQjutd3NlgmRJlDE9xNBN9C5UymP3Lvsw\nRxyB\r\n=6663\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuaC8zQZA+iJy5KJneKeVppzGT7FgrI1M+EjsBHxa6SgIgZocfhJT1HBCKHbWQ+KhZKIw27kTeHe1dXGcGPbCkcFk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.8b057617_1549330147363_0.8279694623306142"},"_hasShrinkwrap":false},"0.17.0-alpha.a3e75975":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.a3e75975","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.a3e75975","dist":{"shasum":"63ded4302bc0d8cee77f2cfb8f999ce9b061346a","integrity":"sha512-spPTj9Z60OkIq7BSexl4EFGIVz2Xp/q5bg2rsfPu5ZGQVNBJ0hNv452oca/zQwb6s8aj1AwCxpc9GzTd+fQgnA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.a3e75975.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWOcPCRA9TVsSAnZWagAAOeIP/2BVcDO+12URZdpb6jIg\nLy8P602xzLiJMwE27sYh52lEmPkMwMr1CH3BpYjmF5Z0vdo4TtxWccEh7rYA\nzXBkstOwQ9udf6gRBNldbVDyngwjKGWnB+jLLFR8mftUFuyesbJ53RKfktWr\nMM+9r5WZwY4nPWkYT9QJe45OYph5MKGjOWRQyU95vxdWP4DO09QvZ50i6iZ0\nVK2cJVm8wN6RANPF63Myz7f/Qkq2FRhqVRdIAz1MJJsywaHFObGciBg59tAA\nuSQf+IW31Ulg9mcxLPmqwOlkqcMXazixmoc4xxazsDg1lZ+rU+d6jW0yrIC0\nP9f3NZy3GDao6hnO7oq4D7YSfO9ag5Ppqe3V5/4qzjzS76Dc2ZOguuQYAbnC\nz7GaTXKDBcBXmgsgP3dSe6jF7HRnDZNkwQVh1GYOOOVICqMazJopbOROyf/+\nkyvvCBvWyOJlNphOE1DgUYx+C1noAgv5BC/o5WSwqpYGNc4eCaFp6flVtZa/\ntrfEOY8OxbrBTR0k2ia3kly+FeUh3wx/a2bnth9LuMZUvODdIYDQv27nR4zG\nbv/rmWw0UNc6oqC0wGlfpzDGdPFh4R3XxbJL/xJAS6gX4RrY5HpztZ6/BWFJ\n8+4f8Pa5tqMtTTpBk6gzhN5P7CGH/58QfhB8P20J9NPjr/vXgUv2yGKGWecL\nc8Qc\r\n=g4uA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBM0EourVLD1s8BQTWdhOYXY1WcidIpnbPorPa0s1HpRAiEA7j3nKM9GrRAc0xJwwulvezyWGE0w4M/2LHTGenGfaqE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.a3e75975_1549330190380_0.15673580240695384"},"_hasShrinkwrap":false},"0.17.0-alpha.a9800160":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.a9800160","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.a9800160","dist":{"shasum":"5f81c59c1a2413df53f28edf5eb6b498298fe810","integrity":"sha512-cT7r4bu+VHqzdu/+yb54h5XoMlaFsRo5Azxa12hweZgV/L+Lx0SQoMmV3EPyC/UM3T77XVAL16SOBxEPyjXStA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.a9800160.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWPTGCRA9TVsSAnZWagAA5ssP/0QURBOkAW47nQlCp5+l\nqktBcihnZ0oaIGyMlIyuUA/aT09gF/HZ1MpdncRamiBhXUl2Tu7JHH0OvHy8\nOqJFewxk5Wy1MThXWGtfN5O8pSLRHB0drSPaJV0F/qTaijgKULE7u2p52Z+V\nbl5iHo0Eh+KmaQPevtBm3t9ZNRfXAihZf43X+jDVIV2PHh2bH0FmXss8lvSw\nIFtR0AVGuaEPOArXXUEqaNXvkjQxKlllaEazAQDxN1+ZL3f/FsIn9cXVjidM\nD5cxSW1xMlcIy03F4AE1F2nWLDOefFmjtjJzJzNM8jhUJ78aLZKMy6n+5paD\nctZzmZYXJI2eY51/wa+nhklF5U/Uh1pCffWpORPe+0ioQ3/SE/LqfLCEqcWl\neNQRxOxC2B3eoV296GQ2DqkJXiRJrE7HBggygCOPfa1FX0z5GbpDvCgxMx8p\n4suRsKm//Zwdp6f5i4lpo1yyBwZytJmnRMiFBnu+LZjLaGTbrNeA+eMPAv2B\n/twGV2rSHL1U2yuS9vkLaxqYz2oOfTeaR48o16OeNWF06TfrN0kG+y3zb/k1\nqTDdfYxdu+M/2kavhiRJgu+O00hQK9QUb6AHLOK3Y9O3qkIXR30+WuvBXEEY\nxdjUdzvCLKvDtufHdxqGXR10sVPzsAxeajIJQFixLjT3Yusw0dqGXPRHbTaz\nHkNq\r\n=mH4a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICP9A7nJMZ7Nk3s6f5f0xtrcflNVkVcCuViaASp9q2VZAiEAyIr8U2+nLP9LPAGbqTckc/LeJtJX1fUQLsP9IuQGN8I="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.a9800160_1549333702036_0.9363869982761339"},"_hasShrinkwrap":false},"0.17.0-alpha.c9253930":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.c9253930","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.2","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.c9253930","dist":{"shasum":"5062589d974bdb76ed8cb769aaab21acc2df4d1b","integrity":"sha512-WwuqkO55O2x6rfIoLp5pwgJ3vCH1pVlzix2DjkjM+p17W4z7yos6POq8slB95IJsf7+U8HpRJQPx1TEV8AdVJQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.c9253930.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWPTuCRA9TVsSAnZWagAANYoP/Rrr2BoLhWGMdTCOsJKn\nrpqutx6EYovFKtK/4ACx/8hOD+bv9+3QShuav9uOzHJPcPfI9kUgJU9Vvv1W\nR0pCPzfB0BUTtAof2OMViGaxWfOFwUL+5ePVYEQzDJMsVYU+4u43U3FOj2hB\nPxusr7PA5DdVp8Fk498u9BxcB0v3eBNnLImRLibNcyxLgcPswdsHi+pnkF/E\ne+BmzpwyYTGIr8jtWLn9Sh0JpxBFYPUBWo0Zkx7QuhEo6IdybIsI9Dng6S99\nYYOMqBtRkqbt20PQWTHhi5yN7PpDXfG9dTZ9T9BhohJBzMBoISiRbKT7hFsD\nQ0BZlID7xS/vSwH31Af594Bvu12mD6EZ/fkzyWpbuc2Q5B1/6l1iwuAl+VbO\n/+Wvja4JRGN987+PgXekxE5Fm7FMCShpIuvqV2Huu14pWE8iQS7uzWC4VNbk\nVOsKvCIj07RZ6KFI6l0F6MtTS9AM58x4CqqUM4lFWTrs+E4a8MTrTxV8L6KL\niYj5qutMn/NskOT79DHQ3tINFdFtEt9pPGllrMTh+aiEfheaoYS8OtZTyhTQ\nras5yZ1B56PxcqM2dfSgdde44hJXn0t/2k7/VXjXYtkU14m+FJxT8bh6bSL7\nhbUhZ6lvM+oyFepqphut3cZFEamIiQAcxEjjKsZjkPa/6j98OM7lXmm5pgF9\nCPQi\r\n=nLRy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpk2awgvpQszgTso/Kx7fgPD1vFrpxT8o5LjjQUpIe+gIgAs+8IjSDjobjoZnzf1sDF4pv6o9UuTuUocSCb2ZQ/mE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.c9253930_1549333741774_0.06644768004204904"},"_hasShrinkwrap":false},"0.17.0-alpha.9b7ca0a5":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.9b7ca0a5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.9b7ca0a5","dist":{"shasum":"44b9e4237cc18e5c4956d5c559a5d9c30c047331","integrity":"sha512-5qH+LFReczM2N8TmduC7oKd2K0ZDZ+DSyh5moxihhkgSnDX5wBEHiTC6tkYxwSMMxFJrV2XzQBpS57l1yrELVg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.9b7ca0a5.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWQF7CRA9TVsSAnZWagAAzlAP/iE9uYCeGEzVx4x9aEqS\nsfs8nWvVcrD8E5VZvFgZ41FJByvoSobpfaO9kt5erD9wlTyrQzsulXkR1/8a\nAxKvDkeQhegt1wOqqbgs4SERXOAU5mxfA1ZDgswle+mzf//VtXEZbI7wsY0C\nI62e0XDEhTBXX24/wXueqnTjxpAo1HrkxWGLQ+zXCqUYHlNrM2O2/+wLddxQ\nWST6i/LPdXkiHusSXcIicyu7DLPdyzz7EjVcQ1M9fOZvon26pcMih2IJWNj0\nV6mw0Ur4GTI1WHJshsjK22r4yrQMNT9tRjztCX6kI9awLWzEjXuXNGYPH75U\nAj9Q5teTTYYUTg+iuTwnl0BhCtlsBQHyvzc1PiZ1apURMc+K/pJ8b558nI9Q\nR1hLh9tKqmrumpfuGTUlh2btvhGxwiWY5etl16s0uRedfmXJer2M1BlICJfN\nxX4A0Ijp4jBcmYk/XuBk3gSszCgiYvENoxdKEenzqnhgkULROVObAYH079pt\nxH3sF95tkswdQGjVTJdDBC15vFai0n9jMe9b5Td9PXQ82nAMQM9W6zs9eGhf\nZ2l5g5zMcW1jAgjjc/Tm+vL85Xybmy2QOUKnaiNm0atdyYT/NaKQcIYj0QIP\n32uVLzkWSk9zBGjUPNO3eFCbJH/mxLv+X3tM8iXA7goasSXDSqO6uM1qxlIX\n6UuR\r\n=3584\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICUdwKikqf0guM+3gKCqRJ83BdT1RGvq8a5e/5Dnm07IAiEA/RzMBB57Mvj/XZxe0rublWKuUrKWzjX8LJJg2CWODrA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.9b7ca0a5_1549336955246_0.7582640344582494"},"_hasShrinkwrap":false},"0.17.0-alpha.353677b5":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.353677b5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.353677b5","dist":{"shasum":"46004281a0107a8725177818fed47099c582ec57","integrity":"sha512-JkeNxJD2wQjKJTmzjAM5QNw+TSA/fHmA/4U6g0r/plp0gIJckjmAbO5kmnb7QNkkOxeem4YqwpTNh0fEm9isYg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.353677b5.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWSviCRA9TVsSAnZWagAAVRkP/iyj2LfEabIEfkhsMhiW\njQ+0DRHo1R0SCQjiu3pOhwJQVnOr/JH9+Q+0tXEYb2j9pX4JIguzGQ6E0PX9\nVmLDGbbsagyG4kX9TxbtjZ5J9m+ArUDKJevtL/DPHHMxGNU3fZ7hSsso1Lrb\nFD/D7/F6vG06oWoccFT33YE7AxrtaAFBHzSNF61fO66Q66tRBTIAYZ03ALb4\nyMUrmUliGtAAWA2q8mKKWgfyxMOZkR+AB25Nlx5oZCuDyJM/76xeSyY5a8Uv\nAGvMNnoGej37goS4iXCA0DC+2BQ3IlnjnmBPqk5hwn/Sa79HoRNZxpSJb/D4\nfmw+bJ7v7eqEpV4ok/mlvFwqYNYmvh1NOLR8VB/w6AlZF3orNd90Y8u3PABP\nJtqEF6ebgYvsdyawRbsLkZVf4Z4g7vgJE9FQ+RUFRc3DcP0lzltqsLLv7OLY\nSqlPickCDDBL+TQ6GhC8xSsEKq7ayah4Wp3FuFTzYGUiP5jMZ8jFfMEGS9zQ\nq3prheawpQ4erPOHSDk8QWEnMGZ81o2RqTyc/aCDo8KqRRV8Z0uUgP8skiei\nAyOcNPZnDdxTURxnfKbgJZLf9fYLJ2xKT09aJMlGr5GmUNXpjWbp+ZRKfqp6\nVrLbH7/xefVXCQFclGQ1mgtmen9gjP6XuGBT23jIdE8wZupBRr3AM8AXQKtY\nPszj\r\n=PWEc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDd6sSyd5cpe7B4R9zRoq+i7KOd0h7nDxhlKBixcVCyTwIhAIIPzoqU5nkoy2m5w39TZTWc+pauu/g6CTDyEuLymD6b"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.353677b5_1549347810085_0.354924104090095"},"_hasShrinkwrap":false},"0.17.0-alpha.1253541a":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.1253541a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.0","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.1253541a","dist":{"shasum":"cb619a68ebd62fd5675a463ed1ce308b47d4cb6b","integrity":"sha512-ynw50m9rapm+qdI7AIvFTWs/DX+tcSxwr5+YE0s4PMKkxWMxo/yWMqdhNVf7WQ6932wyYCxTE4TNrJ9UVzFVkQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.1253541a.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWSvwCRA9TVsSAnZWagAAi4MP/3CCIMbDd41Z0OfgbHVD\nGS31FnXKOBckLrEI/oUoAFWFz7aJzzu3B2ybyt6vFLAaBOHvgXJ77U5Af3Xz\nFdNccOaKSlqUztgFYnhNtF+UJrxH5LT1AOAbDAcSUTbOlsyrX2H8dcQnfTvk\n3cC3tucQTklNlT3HeYozLcYajMGX2ttufW0O1s2Rt+UYakcmv5ByTaKTG8xD\nxOhPz+lP1akct+RE/hZEk7zPhFcB/y1rQOVCOL+YEd32n4xfN5VJVmopBqvy\nYwKlUZTiDy0UfzboYJNQlOGV7v9usDq9dI5lcvPVU6HKcfQG3TmEuB6HvFtt\ne9wUXwo5IkVH79D/Qwt0RxYFqXuW/BhzTYoCHsUWL1cCKP7r9q5ksAuj62Z7\nHzH3w0cUgbRMFFdlQVzWeJSASHSvsUODPy4AHKrsbBJYDoO3IBP3rXJmWf5g\nQCmNBDwKwQJeC2qRnhxm83zlVUliLO8tCpQODBd9AAKZLHkf3k13qTvTBVIm\nrAgSpZEpECgl8rWrnCFA2YwpRnheKQSefV567EG9YwYIgSYOGt4jVIpGcxLf\nE916i4A9QLy30RyBeUIgOcLdOlgJ3S1GWzus7cf0KWGYuCpejnhwW8+UOahq\nx+ZTwgBYY2aAk6ZZE7XSUiENz9x1ylTN1aIcRksarb8pGIIOImkaeWC1KooK\ncm/f\r\n=Zd5T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDP4wZ6scBMKHr7oNRKHYudZ3vbJyquzyJttGOF6uD05wIhAI5rhQy3Gj0zW1YUg7ZecBK7TWdMa1e6+C7oBJLCS9O8"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.1253541a_1549347823326_0.7526374585690174"},"_hasShrinkwrap":false},"0.17.0-alpha.6a887ee3":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.6a887ee3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.6a887ee3","dist":{"shasum":"916316c3f15742d6eb3d936d6a5c5f5ef6dc414e","integrity":"sha512-IKT2Op5zhgnp1d9bCAtA2xv3rTvOlXZ5TiFqgYszdgkMM4QbWaQDvDQbxgyS+7g6mgI4S1jvWARmPUpbKF+SCw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.6a887ee3.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWSwECRA9TVsSAnZWagAA6bEP/A53xlvP1+yThwWiXI0Y\neH5+LOgsE92nxNAH+cQ+W4jMtS2B+LKqRTpLos72iYT0EQ4s07OoPbmin1Jx\nlRd/TYpWHhiJrhsT3WNSwZOnwsrwGkdYtnpStrSKHnMhJhU30xRK/P+BTs0D\n8+oO1zQjOZQzs9hSldGSDHcmfPC/63q9S57IuVP4XYQHbAToz7e0nGw/ViVV\nq35zQukq9/fyWrBBFYd7pVD0W3TQglXsr5VRea+EQzC07mya9uABFjH7qWur\nx6i1kJXg1BEf9niDVqGkvSy772vsc2RJyhu+2scKfdu81IN0iSJxV3rILpAL\nl57+e840WZGYYC8PVnwzeL6vQjr5xDZj6tJw6Xfo1kr0MhjbLPrnnwps1OPs\n3R0x33h1hP5xIe7YcFaCVQILil5qh4JCfe6TJLJV3c9HmmkxoWmV5/2TcbQg\nhxxX4GDCAjigkXp8+bmv6mtkWpXa0pWjPLbR20Ohzth58gGB+AcbvYB/rTvp\nqd+uSsTDgozCdocV2xUttOtnXC+fchG74nF55S3Qrp0ZypH4E6tDAdTCzw7Z\n0/lFmSfDaGq7Q7TzbMn4GpWMrxhZlpZUBTvGd65fw8ZHkO/fQM+X4Aui7o9R\nLu6rpAdqG1Grala8sE347a0/cw/LvjSiyfrEcexl9o938+bv9FZnqT2vDMIa\niwsX\r\n=LKdy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH7f1yQ6FUzXzdKBgkrK4tSAyAUXfZgGD2Pp56VYMMBOAiEA8v1vxZBUR5qgLQPdVqCoi2TAlt8a5KXdVckiFGLNeUo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.6a887ee3_1549347844280_0.232760502466959"},"_hasShrinkwrap":false},"0.17.0-alpha.1c63a8e0":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.1c63a8e0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.1c63a8e0","dist":{"shasum":"763d90ae53e63c39dbc3b22f0f25bfbd90022d60","integrity":"sha512-KhFXTRBQuiCKIlzLF6ZMNqYVikikajhnZFVfYYikL1NKXKQqj7FfLHh7SHWw1EQkWnzoGMdm7pCHMpfUDFLO1g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.1c63a8e0.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWSwSCRA9TVsSAnZWagAAU0oP/1mI5qo30WepkLqWOezk\nMkhgnv4iBJ5r6iZERQf1ooj0XxWbOqIzouUnjR5v5SNHgRtcD6jp0nxeHFhD\nGTZjjRKCYhPjUue2OWeKnNoEkS93TMSaF+m8ZHtZw+oFdMlvDQANvlMjCbyn\nFOCg5EZKaIw0aJh5s6Cc0ZF0PX21PIWGAOnNvkbR+x0fXrQ/lOor7YNvob5Y\nAeLw5UWB8PdwZ4znDaksDgmu9gqYtXCBJLBYgj+ra7GCEGSuqmU6zIKa4GIQ\no8QrjBLOf3IU3/mcrMXnDCoP2HZBVhDx22vFtSCYY2Acx3Po7eDeKIWjxI+2\n09W8gMZlbumneZUA4XUbExA4JUpJoN4u3hUntrR8OMoiTwMSy7HmRQcmpHmZ\n3c7n/TFTxUMIbCucz1wUnivqTGoIftnoA7QkZJb2lHT4iXtreCB4ZV9uObNK\nkj+ENImv04eImAICCW7CgL7nAf4DIqXeycz0X51pgxyWzsGNPQJGUuZLUMV5\nNGIu0bg3ylAWJJ7LwdTChfRT7Yl/BqnYxzF5VYIXACrVMCdDpPR1Snq72p+4\nP66lb15HKbKSQyhDzeaTI8+cDKL1R8nC04sNIrDDddw66NYrvoeO8uCwcYwq\ne4ZsvBjsN1NIxqNxk3UiTNqKh7JPxqqc5DMWv6wUoIJtkoHOKy1FFTkUnqCr\nzBY2\r\n=W+yY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB7JKGLDRnq++1lyJPslvv7XfLFOHpupYMICtUlgv59PAiEAwudj9Z6T9McgUXw4rSfFN3hrYrMSH+sqdEUG9TL6M4Y="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.1c63a8e0_1549347857332_0.4447505159660896"},"_hasShrinkwrap":false},"0.17.0-alpha.a3372043":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.a3372043","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.a3372043","dist":{"shasum":"0db8581865327ea1f8c65d4a108d094fdd892119","integrity":"sha512-DNlS0DlHQ+mCuWb1X0AMi0GMekKVPJH/dWYJsLmQZMsh8NrVoocVK2C37IDUBOX3EoPeA57WusN3oGu5szAekg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.a3372043.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWSzqCRA9TVsSAnZWagAAkF0P/1reAp3uNAsB1d3LkTOK\n0sPiF51zyS0hxfD0Oy3MUZKkEcH4LET0bg5P7MdyXdext9RqEnM5GhP79xEk\nirZGSL+VGb2ihl5qJx+0+BjxSJ8dc0PGPJXMZMbph0qZX/0eCmXfDmuwu2DQ\nVPor904H1WKR+AEF/s6nzDThKmkY44hWzqUN2j6SfUjg2ivass87g4tvT1mk\nYXDhXvKoW38URjFDfG14zm9g7b08hq6xddfjF8WE0kGQHlS37/6oixVc4Ida\nRn59a7/ZJDzfJU2MfU5M3ZXwAyooJRfxRdfWQ1T9YYX5HOhiHy7yIMyAT++9\nD4N8hfX9gotrjLF049DAzFvPSjzI5xs9djAlFiVkVea7flYBybJ6ox92Vvor\nUnjC6Cy2mlV9qlD0oxHCCc+nzVj+opi7675qicBoHLvqe+SAv/uHuRtKSyIy\nFEj5wLDtK4l7ovfFrcLkA6KkvI8TNoeDjdIFyDE7QVEt98XCUfWhKVQSIFWY\nC1UW7OA4C6B82U2vLw8vFJPu/+8qpeihA4xVa595amiWyW3/fzzOpstgz6eF\ngfelTUEegAW5TyxlCznZGXHI86u6J06OPCVnZ3+oolbRiSLheZ2hWKVttrCh\niLoVt0iwLgFk4tGPV58okUB2Uv8b3XSrNHRlUPbYrOAHosyZhDlf/W1nDF2M\nq/rj\r\n=MqKx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB8BDAvg9tH7Bt5Sqez6ileVSE9kGdAHuO9x4Q4be5ZsAiEA+po8xXCfCgcV19DNUzczbDBHWuFO/9D920KODBQBKPQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.a3372043_1549348073310_0.6096562089047346"},"_hasShrinkwrap":false},"0.17.0-alpha.c6709710":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.c6709710","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.c6709710","dist":{"shasum":"7d2b290788d4441aaf900afec336925a60905f96","integrity":"sha512-aghI2an7AV/kvfwYgEVPMSTI/2a/ybn3krtWXTdnjYYJfQqw8JjRXDxpF1YgSVSca8LNryV8lv282asKznHZ/A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.c6709710.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWSz5CRA9TVsSAnZWagAAwoUQAIpR6i3j2NW+1ccsITr8\nLbL6GcNfd1szMTPxigcAMB4Rt+bioTFbjFvbsL7/hGgZlXe0k+F/1Q/rlLDR\nFVgvUdNqR0wEnUexuGDoIxi8GvnoZ7IOla8ezp2cFTydddbTA4GavDBy+Dx9\nMAmVA7+z3sdt8np2JF3UfdN6ZY8+pnuY/LAGSgeSr316dVtEvqf8uxFOaCs6\ni+f34hdz9aCpXQ3IJrAmlNHRXmAGL1IP7FvAMl/7eIzLlcweVCY1hTZGWFYd\noZDLlTBC5N3CoJJ0FBCJJCumtHM71Bit97BSmQr/VQKfio2GRGjwLlvYXWCT\nFri2Y4pKX9/w3an8jVFquuxZJSOYCf2L9gRpR4jICFlPWvPl8VFhy/PlKTGl\n0kuFYqKOJfmMqcIW8r6sfjwdGqkLKDJUWI5W7g6VTpDZErVMdPzVZRldc+uZ\nFY4RfFQdYR2nIM5I2U4i/tFsJv8GYRLb0UK82lfczRI2HgE4reyQ7MBXe5Nx\nf5uCm7mwnAucIGbJoHCpPqUmYNE18fs15N8tJANA2F5pBoeEWl342Si5gweo\nKIhlGk5P09iWslsDR9ik/UgMpJRGZlyg1H+WCCFojbrkuepYZb+VETSqGcbN\nohRLS4Ty9lIrmceQ+/QWamPEl7nia3Bhol/KEODzTCngQBy4Hy1PpU/zIOvA\nXvdn\r\n=zb28\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICYbqPRJmNmbfIAXaooGY4PdMm+JNQcw4WfrBjP6Gl2qAiAVf8u8BeXIR+xsNuRiSIcJ5hAIPJRyr+igEA+AWBo6WA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.c6709710_1549348088597_0.8954435888807495"},"_hasShrinkwrap":false},"0.17.0-alpha.fb993fd5":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.fb993fd5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.fb993fd5","dist":{"shasum":"05244749c4f81a9c414eba122f7d69309d61fc0a","integrity":"sha512-rJJcXKX84v2rpam9w5a1hAxqa/JshICi6sWMj8V8KqqF7jipOBU1i9kypBZAbSaD56/u+QPjNgOVxO2rtYX0eQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.fb993fd5.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWS0OCRA9TVsSAnZWagAApP4P/1//fhObLpqe6LgowSzE\nhhmRk008iVYqDeEj8a/is+SP76JJRDK335B1uDCRA2/SInlbRSzyoPW1Ygn5\nZJ1WtFueRL2AHpiG0hAG1rAvweg/DvCl7cGWr4XtBdct/AMIRjGdSZUAUBFi\nYWIpoxoDUDJNQlDcSqjVgohpZbjgd0eLPNoXf9J6sXjGM+7w9kgG/z3RfqvG\nucpcO33JE6cMN7NIehxwUnDjdQ9o0IdU5ZDIrCZIi7OjULc4NALYAOmJx/L/\nOACudaBVCknxx98BiXe6Kbvfzd3Qhjy5PzRuDW5y7Gr8fRj/Ft6rF9A50aUe\npF3B96QUfjdoKEplGtH8aJbKaH3+kVzD3X9DYhYolaIHgMOWhAcmVM2n1lls\noZRZ3p2BO09eC5huGDxSY4qxlF/ohmhB6IUQEhcgzok0KSif86yGU5/7XNuB\nGD0QRUSCFHpQQjBnhnP4jEaIyluLqKviQZsRJc6eV9NZtkMSQkrFqOtZspmF\nALUIENkeXs+4GTX4hU1MoV1zui86vG/8Z6CiEUC7MuxlHAI1O5k7ouKHGRrn\nBOyjrNrdqh6PBBlUudUAhFjwuTXY+E+KgpP3NLvBXTA8bhd4uajSWNo0e3y/\n5WJVlQSPkjH9f8oiPn45cGPLPkz12yOiuYPHpwo6q396YsThbWVOvM5ZxK8x\nbq+y\r\n=/y5Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH2Jzhl6JAZxsTq8pxPtnSoAh2yHGca4pCpFM9OOrNrqAiEAzDq69QRcaM4x3tzKmUkCfQL/Rbq7JJ6sQhodIPds65g="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.fb993fd5_1549348110104_0.7098331687125414"},"_hasShrinkwrap":false},"0.17.0-alpha.0854f325":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.0854f325","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.1","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.0854f325","dist":{"shasum":"5d5d0fdd11b6a046e3ef1557cfab2bf602f7cd19","integrity":"sha512-ea18lY3tpCoRRaNW3jNgWfci5JSDC6wf9TYTF6N9QW+W9X1ynxP/1ngIh62N80yOnCXPuMiIeCOWL9drCO28Qg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.0854f325.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWS5LCRA9TVsSAnZWagAAJVsP+gMP494XQ0Sz0TNt9gMN\nGd0nLfbzoo70gY5cP0whVZpRJz8nP5r4jDgSmEkDgaePdCi9s16XvxoOD2sm\nWkq1Me/y0VCHe5sRDf4hJFKHh5XOyl23nASIoTY7Pd8n2bT15mMTAJv37iJR\nserrpgx4bsx5kdOQSPXc9ERrOOpF2z6FpnuXbvlIjC34dilNDYllvMfFjDZB\nGNfNaZQjYs5+mRmeMKGY3GHhMH6kM7sI8So1ZU5McymuRDRufleWdIpsyzga\nUqFv0odxrqX4wImqRWujd8WNbKqzP1Ab+uOkl0FnnjYzk4FtCVDS02UrC7sL\nLfiXoovyIJf7VtO9MZXQo4QjJFF+YiYam7oAcKkciOpVihykOJtWay05HT9Y\neCqGXdINGSerD6gWBsjy3PuVV5CC9wPRSOEJ1AjPtwnN4nFjEzIewJwM0KK3\nJ6BspVpUrDY3uamjYkhEzs0A/pJwr/NmXUqys44HOoU7kYn9vWhZEa7voMrl\n8FEz03TG3nSF7gTFDchT1nPdN4FCjNq1MGS10ueyGZCceHK7mQRhuccFIAk+\nekRmtncXUkKmtXTQMdnwewfSooWDEeTmV9IAPUDLRGOZlmaRzITiK5x48c/A\noQXaHcEAyeObZHd/JVPRzRbaI3bLWACLeqIYepOPIZxtLCAJ6yNOGVqjyHX6\n/+Ba\r\n=o4Z5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1u5jpfTIxDCAx2HIz2896SdkeFMPO8xbcw+Yjv45mrwIhAMdckbTAoErLfjO9RCUqwdBx9tFh+vwtkVL8DlaREF8p"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.0854f325_1549348426941_0.8003221996375551"},"_hasShrinkwrap":false},"0.17.0-alpha.daf47417":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.daf47417","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.daf47417","dist":{"shasum":"4bffd93d3abf4030b89a63dd42e6c65652632d94","integrity":"sha512-z0I+Czuar26jGb0bI2tf542kEsCujEKOEJzXnMXsSfvWmdZ0wb59OzRgpgVs3orWeSdQnxvYzyhkTEeM3l9QNw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.daf47417.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWS5YCRA9TVsSAnZWagAAODcP/3jeNo8sRxUqMMI5EpeK\np48C+UubrQGbZnssq5dsPGYJNmzutbiga+cmFVqAHoQ/hbQNH8cP+giyYCj+\ny/DvfGrPQsEytnCWuKoeralVQmiNsYfkVsFaKDoR/N5lsbLJik8rOkJLV+mX\nYx+pD6eH8oB/O8WjGudTSeHvg3h6+xSAkhZOWhWf4uzvmFH7zC0BAjGaJawX\n5XMIqNpziS7D1yWhivnG6/7owHMy7onogb1H8h+rOvgy7qOqZNnHKsKnzDL1\nN8jYMWzybg1yu7aqTdQGWXMHYHab6qwr7ebarx575hIRj3jK7ryJPEJeOF+9\n+Rhmgy5I4iIKPeTLrnu96awU5niwh04F3mAYMjPpe4C6hzqOSqD5NbnQoQ+2\nOXyQuI/gd5ekWDfaF3JI5Z2y5Mz/Ayo5QfvcXLXP3deli1aw04edb1QzcvC3\nrUz2VmbiGecqB5VDLmFgrn6c8wT1ho2GMcgNa/qlKdBZ9+AQTW34cIuW+Ab6\n/qbyvelilyfheZFhAlXUMXVEfTa+cBO+wVmPQWOzpswmVFQsQdt1g2yYXNOU\n/Tl1rf8RAjj+TjALACfZjMuHmnuVEMdhGhn1o0gGkhJglg+I8ZpIR6/8jLv6\nHwmL32tHvyJpvXawZN9+qq+EEZK6TAB6fb7mrD64MZjuz6oTfGz9C0gRSH1s\nApeV\r\n=7j6q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE9N7IQLqP1FSL1JuuSbR65t6H3JZokl6f+UoeUn5byHAiEA3J2v6ZkzEAvdINPJotwwcUjFINoB/J7GecHr5eSlVho="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.daf47417_1549348439510_0.7306116106573644"},"_hasShrinkwrap":false},"0.17.0-alpha.7b39834b":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.7b39834b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.7b39834b","dist":{"shasum":"0edf8f4bdb3bf605d0255d380d1734981fe87414","integrity":"sha512-qDT95psZvV8f+i/L2TwBxVN4DbRXH9AWTM6O3KySuBRtG3VBENI1qJi/AEcNF5b8H2zVRli0Wfh9Nrz3W6erAg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.7b39834b.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWeSSCRA9TVsSAnZWagAAll4P/29n9nbuQfWkN0oNKlMm\nqbiuPagKaZYh8l/DwPs9BdPjLrPqBCAw8dUwHiUlc5hMp6YHx+6sYHbrVf4T\nORlFT2dNfmFeiglJwNGbli5HDIMNYMvTZeuYkDy8Mis+qJJbTdj3IPdeSAbS\nF+N62f0yl7o7xn3fHQNJJdcynR8VtYUNZO+7joJuE05i/VwCgGRPKu145lpF\nR/zXPjO6JARumUar3crd8y71RztnsT137UVD34uqUQfOBz+KRX3qCRIeFhyw\nXL9w/a95Z8X2wCANJZ01Tn47FWtNsOjZtu0LqDcbzwF+gGW8y8em6pJyYjvA\nkFxRRKTdLz2YodhQ3nukdNfEcr+Fq6aLMKt5sZvlnzj+jjPAE1P65fuoKnAf\nmD1Eszk3QXLveXlqar/phjlc0MqGxgKpMNhVAffF8luhRpQMEGTAaFcNwHaF\nUwg6XcTHubRSSfwhJFVoZRsgvl+X88TKSy++37xm4r8V15q2aIrtNTYilRZ0\nMplh2WB+lTwWE8A7w1E52xoYiEHdi5nxinfw69tr11SW/LGCQTIpcrNI8YHj\nHyySjKHrjO2YljR2i9438FK/97R9Mi2iLyF8ydQ4kfG+rbTjC6DbSNJ1EYly\npPvDSVLCdWc0D1uHNuACI7kNWo7Kee31ZSbJ4PJfo9AEEFNHKFHN2eoyysD8\nNqRs\r\n=EVUn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDFNV2LuGqcj5L2BgJknkWcQIQ4BfH0iGSABD80lCF6gIgQ+oXmJdO2lDFpNqHiSJMO1T4NAIshGq2m5f2fKFnDkA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.7b39834b_1549395089962_0.9220443275985091"},"_hasShrinkwrap":false},"0.17.0-alpha.6d3f6b1d":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.6d3f6b1d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.6d3f6b1d","dist":{"shasum":"238b94ad431ab2abf393beb6a07df19cd899fdff","integrity":"sha512-FJgxo4jJWFaVxAqTlfKdtp+e2hzEwVFXlYdXs320stCKM2bq+2tDizDqGZ3OIDUgDvRZ/Ne2rO9EskFJE6oo5Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.6d3f6b1d.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWglwCRA9TVsSAnZWagAA+m4QAIyE1SaoW8R0Dw5SfVqc\nrSCdimVp7C6NXpi+54DDtPTrJkNZoCTmG7kpPXJ5iQ3t0NSJFfVb5yBaX60Z\ng6soS1MKEYZXALaKWuFSmFmauFPhxG80rrPKwOzLKocnPlRr5WSoFsh9urKd\nqGcDrwhvbkkzXnv/r8zRENIKvldhI7bEYgz8cY8VzV9C1mZOSC/tb+JDw7/b\nIAcR8kAcPZ05MfYKruTpSN7bq2DOtwYP+u2RB6izH8E67aBdhH3zZ/jPAIxR\nbWJuVsKPSCFYVeQrcPU3ICdlcAxsNe57Yn/yZURteCo7PoaI+U1RgDcQEGpG\nFwgEVdVFhjPUiOI3Cv3eqBzj4vded6iA8+MTy61rOpr/3Tmc45LSWN6En8Yc\nyeOZbgNKmsRypldoF1lLWOAtv/E5bHVCryCK48yJAlQpVcMYVp5AOxBEDXfP\n3O4rO4uAvzTzPEW1Mcf45oKKmBeGmiPystzBsESIinE+rJHuOhoQw5BVSWIK\nVqir4MTAsy+WVR2m97uKw3tdnP3aRKYvLvmKyvt3diiwNawwnsUgXDTY1WYc\nRgt+NrAhxn/t1wx3+F/151gHlFKoBQwmS9wlm7qnSCsnZZ08l2SNgvXCAJsL\nPeXreQi95L1vBFZLX+nRAFU3zsOzbwOpfmwAvecYEqU37v0SXeMRUt2QNc2t\nIIi5\r\n=V7gE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaw+EWJU20rJ/haXcNbBRKaMn5RvFig0DU4wM96wmtWwIgVfcn9Cn2BS2jEYAF7lTsRXTAbP2lHBi0Mb3Egc6oeNs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.6d3f6b1d_1549404527853_0.1861689668198354"},"_hasShrinkwrap":false},"0.17.0-alpha.d9949d36":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.d9949d36","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.d9949d36","dist":{"shasum":"2d51b397377cac29e67115fdcec9f48287723844","integrity":"sha512-rTkabUyEJ0bQ+z/fHm8sRMtK62jdQnR1qibYoqaJYxFV4uP2VZ9AbrmjlDa/ZzRDa9h5T/jROgU8vxmRag10LQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.d9949d36.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWhCCCRA9TVsSAnZWagAAHd8P/10xTFDidg/blT7ZxOhk\nT760ELUSlz+3iIos9uUQVUBsgcjWRYj0AurlnVk4Hom0nk5lzP2kbHIkSPim\nCtajZTHpIAhE9lcYKuz10408gkhWEprstwVlcXCTJc/FIMCB45LWFc7BfJfr\nCGQEKwhD0NaaGmhaEicg72/q1wgjt43qrRskwRMyiMXgd40O3qLy+PSwJUBz\n++JixjB8JkWKzXC7QxF2w2hX3l1u+gjOWg59qGUBhFhdVBIdtnFaCHmHiZ3t\nFOfEyrsowbYUrAcpYu+IR5RIzmysrBsziUSUNxMqtNK68M8mHWbEIWhNyinf\n8gW8E6zp88pXSD1YPMPBgHopG+mfFn0C+OZwbKkRt3aMyGKb1MG9NnOb2H08\n+HNVKJy8KtyeZ5MX9SPyaDSzQykj8A/KEfDczPlvphrqrRvofZWlg88uz2Sz\nBYF+IZBx+81aUwo9gwRwiS49j9ZR6N0gW5BRXPsQ6iJfZkwM9XBuMoDY86T7\nZW1Zj5gTkS7jqn5VulaeMxBgskXVOOC4vUfgHy0Jus73baVQvUcRS0sq1fbg\nFENzX+mQH1gCnvyJFv9M4RI6J4a/qUvluafQnD4zTv3ZvsK7rgSAuRmxl9Ke\nEC71ytYjBiud1vOY8ocik9Y2YXCPEjCJB+Gyfr7ZUsBnd1avXnjT6a7kwyNf\nRuYW\r\n=qryV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCw0AqIx3kSH92GGFPh26qaIRQ/Qbwlu+hXrshVllwfjAIgBTDnEkQ5QSLlkP4WIhiYmMWhSd31gqf9Gae9BKnfyo8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.d9949d36_1549406337652_0.8546182480764102"},"_hasShrinkwrap":false},"0.17.0-alpha.f484a06b":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.f484a06b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.f484a06b","dist":{"shasum":"0d28fb115e3170170cff428559861c17f0c2332c","integrity":"sha512-avCOrlwHzj19GYpJoNdTkUPMaHZGgcAk82RPgbo3mv98pRV4fJFLz6q234u4Of0Dl2/1XQUMpLa01Uk/+zlK5g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.f484a06b.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWo3FCRA9TVsSAnZWagAACP4P/jre/103nUPsmZvkCVBW\nLiHVTXiClcABgtXRiSbnQtO5H+0UMge4AljTj93So8JYxyNmCKACetJG1/iI\nC3LRY4l6N/giXrPeavKYR+oxVz5qtXxSTeLV4PRTKpI282ll88ETNprix2Jb\n2Tll9kVF6JgTVcUgmzn+cuod+nl/6gTLFRihS3GzhcbabhleCyOzk4KCffG5\nb9UihkTVUrQH2bK/zI8hgPQfMzSNnhq0TCWdifBsOTAB/iCQ/9fnNSwtGKVi\ncgYHl9jlvujxXHDhRvr/o9pC2qd9PRm8KkUZ3CNtaBWtE6TuPmUsyAdQrMl6\nirJ4MqsSZiELhQaZT8RP8Hicn6pNPr0wQ+sQIh8YDpP9OvoIKO0OT4olmuRV\nj/d64JBRWBfjspS7aU8HiDkP+n4TRY6mhBlVdENJx/jKXXg0akvPR9ZiVzrj\nOYV+C0lirOfgv9QWVLLSipVuZV1JkX1RTd9i44bNSX7Iu/ovlFyLB87Z5kQa\nMjyX3U9PLG4FWyyymtrRycIn1dT7h3yKeEallwmIpQgCMqpKhRxXJeHAeVpN\nr9eyQEKQp5PKE+cJMJakJTFopssmlAgilwJNEpNUo96Oa5HxEHHuYmr27SEu\nHNq+9gh8IWFg7Re2DBRuPVIuFxI79ck2sWjrpOBedPTp72jrRnUTcZU/EsZt\n5BAG\r\n=Qewc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDk8/Q9DgXabr7otZ0CvP7y37ZPz3U8+PJo80zNnK5hygIhAKNsnvgswTsK7E/CLOTY2YX7pyfDNRF+RnNQygfSzW8K"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.f484a06b_1549438405015_0.29305625448440487"},"_hasShrinkwrap":false},"0.17.0-alpha.0b4d3e73":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.0b4d3e73","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.0b4d3e73","dist":{"shasum":"6544690a4caea2c65e75fab71348e8db1a78c40d","integrity":"sha512-XBW2oxiNfkxxgOIFUcmBN4TMJu06gzByh2fqJtbdXBLj25imEFb6rMqTDzlTkQ3351ht3OToIEtHh2VrgrEhCQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.0b4d3e73.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWo3SCRA9TVsSAnZWagAAOo8QAJ8uWs8jJvo893O2RCWN\nau+TMU79aqtlodcx1+N2ZTcbEfR4/oWVeQtjpP3E02dxNfCo1uMwOUaxm1be\n/1sRICBnm47uBHKvhh+WD6GZE2j9yHv9aOr7uF/etCMrXAbXxWFuwWbPfnio\nXuaO0W41qynGz8JAiFHL/tal5d6eZz02vQGNzjhHmbWqG/7qUIFOIwatMbGY\nKozHv/hvc8cc+pS6N/gS7BbaithCpHm+tJ5iKZhFk2ExWW0jAPuj72/QI3Kj\nxaOta9QxRrpTRStjjcPrMUeerKVH4uQrjUJ6wJQgU4CDzYrLkavrF6PxmyuO\nksj9omYa3SSltsCIn3veYtFAXfD//MQKTqRv0X9zBjAo/YuL6JgWRg1ALoZo\nxmFWTf0MnalT1C6FxasmXSiPpmYN74PDZ+wahJtedvsURIEXJPfWFEZ5zBDq\n8gcOaIBOnBWLr6lfpw6g1kIjPWnlRIsamXtTetxCMuTH2BGJ7WQCKk53xI3z\ntEqp7UNhMUbVH3wdGbVySj/v1EwxWC9jOAXanavM7rOH5Xedo/onTb9iB1St\nmYcmPZGVPTPgqphVVMa0lTNRK8GQXcJB00x0TmdHCzppwTJ6Nvkl/mmg0mN3\nMd5Twg4Rfqj6wW+gkxwhz135GBQ3q7o7kSkC5NwSeqorq7fug29hE2Q6uXSO\nAY7m\r\n=wHLY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICqzdbSF2Z6K7efMzxyXZHK1GWUfGERzcdOCzLYKQYPBAiB8g6EJ6McrVom2I1Ra+hoW7ZldngoeIOPwzBHEZLhlvw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.0b4d3e73_1549438416876_0.7694593412049417"},"_hasShrinkwrap":false},"0.17.0-alpha.0cf34bc1":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.0cf34bc1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.0cf34bc1","dist":{"shasum":"37d1756cde958239a360e473e3d3dafa85ed3fae","integrity":"sha512-xLcGGKuwUThJaORIUV/tf3eoTuN9warGY/XFT/GH7WLhQZRwXnl2D51aX5WOBoMeKaz3+8g4Y0uImSA3uadb0g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.0cf34bc1.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWo3dCRA9TVsSAnZWagAAGwYQAKNj/EQbUKlDPFunXh4m\nKDwAktlz9+e+eNoqqcQ6jwP1Mn4fu9SP9RxqcSQ6r1Mg1YJ7WPPgiJz0B0nx\n6M4ZfjBXBd9M2mBqmXLu1vSiLjAAR+HLTn/Fbr0xObUpJOAhdV6lt0Qhu4Uh\nUwte5Q5iA62AzyptOrb6HWiHUL5jAAq+RfhOC278mwE16ZcmTNVzGPjj4L1S\nZM2h0jdizPFJSli4P5PmPVln8PXFY3iPgF3IDFNMCHIN4wi+ITgAyBgrzTiD\n5cX4St6q/20CWj6849TBBLoaKSs6YFdW1+CydkkeyaU9BFs0j32QHRrOncmJ\nBGQ9+x91NpJGZFtZK6bSiOaWOUDb1WQF/onbXPI40WJdkZZfr384hCsHiRUG\nvvsT6egkiK53UGMyRc0zBC51VhBIiEs+qyGW4MgloayklWVUxZ0k2mLH3+cz\nDw+m5s8ODaL9+5bBBUohGBLRAWqthxcEc9BvaQQXcFwf7E7pEJRF6Sd613Nj\nqVU1j6dqqbxYHtd+xjGD37KSAtiU2vsOo6FA2AXJH3ovnH0OppVEREb5/g/P\nAUqOlUD0pfT6UJlLBUGj0trAkOMog912bzwEuec74NVHxqXwHTrgRgBC7eAy\na+QPoJxkxQ9SUJ+AMVcs2VopNz0NsHldFvBxC4U63sWKWuJXwcXeMIBXs7lD\nE1nd\r\n=DPav\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrsL0S8vrvuItWVFRId5i4vf/tt1DRy4Py1w4zokl/nwIhAMW3X3N/pHV0bpe2U2ZHBxwoLUrRUgaS34vZkc41rG7o"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.0cf34bc1_1549438429090_0.10990574904968264"},"_hasShrinkwrap":false},"0.17.0-alpha.4fc28fed":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.4fc28fed","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.4fc28fed","dist":{"shasum":"5a95282ece68f6768efdb9166cfdf61a3e4b55fe","integrity":"sha512-Au+NITfoZlwouf4/Lm/C0RMgJnZ3EB+uZ7hD03C6YYrcQ4KASKUlvd7vj8ebYbeZCm6/x92Lc9NKCKyqcZpJlg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.4fc28fed.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWpojCRA9TVsSAnZWagAAtU8QAIcH6D2F++f2pJo5LvGG\nwfBXfx0qsfq9jfX3Q0q5aPsB65g+YRy9gT/OqSiAls1FZPjp1ipZY5ZbLSbL\nLh6rdq54xIqFLAYVv8xft0PHVkgNYukKsPyTZeztf9plUa7BRx9XYs/quhD7\nzbXwuXnc7htx5h5CzaWSdIrFobuEBUvCVTgkBt37h2P2QkN7rnpts1Iac/GG\nuZ1QZA9EK7Sg1eBNHqVTt4Lx0AvTOey7ffHXn6POxECPBtu0M10rlRFMzqAL\nPytw4VvWms/v/YyArEDbyVJnBKc8dJYYKzfdda11Dc0mcCMmiSrNg+iK6qeU\nlu1WnnKh9d7Ypemvq/oCgUXS17rkR8v4FChKM/bVYWuwhlCXcst1vhGTaGaB\nknHFNmXxxvYAhDQ13ngBXQIcugHnNPpHO3Eva+8ocyoLfHYZmqpTkRZu4Fqw\nnmvqH+lkI9Ovsttq78fmgYAbTatpPsIQPLZJZTWgZry1Q7jYNXPQCoALGc5n\n9L5wh7AoppVz+s7gl/2y9dpoP5nqQHihKRIHVvEe5BesFGMIYm0tfCaXo60L\n8GFPGvujiO4lvvHjV/IdvZhKl030IR0y5GXYweDWr1w1kxzK7VaRcJ43LuqB\n4k3M7qFubrMLvLtsnfbBoue6VtK11MaoyOZ2E5Cipf6nWHEajsQWk3Xg8Gy1\nbnrG\r\n=fVaH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDu5S3G63QIyjxu+OA6U4SOMmA6bfle8IXV31DYSAjH8AiEA6g3yj31jLN62/tQfmJN34ysk9utXawgp6Bey6Rcgd8k="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.4fc28fed_1549441571100_0.061094959029891927"},"_hasShrinkwrap":false},"0.17.0-alpha.40979ba2":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.40979ba2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.40979ba2","dist":{"shasum":"0f7a47f19b7d85277e14147b010a2570ccdbbf45","integrity":"sha512-1e0GmDoy1GyoM9IWOELDBXpi0sZ3uaOE24T4+4Xy07ygwttViQwWhRSVYa4uQZF+CGSon8GRHO+iHdDHGmgs2A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.40979ba2.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWpvZCRA9TVsSAnZWagAAdzsP/1TYooCsrpnt7ua9m7Lk\nG7KcQTqYtaogOM97+/zvIF8lRYhS6BlHQdXuaMitqOpjiWzSG7LBjutK15iY\n3HBgXItJTgh3srCZG2JABFROlgnCN/TESikk3Uf8k9q0xMXh4zQVxoBLUhRV\nm7q1ivnPpstLbEH2gqT1/c+yW30OFpdHGEvFbXMAWJyuPtrOmKiZG2AGJ90R\nbPkZXBP3Nv0lPo68QGRI/LD+ICPPGVhTYqZIzp5rcVDmsNOSVPO2mgrMVyI4\nKRafC7mKvhPxUqQ6Kb9TOd1d7sy8xwj9OTa5HU1vMEEBPp/9fFZ2uH33mrXQ\nEsGoZBUTU8sWuZm1JlMUu8GXbmZ1sLI6tbxQOQB9zUnivlgm/41t7zVEsR0Y\nFRHDy4/aZDKh3csjm4YeAvFGo90IQLhTjls8ZiQZc+UJDGtowXIf4eoaAdmP\n1May/LVvlt3JBFlonpTRlcGtJifhllXigUBgxZxoBLoYitH7Vp2M2Hphs40a\nj1NN69Y2+bsShWEz5KVUi28cci/Ay9kKt3X1xtw5vm0GHl0ArOiCal13gzPO\n1aMsR7rk+5cm49wCVoQX929o8ZMVYQx613iUhE5Vfyq99+ZUdYBVcKq9uBz4\nf3LOU6FIKFWp3hiCFFo3ufIcXJ6pX0QkWqdIpPfwgM69aKqEQcuiV3vyjYfl\n1Yq+\r\n=KVvs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCL+BJMzPMAvzaOLxOMQqR61plM77KkdO7SH4rOGP5zKgIhALa/FOXjaBkkEPY6dfflVFaNViaZYtmJGS7rkd6EZzJ/"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.40979ba2_1549442008440_0.5718465589420447"},"_hasShrinkwrap":false},"0.17.0-alpha.b9ef304a":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.b9ef304a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.2","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.b9ef304a","dist":{"shasum":"e133698db441c7d387f6ac13ff9bd22285728de5","integrity":"sha512-aYyYPzIaMbvsJaY8XHRyd8PDajOfmTnpWHgUrO+hCkyQYVysaE6077HhPizDBeIrXNWp4d+Wweh4IDMunIFDlA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.b9ef304a.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWvM9CRA9TVsSAnZWagAAmOIP/iIa8zuv3qN9foUR0sDY\n+syNgTC7vQ3Tq0td5xqOKrcBQVEQ1MeXtafRYw4t7Li/E1fBg5PXh6U/F8EV\nBpHVMJZxjLLezcWys4bOmfoy6f1J/gHkeejsKoOuiHbsuDh9heeEHlf2S4nC\na1LbjIA7P2ToqpSxOZCaYTnvQqDEMWD3dZ5qI2GB6syp1fryIF2aBYRzPYnZ\nwbl1PESfa9sr/hlhJL5fiywRI9GvapGbNdZ0Wkqsoi9prRqFUV3uz53RP7jB\nQnbMhUZfvKdpN2NIst0L0cV4QK7GR6GMVeiQa4+z0OSzJKx5ADmLVPK9rZju\nKJXF5NOLL7m4NYmiqY9Usy2UWIMxatIzb4KXEOnS8QrC2HE1jvpBGwJIMoKN\nS5ZjS7YxJk2YMUfYvMmACw6pTxSeXt60TGAzQZE21mgACzM1EhnZV/75tI0U\npJf/9WsatDr14MwY0hZS9OI2SyUmOmDYFSM2CDpenAxDZVdadMiFqOrgvNHo\nCOAn9oegKCFoVlX27BPbrHIaTZT+sHaLE7tatp8Fi5HLCQL4XC74SFy8avpc\nrDVAOxzsYz1vxDT80NSCZ1l4MeKfi14pu5s7b+/XPGCdiP8fDS1VJA8zOgH+\nB1lPbJppkbpiEen8VzHCGXfa85eihqlNLIrV0GaRzxfvKxrd0lGA5wWyfV8q\nR4jU\r\n=f8jA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFikbFa55T/wHEuaH1CLF0Lg/RWg8MnHSVoMrp9FZzzQAiEAwL9RXgcP3WmqZJl2XUeElmkwc6pz9f8DawPn0DiaqGI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.b9ef304a_1549464380694_0.11126041455689761"},"_hasShrinkwrap":false},"0.17.0-alpha.3cee3744":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.3cee3744","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.3cee3744","dist":{"shasum":"ac8e505a1131be055ef5d734f552c31bcb72dab9","integrity":"sha512-hAssRWyuigo7zVKJf2ubxReehOL0pVcDoYO/cF6h3i1Y1xGX/kBnIYI7q0bdCndBhWLhlPd1bRi86fxcwXghdA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.3cee3744.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWynYCRA9TVsSAnZWagAAP+AP/i+nmB9hJWxq+F4//T2K\n0R8ACp1uq3iUiZKae/oqdk/8V3UZMaw8wZ9N9QXHGC9//0H8IKwzWN2Igsrf\nJoUAMzeyn6dHHlYA8/j4gYGSz5P+rrZfSfDmi1ZKR7B1x2pzI1ll5JW4FTE6\nlZnQnNvsV8b+IoBDNLItuz28SWc1lDIHnnW/tcJpkAFQZMRNzXpUK4kRhTNS\n6dxp+f1Ia69Lerf9n6oYeWsmggYwi57Q5ATn6P88WxN6IhOajcJM1oFicsKt\n3hgeggmLriDHqW5iPrla2A/R4Borw96V7Dbv+zWtKM9USaSJY0yKhmdsUuHu\nnWZjajR7jPn6spj8sautPxaTgPM/ofU2tlGUSEvXpA1e1MdThlUiERu+chSA\nh/FUx+DAzqH6vPKjknWrujXuA7TtcmJvDjgTfyj0KlE2l9b0NJ2l85dQqCNL\nEESbRG1wxET1gk89ZrCBUMz5jK0SLSiZcWlJ0mRvf1CU7MTKI7E/2P8hCZsp\nNKRbTRCBq4XmAEN5xhBvmTnf6sEkE923UpjGIHnUJiGMoYgsHCv71jvYYbAY\nzOx9EBLgXso8xElCXxkAaVykYpHGGU1H9yEXXfazSdEst8qIMHpYPqlE41Sp\n1RwH56WVg86fBhLbHuhYfkhxkmjA31VBw4alWu/DLr6x/5q2+fRAsWQrdAjO\nqRKf\r\n=ux3u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBsXSRhdZl8k0izvL4sVProysxSD5N5J5UD55kbPnsSwIhAMr2YVZxlVAUipRLxeUOqmShCtxxe4xrKyhnPRJLKUsd"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.3cee3744_1549478359802_0.896510951146033"},"_hasShrinkwrap":false},"0.17.0-alpha.52b04139":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.52b04139","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.52b04139","dist":{"shasum":"4363c9771f19d4fc6b2331beef82a231d4be6cc6","integrity":"sha512-j3IXshSOo9qr2SG4qKDvs6IhxSE8fhZMAPWvV69J2dNO2B+yKARH+D4unvCLzOKmiBBqo1RqC+wRwRIVZuN6nw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.52b04139.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcW28eCRA9TVsSAnZWagAAwaUP/3qcGUTwnDseFBlSlkLV\nZwq2C5FJ5K/JMnFd9PCFG7JPafTxhhf69gK4OXLAYfUYCLprptVBo+JjRUC8\nidQDLpUALAGa86p2p42u82hPMNBKRvG0m+It4VCTtFSD5H47VGFYsOx0IHp0\nFko7425Axs1pUmS5wwcbmjKtBsGUBQdyMLTbAdHYMFJwO20ejNuJUoxkeTHX\nmhVg7UuhAamfnlcZaRFqxvcJSezVBzW++XN4xT5IZ2uc/IRDLHMh+CB1KLxw\n7l31uEsjUEJRqXB/Qyoo6e6YQV6u/ghxzOxyVNpBITykFdT93iaSEGPPL1vb\nWoJEj6i9nxdD+v5fNTa9PwiBW79vJRfa+Ux9Kt0uV6cK4CAE95ubgMsPx1LM\nokaOOrRmM9yfLbcuzYp0SkcYQ/ymx+VO6usN2YMXl1VB2jq6f+4sGQRmU3tF\nWWiGO7pjWBfW/3S6QeAM+1ngNIbXbYtFJZ74iWhbv1thhmpbCRlBxC+LicFx\ngiBYbyZU+cfpY4txF4OE3ZzMFZ//PNMH2s9QHAL/u90zb1S7X+0xlWJcXLUl\njv69zvyG54i8FdySI+2U9RW7ELlhr++ApcgsWn8ICUEx2C1NWTTg4uGERuPH\nUpqTCtqueTTPAYICkzV6JFsLVhzsXA5btQRS8gHpd1pz4ovhHKPurVo1cSly\n72FM\r\n=FQhF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFePsDGBkf5hiTXHB7HPmurxz4l3O74wT4NyIBiuV1kFAiA+oC7bk6KUoKHM7/LNYhcRH9b3E5zexciKxVxlF0xPxA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.52b04139_1549496093864_0.8226843076787285"},"_hasShrinkwrap":false},"0.17.0-alpha.70087e70":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.70087e70","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.70087e70","dist":{"shasum":"766f8b22fc685523162be348ea383810cf48c1b6","integrity":"sha512-q4nAzDYhEkpNPijRPa4OCL2xgaX8eBcwvXouH1tWL9Exzw7LPqq1C0zMXbfpgoMRpVyZXRdBmJnfLXJ2KDj5Dg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.70087e70.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcW+/9CRA9TVsSAnZWagAAfoIP/29SRRNan3KQri3RqmHY\nqE/J1CKBc9NAO04qcWxmS2K0SoMnMb9KxWIcmm5wTJuZz+jOimVgyfZH2ghw\n0pEkc84TJU/e1ukq22bWZ183/g04fXMldz2Yx9AeppP2zQqKZXIXbuRiVPIG\nKttovfLwlvSdEUVOL1ZNOi2yW6aBKpbu8+3trtPibZ5vKCoWpKxiVMrmScE/\nc4GmbzyfZRpJ++dfgIIly5bAlzll6ebTwmHX1yvKmjN4Bo9sUmFGgB2e7Hzu\nCILdI7sHSZVgHHeE6aEyFv5UO9wjfAecr1x/6u+iLR1VOtLR+eM6qysXTsjj\n6pdQ+fytpOdddKQLX9K4HeNXQqN0hfk4i+kcMntrzUH+WDVfRKjMq1BgBUHi\ndy2HTr2DCYDJLZG+rcY9molazsUO6CCmqQnfXk3cG62N/ak7Fd4VUuvOXFlp\nAaHf1KTMC3TbswII34CdWKeAJmBpoF5Pihy0Q8zozDdkN3Wrl1eqGH3E7kKH\nZgmuTzpD8+T6Tb/N39XS1JWgY1TJ4DNz/TvEQOVXctB1gq1lm+dBa6XEZMgL\npShWDF3QN1SibaVzImFzX5BKRRzcYRaulEECEIn+xUMFqrN6bkokKcKDCW2N\n0dNa/XMPQVA1kOXUDXockeCDU+/vHSDaL+g7slnMj6zyXXtjNqeIS1ZH4qT5\nYA7/\r\n=XJpE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwZsoGQU/at2Npt6oaGsiO1DMNSMYsOftE9GU5/b9CfgIgDbke3F/g3pGLnrFloL8RdCyExZsQr4V4gdE+V9Lotko="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.70087e70_1549529084733_0.07020493976072917"},"_hasShrinkwrap":false},"0.17.0-alpha.fb0b04f9":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.fb0b04f9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.fb0b04f9","dist":{"shasum":"2ef35f028e4395bbf3fba7a979895c6b490edfb7","integrity":"sha512-pEuvXoWeTu5jWZQ2nb2dK/8VnSnBxjpTGB/fAcByQ1LxqkFPGYNegcCMNhd3/Kic5WWQ9SCa2MI5lkdPwJm3lg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.fb0b04f9.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcW/qwCRA9TVsSAnZWagAAy7AP/1pH05rRRMM7v4yTWUHK\ndawfjsg/zXARtfJ3zmm3v1fcWeFEux9wFOZ1pD91JZ20emTGEvJ9URWHS3bj\n+LfvnT7fhPEh1T6CKTJfWQBUYkZDr3033mfh4lssnkJlTP+adbyqtHKJ69dc\n0Nd5KjE71hYvOAKiUvFaBPQih2ORT0PFBAfpI0tz603f4prP5cFDn9pdY3Tl\nceVZ9O/jop/wWeCoPb2gx2WaHFUNjm1cZDDnjunq3pw+Nn97rYP0PytSCQj6\nq65wU9a9orTgV7VcHqgl05LRRaH3v3yP5C1sqWHsL3oNRuYZotPIlSJrCn1t\nzIQNRDQOG7mHpMbCf+7BqPG39pW1ldoyiWMSSE5L89I1Z8rmf/pCMTFEnhTW\n0pk1zCs7sAc6g0k35rs9ZY7OBQpBWfQdTzofCx+3Tbot8Utmb95hgrxq7dia\nLlA7aXD4IZXEEPJUxW01Xl2lD1GI5kZ9x2P6lDHVuhVF7K7/Ht1/hSqXS2CK\nT4zuO0gLOVVM974FfJvcGSms4v2XZUyQhCe6MqfwPtARxAa/Abzq2F3NstEW\nTHXsiSYZ+YeD4ahu4oPHheB5Q87DKNNEap/joxwX9i72aEZcrczYUEkK2GzR\nXWmGMnwsATDYaOGyT58XOumZafUIshrRysa4MUi98v5dJ7fUwWWE7r6eOS2w\n+9dT\r\n=BN03\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGfykd9QUt2487AY6tShKN/vbGpldjSqx/sqcygdmdtgIgVXqly+gANoG4BjC4ZvrwYozdVG0I9PDPETP/qDY7X/8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.fb0b04f9_1549531824118_0.953770295150477"},"_hasShrinkwrap":false},"0.17.0-alpha.0ace5ac7":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.0ace5ac7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.0ace5ac7","dist":{"shasum":"bcf8d185bcb5cef6d2e8b3ec980447c202c14078","integrity":"sha512-KNIIUba8pIAmPsgHYEBFMGhYkfpjILNj4SUNBboSkp+2EYbtGPcWMCJa/mEaaeUYmT7SB5db73VM8dDDDepmEg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.0ace5ac7.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcW/q6CRA9TVsSAnZWagAAtnAP/042qmA38aVm92dItblH\n3VF7JnBP4WOVdPUdh8eEHhPJAi9JNasPHea97xuQKmZ/DzqHn6BQ5WVNwGlZ\nyXWaq+/YpG9LXi3GmB93JpbfCojN86smMdeIRYlwCO62fMdru9dA4Ugv42Ky\nQN9L0lnaQcJuAY2z8dnQ9xUPIybm9EC+hx+6Y1Jx9tU5mP0h7Sc/2MiLm/3F\nkOqDI4BU1hY3Vi0O/F7H7VkyfnnBzvl96vyGdYjxlE1HbcwlQSPfR//M82ek\nIFufQG1l5X6h7yP6/NdCiPYkPjlvoZByODr0VvCcn1MBThAbIqFnNtGtGsbX\n5Q4G2HETn4Z5XO+5MC6nEXkcGh2h8PFg2j+QDGMah39g9pLwsaZffzbX9ta+\nWHb3fNSsPxr3RNAQCYXCL2bsW6Ic9V5xulvdPNWrZBgWGIrQG7G0pnnJLNfF\nHxhqU92+sHiysZbpE5JvTdso3lID9l+HbqQFls76awaiuUVOnCGkZynh5SFQ\nxs1E2cApBGLHhh+fJNOSxdFV0rNuK0MEAEe78ZXkgpqsc++cJm9t83iQdwV3\nXARzvpW7aHfZzb2kuun2CNl/LqqgDzZ2+7c1UgDnCHOd9bEmsmVdJsT+uNSq\nCbacAS/aJOInIStJfUloJ/YQ4XcFI5vCsandvMSpJOLaT5rUAZaBAzQyohu+\nkUaJ\r\n=s3X1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICcv6Qi7kmPwGJs9YrV3LVCRukyoxxEpSFSGBDQCVHGAAiEAlzMYQ8/xtvqqA1BaelpqhFYtI1qUhhQZ5pn1NqzQf3k="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.0ace5ac7_1549531834213_0.14303035604299796"},"_hasShrinkwrap":false},"0.17.0-alpha.5e884b34":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.5e884b34","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.5e884b34","dist":{"shasum":"e7717d0f34b3d3e5430dfbe6e38c6f993c0e6bcf","integrity":"sha512-/pmt4DMwO5Y1z7XZYX/eEcrcFGyrtf9vgDEJsa7IF0UeJpAPS5SnWL/FFBCIEHkr7vlJjRdBKwvYBZpqOoz4Bg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.5e884b34.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcW/raCRA9TVsSAnZWagAAcKIP/A1MnLP2ia6VnQnJj8Po\naCHIo+kAdlBx7wUZq3tFzMwkhCyO5p3aqXvfetRtHGsEV2+nu4aD+ik+FURU\ndZhsVfxzxTMnEJVQiitSqAPdC5IKOZHfzFgLw7GbcuPon68g8MbT6+vHgn39\n4s9BTLfYpAZQ0Qp31atrsDLzKvdmzZYRxg0HID0FDL+Fe90wCtMbOl8ddfl4\npEIfJ95d6bhnGIZnvnDdnnx3pl+UEzmdqKfrf3MLCd099YhIBzdu20QOwtl9\nRQj5uAES63q9OxJ1NgtKKxYYHsbZDhNOym4SZwb/3MBa3FRbIWlfCAe83ukk\nK7wSHirYGIsrABkKs3Tz3clw8FJupgs5pTkKoIghAqUKiW+363EP572FRg1O\nSumfkJEBiwYlB7FdSEUnUshlWgAFZrqRAyvTGeBeOOV4TwQdK7z8K2IVdzOj\nG+zIXraN4ErezKvsruHxdOW99X+sroHBCjsiPIkmZeTILi86JxtDokKR5HEu\nHxNmITSATi7ZopPZbWxyazPvrUx6Xnw3ZwPR03OMha45QWL59pp8kiDejUHx\n8lB7HJaiTq0TsGZ91gxHKVO2keepBj6V9rF6pKhfFyMjAG9V4mZTvGGtifqg\nwQUpFlhEyCfB03oMTU1szSdSNcdwdXdWB5+8g/pfHnwUJUQJW155KcMO/e8j\nmzPQ\r\n=gwPA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxZxxncxpMeE08POJdllv1NmL53Dv5U4Hnpi/2HYI72gIhAPrPjXQSuwtYOakpOEZfeEoZgqi1A61vetBcsBUELkGk"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.5e884b34_1549531866188_0.5938759365152866"},"_hasShrinkwrap":false},"0.17.0-alpha.5a046708":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.5a046708","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.5a046708","dist":{"shasum":"a2a7397a4a1c5a4524a0941c01958fbccc01998e","integrity":"sha512-s8bEbX9X1k9EmOVP0H4cVdnT0tXWgWBRDx9h2sSB0394ddxAk/I0xsFEEBfvqij6MBxMjaczNczmjEIkemn25w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.5a046708.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcW/sACRA9TVsSAnZWagAAaOoP/3tovboPr8fiAPTsu7su\n9GuqkqlNpxcLm+dOcBfd0SrwCO7cJenWZTUYeWkc7lGPfvnBDPL6JoufILG3\nFnO2vFaEXWO8ZywOamug30V3iFLNWFsJaUu0YowfoSsqiI9LVsviT3QyujSB\nWSZFT0txp7TL8wzO3XpWeb7Yd5tFtcMAoATE8c0W7KOSgI4mwds/G122giXZ\n40y8KDSPBqBF+kovea7yL2tDOZJ8M8SG7+dM/5uB7zu8cnksE3eomqcXI1Nh\n/RUYRFdCT+MoAgAPx0yvwqSWgylRtZ2OPn2PYgXsjLBkirmSbKnh/5pGNEkb\nOLeEULvaf+t1d30tN1TKlRx44s48dg32DW3o7nVz2PgIlNtfAwcYPhbfOVoY\nZdLCYEUxLK7Y0K0baqi2CNyoVGIrss8VAi6FwD82OdvxN6Y8ViNusEgP/KsJ\nmTlQmcX25MTVk2HRVUFgJgCHpvaLrjhZqPAwlMOYHhIbaHAj61HpVurn/Fb/\nvasFnKUGeR4Hp1byjFSsGj1GetX1pY7sfFWvJpAXL4GlhFMbi8K6LXdmgJyH\nvldNUbP2ahS0xcJUuxM0CJjbGlmeJZNfp1hzsfENmtjdNQ6dQEWVgyf9jaQ9\nlpo1bGJ7j6GVhbSyJ5IWCAlIXC6dL4DW9RBG/Elkx/TsVz8hVr+ULRy/Q45p\nRwqd\r\n=kgtC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEo2SAKZVj+DaUCmclHj5fZDBwClR0Nx00I4xylpxWZZAiEAzRTSh7pd3V2Lb9iHVAPvSUk4JcVLD0tCqtuAynbI+ck="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.5a046708_1549531903667_0.5391619134415033"},"_hasShrinkwrap":false},"0.17.0-alpha.1627d5fe":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.1627d5fe","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.1","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.1627d5fe","dist":{"shasum":"6ed48533f08ee75b2219dfdfc32839a37872c858","integrity":"sha512-xN/NOJs4IjrI5YqOTXHFVrKKQ6zRY2CJo1LBs9bq+qSU5bFXh8UQlx8B/nFTwkWh3+tMct3sx95pmpsPmPMXww==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.1627d5fe.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcW/vXCRA9TVsSAnZWagAArJUQAIBwDP3VRJ3ons4fBUGn\n3MoyujVqz16Jx7a1gWnoQRVZdOB/xixIK6VI8BMw6t+7tmUJfqIAQajn8z9h\nrVaTEolXjJc6XOrusjp/xb3NjX3hfGY3USpTc6AkYisE4rJ/UnP/+n93Gp4M\nLDl0bR9DVqrWpLL/tUreHcpBwCRMfciFlpa2lv3dIgX7KpTvIhMN/JX76FMq\nIP9CgLpAHMCAd/ilzp3RyLTUSWJC26WZYUPMQXmqRU77p/IjJdYWk6HwcZfI\nxvOteEfDVbRBJB4QAiOu/X+O9meHlUnRfyIieKSiteDHnPi3nXPwAMN8sRye\nZsluWWQ4vmTm6b1WzxyGTQq2yZ3r/phS+6U92Wa/jnhL1yuj0blUe3ElkH4L\n4Xh0sLIAeJwm3WT5GtlEl/378X9bec0rJM6aOIakJSx8J9ZDyNUMumdkW0ur\naIiUD+oOGHDG2gnCz3rNqko3rDHWDorjBtzG660CuIcyh2wWza6TAjZqTGrN\nhj/u4hbOj98TcqExBQgcypfTMNOp8gi4UEJA3amNOtH/iQli9x+LL4dYTp5H\n5vlaxJ+Qjazt93pKfbEmgvJ4zbgvhEhrQS8CXHLPXtzUlGTc9INbHYoJ1IUZ\nKzJhXj/81Q7sKNEGkUDyHtrHr0vVCKHxiLHmsRXVdvU/We8u1FaqGnK1MKUD\n7tu0\r\n=TB6s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAi40kTeQa8uk/tpg9VhienELBet2a5rfBWxS0b+vK7XAiEA9VIeyqLE2FJqyoR3YGNJCqykoTiC9aFzaXOoWxyyfOM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.1627d5fe_1549532119075_0.9900993303320043"},"_hasShrinkwrap":false},"0.17.0-alpha.392ed723":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.392ed723","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.392ed723","dist":{"shasum":"823b0958573c50c6016e40ccbef5b93d433712b1","integrity":"sha512-FNI1uAPywt1BTd/y3ITwaCr5FRNMnpTJshn3MIW9lVAj7WKZMK8PqCrU2P+tPwLg9WikE+cbkOtBjsfPBCY20g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.392ed723.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcW/yWCRA9TVsSAnZWagAAuRQQAIV1JKbAUkHrvFMqLUVd\nCFsI6wAf+WLiqbtc6DG0RMN4nwTOwnvvotN+vsR+xFlR79TtumcACB6HVL5i\nWfhW6gYfbFjSPJ/jwQa0XKb5EY/ER0/M34a/kc08NZHPNo1vVMDLNJuHBbDu\n3Jz4fs5BpUru/w0rM4nltfCslAFZ4dF1MEeLbAVuez8rYfz3JfnRnZqCtWpj\nN/vIa+mJkZZYUFtNvwclGXqG1So3ZNRlO5u+pIWJc2qr9HlCJ+SgD8afAS5+\noy5U5wB2xxuOOzf8HtQNe2VdC5jAczaFcVmXoyBtM9Z0Zw84qopKXPdX1v6O\no1J6ViOPDIYvuWrCbfwGkHXHaLbBqEybm1+Xe92Mn1M2f46zXTVbOB/4bhRD\n2oQTbZGj6qfULMi6qFYJuJkqSFAwzwNQ0jYzEMCVo7lglO4/+JfSWNjjv3kq\nZzkNDXDGRKC/pWWck8BfF0YsxmZQuhYXCC+mhnTMp/UuQWOhuy5+AFa8oTO3\ndkPWEHdlOjYMRG37tYnZUf3zK7X1u6H7VUB23bIvY4y9c0KYXMSmPJxOwl7e\nu14UoJ1EWBmoENEzmcz8DxZh4Jr6901TAWPJLAJ2RQsad66xQFFskPIWOxBk\nh5jHFjjSUN6eLs8tR88r7Dg2+B1CpsWDZbrwHHJjUDyh74K1aZsvFgBuh7v5\nhppT\r\n=j2/N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDfAorXBNBi0po3CDgfJ/wJsZ2kuTsRya3tuWF7R2VVXAiEAzM4bDVcWpRRfI0WHHqA48B/nEoHojrKdMmCdyji9XFM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.392ed723_1549532309682_0.7881547479934667"},"_hasShrinkwrap":false},"0.17.0-alpha.58e6d844":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.58e6d844","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.58e6d844","dist":{"shasum":"70226d8a823c1246df5cc8f73312f88943a444f4","integrity":"sha512-errYpjhu25seat8Fmcoxgbuf7nbnTIoJPaJhUS5kqJMhYHUNUzu67np4KZZGJFDo74upztK2VYVLmOytpYLa6A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.58e6d844.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXIo2CRA9TVsSAnZWagAATrkQAICSbl+/FX2UJ5xJVfLz\nkyzBgzTDp9dVv+5oS2S0ZOj2czzMEivZ+38zeYgC35GOW2bJJhamwq0oF6Il\ntvmmGTayRlp6e51O/rl+MXAQBmNwF81tBOQjVNUAS4anluekDH1RSJVzLpE2\nFqb4Um4MfjCPwO48Y8zzl5EP4HUweG/L43VKQWBX0j1z0eKfocC8Q8ikH4+D\nrE3Xuw52WbhjeO5ovzES/IfCmsg1PgGkiFyHhnRwFOzuyzY8GfORANnvQoPR\nHtb8fgOIbUedcFnlgqsGvErppkFj/s8BIeyl5tDdpuBc3E8pXgX4UDuv/DbI\nui1714+fxf4UsLC6VfWciz4LO0TEGWOeGqBrzK2gmCslO8wezl1QMvbVbl4v\nHHmAOJ4Js/AwT7lbSjSurZGznN0jMJYTSOd/Tf1YGTpJPXp1aybKIHSvP9ON\nGS01QbIjJXJSpM1CHr5aU+yEIEnpI2yDtg6rxAW4ygkp9lDK3SDCYEANjd9p\n8OtTQ0k/UFR8I6VMPNfrjtij2DjISfrSJ2NMAQndrry+kEEcRA+zdRTzECcp\n00jvbpo5fKojXHR3OSgGZfr0OM+OS1/I9SZAvW3Vz+yL534oUNItPd3AqbD1\nxOEXV8LC3ZTYdlQ+PXK694Nlbm1mf+G9T71SE+r9BMp6zY+gqlprMxtKXOEN\nhh4I\r\n=Ya1B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDYN9Gu7CFuwKrW9GJny4w1eI8+HA+YQ/B1M2HhXxrfaAiA7FT+gitqHh/P25PCOuKRBmGrKiaFRWVRnPUU3muueQg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.58e6d844_1549568565058_0.8624917076791523"},"_hasShrinkwrap":false},"0.17.0-alpha.7f472189":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.7f472189","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.7f472189","dist":{"shasum":"ff2313ead4616c4527b62e8112c113f0c89e2414","integrity":"sha512-YPrdQYZNw8r56VABxt7IP9xiYLYdjmLTPVoaa2cGpXWLbHvV8RvJqqDj3v6Q1Dg9jpROTlsDnvZYnd2ICp9YPQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.7f472189.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXK0mCRA9TVsSAnZWagAAATYP/AlOFC3gc/z4Vz2ycH8p\n4SbujKmV2Qo74dfdj+zJycylFlkIgTBWAEtwX14+f3CnaLd3Bdx+47bqyMRX\nI4B7SwZDU7NTWVvJnNmfP3WvEQHp4uW0vG9iBtPhfDuZkmPo1FewehQE0tAU\nJJUV8twkzgeO1AqOIyetWuHY1umn8GhTOkYq4pUOx24qBrzNMGEdkXSrNkJQ\nxhhw78Tnn6zgoegS5qbePWT8fOjU3AkpAO0bgs3PdftzNpTT9dYZ0qU52opk\n1BpO1md11e5zM5BG7to/WuXroB9+3Lb5k/1UnnzZOruJsWbgtQz2QMm0Saj2\n7ZrmfO8B8/HnxrS+faoprd1GxRQE4z18GVuEZEjEHtknMD+LvWuTHp/QISgT\ne2kYOaZPJKxZh/IGIF2Z2BxHFgssAmeVAA202qrKuCRNqwdArgQNLkGXsFDk\n/ttd2vuA9KZ/fuXOK5/gTbhoSEJf6n5aZ5bvCTKvNSSQVyb6wU3nztmXIwLq\nFsaHU5VjbBrT+TUI7KLDSQTf/lCHcKJTImQlnrKyeXY0ZjXToSSyYWjp1n/k\nfQa71hE59dDnwL7O84J/1RiBR4mqjyDtf4zH9Brpq/CuPKe/PDZdBkRLlsaY\nfd0WAJH721X7QLMWWEgtmIv294ZLxj2d0vEV1rmNFIsJuN69azaVhkjPyuul\nhvJx\r\n=0qIj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH+Feux2O5i7juOIE25MmOFmUboF5CyH2GqyE1LAJtyJAiAycEaDjc31OwVhhenpvSvoc0dAOouC4rJtEZ7dPwB2pg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.7f472189_1549577510256_0.552668983258132"},"_hasShrinkwrap":false},"0.17.0-alpha.bba57f12":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.bba57f12","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.bba57f12","dist":{"shasum":"a000f80d3093ab7dc39038ec896213bfdfe04ef7","integrity":"sha512-ZVNcID/o6W/CJVKbZw7jUkXHyWwlo++hu3+2wxySfnkPX7l+3jTf28GWMKCKxG6hZeTpkfizvFoem8Ck9t2Gzg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.bba57f12.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXM+lCRA9TVsSAnZWagAA9isP/2wmTLH/ZclpyCpRLacW\n8E8P3UyTHKmBVlMiFIc+RJFbx7mdtMqgF8dYQkon9RMj4ponDABkVhnnF+cO\ncdOwQ1BInnXg7YZZ8dLT7D28dCpobfc5DWgEpMxDCtCNzi+tHWXMN7k60bM6\ncCEOklKMTLehwNBqEJJR9+lr32RvzncnxHNiC3j6pz9tmMnVW21lYt55VPVb\n2+Bw7a2uaECoFQU4b1k/mpMojbTIX67AkFr5ODQnULNmTaHqNOtu59EUBIgd\npBLQbtn88OEwt99aSpSFQ6UQ0/Sb1QtehQkNGINiQesk7jAompZWWANvctzn\nYUoftaHnITe2TZNwIlOA64f2yk/BP6Ah5sFOkiisgP3xHFb6qZ5y5ddTItx/\nAYUemNCcFt6hdCPGhumQWCbw0eiTSF5N9LgkmVXISZz0Na3g8Fmw6Knp+EG9\nyBbzly3yXpo5BJNOJx8do3YGap8vJaa8ijpgwXyNk4hGt1AjL/OedD/4JVVy\nMsJnR2I++juyHnf1Iph+HuiIgcFHhdQ4zthar1P3HzKU1AZ+MU1CPScqqe0s\n6uWm9Ii3M+0TGFPsvf+pxw7fI4Hvtlz1PrVGetCBn4WTjhtHSSG6oMmfiY+f\nSN8KZ/B1mx+NEp6xDKsp5BCH2Wi08b8uknmaIwhzsw26YOTcFLNdP07N8Y1P\n16x+\r\n=9eB9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDC8v6TasTiol0FKV5Lk2pk7np9j7ngIx4OPPNljDn0wIhAPyqs5nx5xMMzOahSPnPgU6tENyRMM9Sq3HQYvLq0IPG"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.bba57f12_1549586340961_0.8344721084137663"},"_hasShrinkwrap":false},"0.17.0-alpha.1c13b8a6":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.1c13b8a6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.1c13b8a6","dist":{"shasum":"69c96af7e327f17da0d66cbea9f24711abd3b102","integrity":"sha512-6aVaWwSph6moJAwvtu0amMD70O/W1TH/ZmHloyXx2GoatjhTAWuRbCpLIz5nkB3ac7ePMjUjalJmT2hvOhuQFw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.1c13b8a6.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXOnzCRA9TVsSAnZWagAAGggQAJSsZM5mymhZx6e4ePRI\nDAbgk/aSt3AEM0E/1O86mD/pGv/tOXQ5454NU7nE8LBMS3CRcSaqAWc6P4X/\ngFe8dVN4YOZzFtHEgQv0fe/LdT0HdCeo0iEP5M9ZoiIFe+OKdZ3c972RaLMZ\nPfFQeTAqzBCcu4z2QovU8Ektz5Y2lEedT6wy7HE4KEVLX7xMdm4pYa1AjV1q\nHdJjbBnd7g2kZvEHugkScLdoSSJeQMS3Z+sUN7f+a1eXhMUl0/YOFW5MLwQ/\nf0XyHYaQtoEvxtF7SKgf2NGtER/OIUzIuJ0ozuevo0v09Aq2RQ1Spm0F2o0h\nnR8io1kgh2vkubI8L+kiXI3fkhV8ATMQY9E1JKkK/m6KRfC5CgbsqHzo3wEx\nrDTUOZWiWtJZZFHIYNCPCqfd0cK6pJJnwo52A9Pr2/bhQRy5pAob5Lvkw4bu\nipKwxWFeoioHnexSMFcAofD4BZWM7Tjid9+PUJyXqQVlXLeWPgelYTUqJDkW\nfZ+WYHrtveXDI6SSdLTp+9GzsVJCGyOQCEQGbSBdU0WOpp+d62hfiuXXq7kM\nsGvwxcxmPQmYePYy9WzS76wmVI6mQKs+2ryfH44fs5dzelsfg+ZrQ0RrMp67\nFlIv7fScEUDswhWFbwYvsn1YH+g71v/gaqHVVe17DfUu8qQLfwVm+ozmdCEp\n2grE\r\n=XC4z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDH2jlRMkV/l32HOAC/rrs02OxOZwy41KdmidbxalVyHAIgaGb94l3iuvUkMXyzNP6CWTGMuXnDO7xbEEJfoEOlgNE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.1c13b8a6_1549593074529_0.2856785643871933"},"_hasShrinkwrap":false},"0.17.0-alpha.dcc1d8ae":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.dcc1d8ae","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.dcc1d8ae","dist":{"shasum":"59b729961682bec8d3a8c7ab93d0d4a87361f952","integrity":"sha512-GRjU0gwyVyQdfrgUErw8piYCjU8ytmf7Jua+ifNLiH7S/sFzOpzMwi1CCmyyEpH0Y7UEPe2BC8Q7o9NVWfWtBA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.dcc1d8ae.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXfS9CRA9TVsSAnZWagAAyQQQAISxHKfR2Dv24CzHnWZE\nvLmjL+hvoxL3jDw1IBNP+6bJHIFoxyPENnwPz6wYeVuNpFzAnXDLVtdyhXcR\nHfdoGmyJyOgQvhxt9FU2a10ex/4xjpHCMrCFCcTO9WrtRqTzvCEHvhlwUPao\nOOlMsExe5WrJtGSADZn4Ib1JhfFGuxKyNIbZ646thyJxHqQsk8T/yNbnGUW0\n15PndDZc1Er6T9nXoZiWBHf3f59fEEKtqo15w6OQ/nSRvrETKPD1XpXuAPWk\nrZkHpioeKmkp9on8EcJNIlgncCMK4qrhc3qJIyRHEpIYgCuM+P0CqYtGicc2\nHy6aSKkZeoPXghq7r7kohmyoH6XlyIOZJ5PezN6KwAqz1fOASq42foMNhEai\n5WtrA1VbXayVCzLSZ3yq8owJd7jZRibj/hlBQxFskd4SvCN1iqL2sZeLhkfR\n1by3ydX1mw2B8vBKboSCrgG3kBZhkD00eO0dZ7WrLhasMyQHUCND8Q25hc0n\nmWcUeDJxM+/7pY1Hs64K+fXcex1Qjy21DGnzhd7JV2rgmf+Z/ng8zUGmuMFU\nSlXj0DCnZ3JUReYFysFw6JSzJZZ2mYGrUbyebJAKBv+YeWJ5Mp85uCZRPAPF\nff/aqJAexZABI/D8Q8i3zkivTkXPMaY2kyeOJ9Imrz1vGMjpnpcVo3Ljt9FU\n5NE6\r\n=WB52\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYYpViaX7Y62cGvZc8FzS45lPntUwNV0vpGQcYXcTQDgIgeFdiWbBct0byVoR79s3knqF078izDbdNNakZqED9VQI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.dcc1d8ae_1549661372863_0.7953539400103058"},"_hasShrinkwrap":false},"0.17.0-alpha.6872ab68":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.6872ab68","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.6872ab68","dist":{"shasum":"03b43c04f3ffd05ff2445d6233126041ce7c102a","integrity":"sha512-MzpSzueCywyOgceuUcHY2PMPQYn0KRtns7/ytTT2/hj9/TZCi4HWEg1szN5r8r9s56KJiiYY5hgepjzwFUUMlA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.6872ab68.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXfTLCRA9TVsSAnZWagAAH24P/Rskd6IzXkDoZ/1bGpYV\n+J+Je75MCsNEhKXaGVn7xv6g9shxtnGtXN7CYLfSkrTZYVLGFoQkt5X/Y8gj\nJAg8akPZFJTmJmp0v1Sk+/lQBhuxjwBO1eIiJRIQZKVti0xgJJ3GD71Xc6Ni\nBo7bBrXX/ljDsLZ78GvowfQD9UI6OkdA77MfmQlQGVTdJPSH9Z5AfELtWK54\neL7sC36iPab89Pkfltx2ZmyVRaRkT3k4thsv0LL/+utqvaeEnNdHL88F1JPx\nX08RhY/YgwJ59Fm2Wx6ofd9D++7oCuhsnIkN/jcO8ns/8Fo/OyflWTt+pH4P\nyG97qQ1pNjJEaybbpAQooRoxHooIVyXJe6PBP1mHVDyioIS8/nSpFUaXF6Wb\nML8rk2o7JI/vLvyFwh9BiWEY4HG14dbTPB9lVl9Fj54neLZkHJcprp9lox2h\nF23+48aJoES7eM4sylz0jLiLsxNZ8ssLy3k+8HmD6I5XlZDGHMAkzpWC1A3w\nLghETU9rsMZfgmjJ+P5fvfE7d5XnLainQ0eK5MaGQAKskg4EuZaE8Lct8z+c\nFA40bCVLo8e88eJOLMBE5rCJrUkgAj1fsrXhhNbffllAG9tbd3SyDH2GqLg6\nA5u3nm8EEDOIp3OaTZdegExmAj4OHOEEXk/xPR6CABii0lB5xQN0fq2DLqfr\nGBDz\r\n=pvSW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAmcDNzAQZ9aeAq9xFgpYEywYqs4RcE62xIPOCbiGDfiAiBhQSn7SDgeY489Nj3NGCjm9IQ8ENuDi5A2mlJ8qGNN3Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.6872ab68_1549661386303_0.400579216120557"},"_hasShrinkwrap":false},"0.17.0-alpha.79293e3b":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.79293e3b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.79293e3b","dist":{"shasum":"0895dd1ebdb005febc587a5d83414d7d13f9b05a","integrity":"sha512-GwKx3hJDDpR8LtySn01M9wBUnZyv2e5jXajVrw/E7TIo9hPniLQ7wAWVrNKqqy1jvaD0bxfN1JEsU3h/DggH4A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.79293e3b.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXgMFCRA9TVsSAnZWagAAOMgQAJ1RAkEWK9Nqk5WU4ChU\no0/+yL9sxTpVOF2CA6X3uC8uxJFuKrCSLCcbdji5yBw3FDI1UZMZ3xHjm+6E\nubQjFz3rfbpMmVTKYE9GzwJwwj9KifpaPaYAsVif/AjLP0DZWDTGIEgR7OhB\n7yRLmmqBQjAe1fkNifXXZBQbVtMwZMuM6i8Zn6drwgc7CZLI3/iRyfKW4Pd6\n12DgGByk0opeWU55MHo00ROSMsobeqiRxL1ljEcm82D6fxW81u41mFnfj5OU\nEOzkosTJWgPq/QnurInFXBv+bVSyfle80YF/qAIAwhzGLk9seTdgVOZQt083\nm+yGzdX9Ogk52kC7s7f+of92HS+v/RWsjpIToqEzCRWR44DVmj0MVoyn8NXS\nH4Rj/RSwMh5dIA17vciOuZIRJop6NnpD/W12aFSqjeFTVlmJNwS19sjtfJ4X\nr47GMFwhWWN8+0gBg6OkcvhSNbCa113ep2WBqWGmFsrBKAqntz5wkOoSA8Fq\nv/ehO17agNdi0UO1VtWjQIov8z4Kf1FDAS04br8+UQH3ouWrFPxkIaT/A4lb\nqztAxyceEZnfCY5v0uujznFZwbxyuOnFv+d75VFSmjtYT6ySbwB+mxUdyWCY\nSJsIAfZxl22GF/ai+U/Jceu76dlsMe4Z/HUd+mzMTpst3scFXYI3EPlPS8gi\nxLj/\r\n=kRa5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE/EJqqaitaXukvNEOZGDk56Cw8XD1nSsIfcAJiXzUWPAiEAlXwKzIJ6OMLlXwdrZYgVY3g5ybh3E4w31N7jwqTqYCE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.79293e3b_1549665028969_0.36937343611315665"},"_hasShrinkwrap":false},"0.17.0-alpha.656e9f36":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.656e9f36","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.656e9f36","dist":{"shasum":"1969d13af54a4b7f2b424abe2dff3d7fd91dead7","integrity":"sha512-/LbrzjXSXax8kF1FaB0EsHMcvjU+jjZj2oxM9DDl6GIhFXBIx4ff8313T/lZeQaCc/srca9EB7UBNylkjYBDFg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.656e9f36.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcYe6sCRA9TVsSAnZWagAAB5UQAJBuJ3Tkga2oQO5MYF4R\nAgD8omU9QrUh1lHvt1vNTys09d8Lro2nCvmmXpOgvphxWp/2GGzdetig3RNu\nLpTbzS3nutnu+gGZ1ZOrT1vMKt4KFaFdbC3b8hkzdCbgeXUwoDHSydxjVfue\ntzXwYQ0iNUu5IflZJTDwbQ4kMBl6xyVYlLVJd9yxfZwecvBRLwV5srKF0Cqj\niAgd0Ya0XL2hIs06fosFJSVcIXhgf8/E+t7D48MCGSuiKVLq/vSuc6BzYxbI\nLZzPPk21bkdjOrBEcge9LZI6Z49lYdLi8ApyKew+WnzDpzFGs9ozNfM/jepb\nArHCGdsiTtDp0bXBUmtZ+VFJYaB6pJOhaLQNYnTasHWrKTF6gTh7eqCDCZO5\nO0i+zM20b1Qlg0S5AEZ2r5hBnQ/qd12NKTu6NauN+jRFD5d7l2zjNsZhJRbC\nHdRdiEhDCI7uPDMC1lJYKNhMB80F4QLM9v0/ZQvcS3+VBK0fEFX9O3vfYYsd\n2mB0ZbOx1quseAb0PqR/WFZqr55NlyvsZrjyY5Y20VTpJPeUV3lW5+bMXag3\nuD2gKy1JsxOlR1TyvPmjs9fqz3PXf9UHoFGfMWfKxWT+RX3AkEeLw15naEAi\ncjIFJGm6pFakMWs3psEZLzyD8GlV6euaMlZgjRnT2oeddgU/X0mK59ZZ+15x\nq+nh\r\n=bzRR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG/2TMcUHwzRYoGcFH0DzHjU0tx0d+adriCO39d/wFk2AiEAmAKypNUYfyr3D6nXBkHA3O2Ed0DGIriigwlYm1Tz34U="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.656e9f36_1549921963557_0.6664928519960323"},"_hasShrinkwrap":false},"0.17.0-alpha.9a717930":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.9a717930","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.9a717930","dist":{"shasum":"2353d99bb589076a8f5d9b05e6bd5a17182c5a8f","integrity":"sha512-flmLQOXzro3QIjSeY6HIjcSOifu+ZSza3DzQBQmRJczsD+i+gGMds8TCzZIsiUBtsHhZV3excA85D9GmXxN+4w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.9a717930.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcYgUACRA9TVsSAnZWagAAGIAP/AsSYa/klAZNtMA+3hiJ\n/3fQt5JSEmYrsvI6nTv3hlrB6FgZFOjl821iN8EoOUGNRPLhk+feX9m1dfPw\nsVldX+g0l5o7bWy4MP4YB68u1L7kGhaorp+3QfH8xV07PuEtb+wrOg4fD9NV\n0Jg8APf6qk9iYBw9ZzJ7OLS39Rtd/HUDWYgMjieS3Fer2VYoApH4KHKk3bMV\nQlWr3j0OEqIMqqVew/X4i8bG5U5BnxmKHkMaeZdg0bMha+NOXW6fkNi/IBeR\ngp4dDum+e0sbHT0IiPfvyKTPgPESg64xAxitdWBYH6E94sSDwxjsSMHVKTT9\n3DzxB2txBZ/zz2FqAJQT7BLJGDAjH0OPWfzra2CPOYukucML4hiw7939VRIk\nSYAlMPYLUqrItRfT0bIzn1QLK3lg35H/WPhInJjuceBMNpvvJolsoT+7BgVo\nnMYmm0PzsYvosra/9G/NypSddDWLR6c54/MNXsgSM1Qy9nJJNa1OIq65dpwx\nGhwMD/hNXDvczIAP790kkiaVmELbkgpQRMxOkB6Px5nOrKxqxcicXi0alrFb\nDRmRnJBc0flNE4wb4K6A9Jyd9h6rJzw8vuLAyB+zH0zqdkwE9FvcT2ZP+esh\njvaYF0/UxfoIvojWWoUg3JZqHdlFTqFGJimSqaN43xczVw2Fw80OBKtA1nN2\nEQ2C\r\n=vluy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdPmnriSNZRCRwpauUz+3SlXbKkaccHHV3rZefkRG0aAIgGRp7h9zsGxQGUJUWBynHf6d7Ui13QwtFCD1f5hPhhjM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.9a717930_1549927679432_0.0464405813965012"},"_hasShrinkwrap":false},"0.17.0-alpha.c4aee352":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.c4aee352","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.c4aee352","dist":{"shasum":"d6c4325a13587507f10e54c4654244fd57ac80a1","integrity":"sha512-G0MrpOgpoMKQRrVZy8W5epyfICV0h+ARbAH0XrZBrs9c9yN7+ydJlxhblze07pFuX4qxhvLeb5i7VI5uK/STWQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.c4aee352.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcYhp7CRA9TVsSAnZWagAAqmYQAKMkzKG/AI2c+ooQgIqq\nCpl57nY8sNd4wi7WLEsksPeWNlBzxFwBsst3OgfV/Xg0g54NftPg9Vi3Nt4u\nb9FghNc68j5VG9LgxF47fJhFXQz0Ey9lTaQ9TCj2H/S0r+u8+Jz9I700qz+1\n4oHauNG/mem9yDn5ui21w0SxXPp3IARxTTxzzZojWvS8I59J8lxagPhVLRyK\nVi5Q5WyHaQz93z9NsVtls8D5fr8+0pP4LQYzST/e/m0TYVImx7ECGfr7GQ3w\nGBBZ0PzvRKB1Oea3BIfhDE3FexpCP/BrpwQF4APcnTSAueWvGix9qRIIjZbA\nwuEG9HXUc1domeX4LL0yT17micstvCCJoBcmvF39+zrOd1HWNtpQTfsc93Ve\ndl5TnSvyDMWvUkWDIKZuPGbxykXBWtA0lEh+OUYhC/PEcPmtu1qjMWHkzr4y\n6riLfmLsDYDvu9BRdI3tZe+7youuZkUmq0DorL4LJ/u5H5tXKZtf+Eoj67Vk\naZ8nVRgiRHTs0K9ogzPwm9A/rIKTjbrA/SZYTaFCU0vkByGHIYaIJms+GRD1\nn0SnHyQaZ9UQUzw/+iA37kPwcqU0dOPWS1SovA5syUVhmftHReU0em3ZxJsC\nBfI4wTubo3v4CzZmxtbz8CLg6dwvinlOfaAQ9Es0VrzHKWc0JmagZnm4SOku\nwei6\r\n=FvZG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICNUTivb/m3w+OToqG9liNWrOTXgMbPV3jO6/f1uyqSiAiB7wVBfdem5DlQ8Q/qG/AxTa4FL3SA8ZTyLyTMiyiB9ag=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.c4aee352_1549933178013_0.9378413298097035"},"_hasShrinkwrap":false},"0.17.0-alpha.92a33a48":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.92a33a48","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.92a33a48","dist":{"shasum":"f1dd0377c8023b9f75f42bdf278a25bcab5b2b91","integrity":"sha512-zdMSlMvJtwYxFJxWZGyLa5evnztTIdSmfpgw/Rzq57pNmYwkCQ4oL9ZVUwMuxFLrqhd1DWx3wHi2svrX9Mtz+A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.92a33a48.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcYpU7CRA9TVsSAnZWagAA8XEP+QBXIg0ED6LvbL3ziZlr\nRTSeZYS55SJRx6U+kf5CApvdi0N+22GVMr/SNMigxFUgJZJ+FZ+YuNKg3Cbr\nEEXSCsRWoiJ+RWc3XlaKVaIKnRWRq8XaNVvW3Tcm6cN2R6bKQ23bN3RcaTaD\nPu4godOZMJ1vd93aoZXZOht1NtxJ/2Okdxz/+BDPbBntfQ/LPqagBQF65NLO\nWKrZlUAn7VD4JXV422JHfOf2YwYEBti+Hw05dbL8IVAUTiseOhbcQctoxMvk\ns8reS3QaLqO6+SvhaFbqPliv6J61/aFCY47JgIRVFDy4LVToYbcx7uY6n9Q5\nxv6TYEnPAUdZOPk/bnHa0iLzFWKhL+RUXjJwsTzao9CPJ0wiocIWasEM66V1\nWv7oMxxENfExw/cNSKgC1rPt0FeEor2F0HppsLyjQ4bdRzFB/GyKdlyI5hDG\nmAhZAGGD7+/ZVMgnD8X0DHkX4UvLX+sPF5gV1IMXc+ubn85tMNT2c38V6IJv\ngz/p/DdYOFuI0s3DK1+G/zc+OMNqFNMOhruwQgT1RfIsXQbrqk1s1tgm22bT\n/VYAVqEoEHrHIDiyKhje872f3+fGC1O7IX1ewvS3zp+DA2VPYYodNUj4zPIL\nAPS7RQVXLLK3sSjFZh7cfRJhTJRLUQ9NANm7tB9hHhPBU0KFprUF2CwH4AI+\nVUbp\r\n=ISGL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKQDBnGy3S1b5vnRfQJKifohVWpbzuCQ3e+KYjFO7LBQIhANg7EVO53dKrDTXvmMaJRsuxzeZDIQGEDAp2EaCbblLt"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.92a33a48_1549964602634_0.1309855408841336"},"_hasShrinkwrap":false},"0.17.0-alpha.59a9ef69":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.59a9ef69","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.59a9ef69","dist":{"shasum":"969edb4bd93dbad782b373e072a9293d1195e154","integrity":"sha512-2wDcjlqEaLzzAMUfu6lL7xSckqzwOHeBEitwpViUs6SDIYngqxLgcquDxgrOzYsbSkj3PJqslvM4ey7VkbXb5Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.59a9ef69.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcYy88CRA9TVsSAnZWagAAcSIP/RY47VlXM4q0T1BdfCx4\nbX2GCYttK2IgKEbuB2I3LxhbMEf1cxhTWpBkR9es+26tiV3H0mW+MMDZ5EYr\n9zRAOqnrC9P3uRAYjhXZdac+fksdRYNc0fwe7+DrEnzS4o4+ACgWBDZYHgR1\ncJr6EFP/q19MKeGBy/2gVX8vTIAh9Sx706EIVsAtESva6BVuF/8mX/8h2yfo\nY03K8OazM792vdXrqg6ShRZMf9jEovK5ju/wS4M8cdfeu8QmpB+xNyGEIetQ\nc9RX+FwsXbvgDbvK/90ldTBWqCrwz5FO6OwBc2ycQK6S/9b9+mik2qiRgBHj\n6HDG13P1anw8KcPd79GzMWCFcYessIt3F3u5GYHwLZfkBHcvc/GalihRnJHM\nNz8oEpNOPmzMa2rHm2v2aJEyZ4/5agu0tSdDfSNUh/sLeWq7d/U1F5i9gf6r\nrfqShrNo3ZbGyP0XAx0X7AWQdcmSwGF0OHYDKJ4TQNraLYghrjJCvQNk/5WG\neZ0PW+r74zHaRHra+xbQpzVI2qL78XTBvqrjN3CkUr77dX3DERGabBQQ3Ux2\ngMSWYUqRvi4I9WD0QUkHawTQ3p0TancoFLw2BbwE698Dp8g5+WNB4A9lmXfL\nO3SEQB+jOsUYhm7YhfFfInMZO1KKw/Gk3lkTv99TijQgmiGJmVAprUkXRvsc\n7bA4\r\n=ge01\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWd+sF8mO+4LFw4RoxrsfdS5ABjWyLoHK6QKd4Sm0B7QIgQI+PIgmVMDckwobutJY/TZyJbLaHrPBCYnzcoLqhU1M="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.59a9ef69_1550004028001_0.8488849773290645"},"_hasShrinkwrap":false},"0.17.0-alpha.ea33f85c":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.ea33f85c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.ea33f85c","dist":{"shasum":"c0a04422f76dbf576d2ad5f4d033ef1bcfac5d54","integrity":"sha512-1AFjLkdzi6DXQ/sq9SIxN7/D3w/G7h0pGm9KfXmQuCoRv9oUxq+bv1i6QvEeu/zioxVksDUqrxQIPSIDpm2sug==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.ea33f85c.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcY1GqCRA9TVsSAnZWagAAaOMP/1OqikBqnc0g9H7DBD/w\nTfUzGqTL2Eti4QnZNZURbCv4y4q0R34WtOcOb/78TdA0DoIwkuGm3D7OjELs\nlJtmyFa1syP+7SadI0TiFZjp9A4dpmJODoV1ZYKpMne9CXv//MviUU717pug\nZfhTz2QgQde/1AbXnuSJ9YTxlgKEcKOQb2bdJZfeyh1ET2KakLIMfCCPOu7x\ntOPNao1eiH2KJE9UE/4sbGf44uO5AUpH452saguFErwV7gZ+nGfdZcNOZVhx\nH/xk1mJijpx1V2Ne6lb2uSKS+GG6Y3cZO5wUv3BWw7m7C9ZO6+7CXN3GRItg\nl278L2vkSYB74md7jq/YQcYOpNkHy8zAK62puWvsLL35FdkSEiKEo2bL+cg0\nF+aUbqkFNqGsvMZRtzMy7v+A7hl/0wjPrmQI7rSCyyUO1E4iYcR+0Nqo0hov\nR0751Rs+wRxU63p889GWPLPsdx8ILVSq0NNStC1EwFaTIOd8+Frn7paQyeb4\ne+bLnGFVZHhT848VHi3/FgLPRVoUPz0viaNJYfFn0+4IKVFmwRlk1e/T9XWp\nDKcLGzJARkvgREWOPXvwoQkS3Jj9uIIYXyFglCwWAi8GHDYNvt8RpzQpokpO\nJBUTVHf5ur5qdI3nR9LTf9dxrV/PxFSTcLMR+CmQUwvIvz17k2RvbgBoGy61\nLQAW\r\n=zEmC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQe9yssq7ugHZ9DXm9fVkDIY7VmSQSj1g8XOpNn6Aj0AIhALIUTHOWDgt90F1Bl+hepE+YW9tDnpiY/wbBZlxmEWQm"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.ea33f85c_1550012841266_0.06397760344830439"},"_hasShrinkwrap":false},"0.17.0-alpha.28da6f01":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.28da6f01","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.28da6f01","dist":{"shasum":"eeb448c75b01e207d3d0ca915c3578c9ca550e27","integrity":"sha512-Lu4emtvWFg8i02rv1yFW4lamaKudZ3P2h105T3RLq1SO3f3rKx/RfQLrZsDOaLZqUzy/wYSOiO9ZzTlK2j/31g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.28da6f01.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcY1/QCRA9TVsSAnZWagAAqkMP/3fmnnae2YvNyMR4elWM\nrKp9pMs4ja+xxeu0gecEy08I2LpiYRcraEzGwZahwbNzw7fhlG/qxVb39eEq\n68eOU+8lAsxDoY/744NElOrCIN0tOZw7cWhXu7s4jJR0pCfW9pHbFK89jsCs\nJ0nYhME/PXZWLZlDyxSI7GXnFXIFy9dk2qnOO6jtoIP5dI370S6f4EQVuHQM\nvoRRWFDLkQRA+VA9eqdiMhPqe1Uplyh8wFoMBIVmo89kygjqKUZMzhWG16EF\n25rR8BseVgV9PUYyZj60mtwN1+iQC8QWdLguXvnRfuyA8KZcEMSDqATcyQ7B\nY8Ju85ngGtokjFrc+ho8+Aix9jkOEjH6Zh+tVWPrFQOw9LFIgjicmUBOx68y\nBbtGcNVMvFOqYasvFkoFrx/rZ4MisAWl2QI4S+R87I4yf++4Ha6ofKmb/NqW\nH3M9nnBrri21KxAis82dM1Wu47Y1S4Cpj8PsRoF0hxzrewX2gMyOPbyk3OOf\nxMn3cMfmQEWeu4AGaa36uWVc7uIP6PSDVc6eRsvPBZEoK0Q3eCoHvAwHhy8z\nc2uTaD3WcL7Z5ta9eLrSZCEHgCksLsyxc6AkeeShof08Vozm8cesh9OFfxP5\nT3QqEyNXIaQ1KWQEAIxPVaMpLBklWv6/U3aHOd5LDbpCpEoJ6kJIlxLFcK7Q\nxpi2\r\n=0qWY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBiB9Yg8FGFTUBLccB5zhhHcN3PqIs58ErhtnCLnHoP7AiEAp+LMwpG8riECPOkTu+qOdu4wCxMSEvETOuVdw1F1zMo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.28da6f01_1550016463991_0.7024790664369813"},"_hasShrinkwrap":false},"0.17.0-alpha.0e2694e0":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.0e2694e0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.0e2694e0","dist":{"shasum":"6ad95b64f3f6be0b162db7835469a471a74b6c74","integrity":"sha512-gNwrXQipMA9stcbRfPDUUDGiY+XaKOT9G2cIvGmgvPNZEUjFN54+9PDUdTkhrTY/DetFGmiD7BpdikyKaZ08Eg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.0e2694e0.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcY5rUCRA9TVsSAnZWagAAPO4P/1hpMx6QfiJCx/gpJkBM\n8y2puVawYvic4dR4a3JmzY+keEy3r4BT+Qj1PjUkn84E4aF+kDQwb4c/m65q\nGPX8+KNFXk2ToXWsfX1c2AXcDJjddhiH5b/jd30fujRobaEJtEGgeKQ8eEOm\nsaQ7g10uJgBYXigsozRJjSxcf7b4y5yh4EPgo8gIc1/wXfJceZWt6AK2U6bQ\nWlf3XxxGDrMKlcG96iOO1clRzAC6ji5xleC1+yhdWkOFYwif8UxUWEykIgja\nWb5BN8o6THI3OJrVrWMCljQPaFEI3ZXrjU1/p6kkgvDCye9u7m6/lkbbdaMo\nrvUgX1DjxnCxuIL/3MTpxd5nhtzGipupD/+A1ddIxnD/+FkZKONyeoa4JrUT\nMowYm+vXhqVQnhzATwtdn7OKp1ZTGnVYwKPU62WBg83FZis/fDqS3vF6NhRL\n191tb/Zr8cnNVkHVX/S7aoeFQMiPNAKv35Pp7ftCLf6ad8z1zqC/IN6pD9RZ\nwZbX4DPMGiMdBXjbEROZ/EW+lUMWjUkTUKNHhihaWLZE0TGVsjZasBQlrifY\nvGP9maPujJaGbAPYzDyxr5grOC8NoKwXMES1V9pF6ExbBp0Y1GV3pFkVU7XI\nMm2RI/gdK+iFYubzhj+lTnT+NM5pbmoJsFZUtXfOpTd/x5v6KpE8Zk2v5uLF\nyghC\r\n=PYvb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDqdJDTL97Sj/DiQJLHlpnPjzf6Pc2tRElJ9o3Qh0xkwAiEAik/s6LZpZ+auNYm/nbLWUdCZJ5Mm/1jP1+RBa7X6Nxg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.0e2694e0_1550031571334_0.2122893674986166"},"_hasShrinkwrap":false},"0.17.0-alpha.aa6d9d9c":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.aa6d9d9c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.aa6d9d9c","dist":{"shasum":"5eb55c0b6e099d0ea236bf1eb99de921af0224f3","integrity":"sha512-/8b0q41jg7kqilC4oBTID04hvtyW55wbFaISe6o9D9Scj+TnHQKOY1RFshwqrAKCP+dZLaUEd0RG42mbfiqFew==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.aa6d9d9c.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZAL3CRA9TVsSAnZWagAAxLgQAJlS0sD3c8fF5xgJH5w5\nTNvtrv7J46OlYcML1PA9oAFCK/Ohjy20vM9LuNHYsKRWAqXTJfbDExCbSjnO\nGjRKiGH0yG41Otw1szpRRbKIhOWY+Tr7lllAcNylBLC0XoW82+8HhODYdNEX\ngmFg7euC6gQA2C8M1C2Z2C+PUwK2rmRHNklrWyNhSCUX0sDRPp4KpIAOGkrY\n9Z8Ai2t65sK7CnzXnl3VEx1zfjuy6SBEZCc1p1CJQGd/6kY+G7nmTXSUXZ4n\nenYNf9j5VgvMNXALPpT42id4uXmw2IF5M5JhOzXQddG+V1wfs9O/47AwPQBL\n5i7lVAyDUe/KMAhcS3GwPzqiBwqvYm214YOERskD3Bv3rQ7vRg8wd08kJoP6\nnpV4j4AnbmUGDZUSNKw0gp2RAkns9ByO54E25OZ6e6lSh8IDT7Bw92XWLehU\nmUraH/3qAtzo0noZUXwLbAwZyGMUHeD1WQEzn+3vQKWUEc2+mSGityIsRvZA\ngyXfdQ24S+BaNDnWiNKmail3FERrxqDQNjd4qnxXy/chqyzuLKMy71BE2dCC\nfHEK6j/woOrlmI1i021mqIvLMEPxq45ndj5nineTD1UsrHwY4zhNeww9OMk2\nm9n89VBppJ9Kng7ygTOgZhiSDjOx5NgurYrDnw/3w5v3GZAFjuvTIpRdEHbR\nGuei\r\n=zFcL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFB0a8RsSirLUZPWLPzXbOAWUubSxcPi54aNckzmtWIQIgYQZ6IUN4jX3Ry9vgh5CcYnuobBhqaYxOhMFFFlHcDzM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.aa6d9d9c_1550058230324_0.7362599307832609"},"_hasShrinkwrap":false},"0.17.0-alpha.f1a15d7f":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.f1a15d7f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.f1a15d7f","dist":{"shasum":"86c73561cf1331bd89dbcd60e2a41bf64eb3bf04","integrity":"sha512-bSrtoYVxrQrtNn/GpS/kR4VVgcbEVcwKJm9CzpvaJzaUrZ9v+S5ootXiCDzeCLQNReNUh1c39H6NUhQsLL2SAg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.f1a15d7f.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZA1HCRA9TVsSAnZWagAAeOoP+QCqj8/DGJxmWyS/awJH\nbMLMB9gkRCgllygOAD87O32aaRgi/Df5ZfgUS4YHxU5scwq82aA9caZebuya\nWltoFaBBq8YHlU09v020KNpfRsNZb9SwZ9PK5uK61DSvcjcz/7jqnDbV+DtX\nCLcO6Y8PYVyzP4mf8CB7gIs14IYXZdfnUusXwBAUR1eYXw7d4hidOQ/qDj+G\nOR9fzIi/z7Ekz+gg/bpqL+6XBQCntp3n4LIsc/wf9E0biWJuGeDBMUkx+U7q\nu5BY6dSg1nkZ2IlUXJniLlT4itqW8K5Z3IDJuFbDpxwIpVj260WuA0d8OEas\ncjXj1GBKpSl+G/+K1xYB3UtfC8Gixd5uNy14AeZxVTVa16u/bqztQD70gqzH\n8+pKlZwQeX3RQG87tQMQSCPI2SSDxCUIfGNsS/kzMBHTNUTxTkvNa8KLZ4u/\n/cc+pqKPmOyOje2R3H5QtGu/6bh5l/wFe8+bsezMsXtrZzkSRTqAR66tKpAG\n++bN/O7ixrtBI/VXXhldAvvfUOFasvsCa2O3tRrPtJT7oYlt0kAErKm8jiaB\nIG4sZTQcAjZ2Ne0bBDW6JK15P7Bf1IVwhGfN/B2wmOfUiBd7UqCGptkSIvgH\nNhki8sFTALpyN7fRzVu15KVyLmhbRJCn2BQf+yz3vvFZBqmYY6rwMV8l+fjw\n0t0J\r\n=otlj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBu9k53Mgpu7qHjY1+fsTLXR/LyR5Uhe7kz4NE7IbpL0AiAlhx0KcRXQBCAjHp6r1Auvtwf26WDqHoMgJyxju77WdQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.f1a15d7f_1550060871256_0.596342744692502"},"_hasShrinkwrap":false},"0.17.0-alpha.13eb57c3":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.13eb57c3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.13eb57c3","dist":{"shasum":"52767e20bce3516de845a06ba7066dbcea3117d9","integrity":"sha512-9pTn5J//MP+HsHEP/TlLt4CHap1aDiwQcanq9+LxqufAJvb9du0v4zGrCYWxXXYKeQ0d/v9GDifRV++2gG3Xlw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.13eb57c3.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZA10CRA9TVsSAnZWagAAz6oP/RpaXFPehCLimgFN2FU/\nKLjU8I7C3odrAE3x17d/KvB4yXGBc11tAWWRbJjQPyZQjcQQ6I5eTJTANe1P\nAFX9wM7fIhyM5f/zDrLv8B5FpPhdV1MUqpnOayIdrjUVf2tBmb58Rg1h28CD\nkUAeIrcApcaUi9FfWH0TK98jQG90CYhGxBcQLa0TpSuCcrJ4lUzjGL7L5MHU\nrwrCsX5VKMBurAM4dVyI+eGeB+kJZnDJfJLfQTP70cduuvEgTeUoSTaPjP1h\n+W+VdpNcsEZRhKnG+l7WNkF1RNmy7oSALDoUcmOb31Y0tX8mPQyBVkXqzz2w\nLHEIcDC2p7I8ZcvRDbYehTbaztO82WLwKTWVk6qHrx8T3WcN1EGl17+GfMup\nuHs9kCOAIbvd3KM9qbdLY4pJ4v9VqyG5K73j9+ccel3B+pEHPKy7aayL5Buu\nUf4ZDljrmHIDdZvTALGgxtoL1OxdtmuYpHxMMdJ2iAM4oYa9cvbUiWbYzr8I\n5FtQ/3l6mKw3IK2XrvN3CV/X+cZhmAJwdSXlzN6+BjVgWakBEIFVHpJLGpf6\nVVW3uZW+D41gumVOQTZVgk1UwKv39EkzeN91O1V+hijx+QcQsU5ayVAynvvD\n3wWUt4i1d4k7iy0GBoNTaFjwRP8ZsuKWS2f1H6dCkWP6BIfZTvG+7/pDbOft\nWL1m\r\n=NyAx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDnbDfmhQFNReq2TgxqeAqMuWy0PtSvOyhRevgEfhd1QIgSl12QTzkjlZfOKxdS95/XSPi7Yg9C3/lPGdVXXpJ6Cw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.13eb57c3_1550060915331_0.975029996205788"},"_hasShrinkwrap":false},"0.17.0-alpha.d8c29163":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.d8c29163","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.d8c29163","dist":{"shasum":"2e4160c1c2922fa3c4a4745e6a68ef3fddd5ec29","integrity":"sha512-RzhTo9E+wAIgqLJA0lg3flW0Ikm0cPwXHtLJEhMBiFlxJXqYJ2V/6+Ql2AmqbKhbzoKv5kRsQMVPpVYbjULfcQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.d8c29163.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZA2ECRA9TVsSAnZWagAAJlUQAIwWW0AQ8GXdz9IwrxiD\nly93dNQRU82VpW/th0mst5eoOMBImGr8KbYemxuu3feq4pKKY+t3jiWpZ4I7\nCYsN77VJCQV/jxLqTBR/f2CFeNtixGs2NcOJ8it0bcC1FMO2qZ0gooTpGRPd\nzFCB2R0yK4FwOb9v0VoEL2Rp9X813jyyF0a+jKeHByLS+KRNkm4QyPblpD5u\nLuWpS7HRwBuN6rdmUHzaMshICr/+JWeVyCOZj91wwYIctTxEnKLjv33TASVc\np9JIJmB1sOmNrpoGsoh1vyAi+wWX7gIGbhaduzJ0aSK9w2ljNOgSyV039Upo\n/4UZm9F8pU4wogqbxFi9HqzpqJ+eIbR51HaZwsu9SsBYX7lXu88tDa9KaYLe\nIJ8ZNlHGULafBSnnXo2o7gfp8JFgD5w5YV3pt0M13yzz0aBDDZH+LQ9VOlGa\nH5iY41htlzSKBKyk9thWkhssRJYucC8HaOWnj9r0i392fGWIUeOnjM7f8ant\nUgGj5sRaK/J7sXge3iTnMFH5qGfeRccunNieYne67xz21olruQZG2hSTpC/6\nbRaLcAqL7RlNZuuiAV9+RXiWkxUwT2ZQ6v+XI5KN8d6kmCOIhxxJ0kSZFoBe\nO4Ol+NrlRbWeH2TVpvHn8Y185QsXhin2X0q9XrKl0cSY9JvfJD6ANqV74RVS\nm+YO\r\n=656x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDU6WGyRKpOn5ONkMRCk/cw3QmWXGdbwB5viXWe3Reu1AiEAjMZv76SSwHDxZmJIrMlntUKe9+PuTLh3xcWglMPeU0k="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.d8c29163_1550060932242_0.6930043288622196"},"_hasShrinkwrap":false},"0.17.0-alpha.e125846e":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.e125846e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.e125846e","dist":{"shasum":"ac0e1c6624bbaf8679ef6ca4653bffbee7f5a042","integrity":"sha512-n+q+EO5wCMGfGQ/W8BvJkXuEyVpYxc6zNz+52dVEen80P9DIwqNBQw/rM7WImaf7WvjLRFRIcb71uFyAqdywTQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.e125846e.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZA2VCRA9TVsSAnZWagAAdTcP/ijepfsVEsmgmh/k0nyI\nYn2AuY9nTU6rcaKiTZwuzM+LS3sinw2Tv6KABt8/+VqYGj1eVpVqISQXgT1b\nlV9TdHVYhKjVLMeOLpOlkwf2ANJDiJ7R+OsoJ3eqDhIgTAh8OKInT1cRkPmC\nq6ZMlnWI2+DOZtF3QhGLKaQf7jEHVhxvrSNTn0Ho47R5Ghp2YL+QVj64+seS\nu/gydA5Fh+Ax/vzF1U5AMPxhGA/gSTUqIYE3dmW7cWHoSa0qDaCvxUG5gTMv\naIuHIIiIlJtgYPMNBkQyG3wL1e/LkrnWpjI+O5bz7WAjvbCbzJIFy7BjjgVQ\ncOaHoNweEeZcqRaUcJTF2dbNv/m4IPU285uaBdxrdSU30Taz/E4gbyVQ1AiE\npPpiXMLq5fE5bPNyVuZMiBJkQZrigout1SL0tK1sqcDPYx832y4/q1JCmvgB\nWeVq7Mir7z8P7251WjmC7NdTTp6H6n+9Q7pxtLXMiUrjHRSbquq8n5aqDPi5\nMiuHfn4qSpKypzrxXOeyE21VTdd+4IxpFZZsyuoVxTO6hHEFzrd4l4uJeq1i\n1p7Iy32U5BeyQmWN3Hq/KpaZSpPZJ5+58x/b5L/zfBMDyy4asj2NI9IPI5OL\njhPvsT4aLVREVRwQt05WVA0e733M/v5AXTlzf8iv+zmRb1bCVxUaSM4jvjF5\n6XYo\r\n=Gs5I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF3JNKOl2iDgiDTZZGPD44UlzbJq0YfgbJzKCF5W9QRxAiEAynbkm+dJujNf8QM9bPOjIeUZCK3VxrNfsk8QxWs2qVI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.e125846e_1550060948423_0.6091776800556159"},"_hasShrinkwrap":false},"0.17.0-alpha.9214670d":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.9214670d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.9214670d","dist":{"shasum":"e1cad18772e538ed7777ce0cd61a49c7f52c37fc","integrity":"sha512-fma1MKXkAkVsXLE2y8eC1bzpqsNpfrVzHPZovx6WdFU157hfHjJCgfRVTOL/5OaW+feaManzihiII6wJthoLHg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.9214670d.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZA5GCRA9TVsSAnZWagAABHgP/0OaZqqtEVxFFCc/+FEi\neugXt9o4c89YXKQDrIuGnQfd6pw/sxudFmjNUsntCC/LXtkzC6NwMVTNy9Tw\nSi17cgUhe6iftYSAUqq/jAkTjOV/kk9VDD78t0cPCAsPPtHgFL81yevM6pB5\nlU1NFtrAieR6XHNCinoZitZWLRoC/UFIgPEMrMW+hXFJe+Z1w2wDrXKWSUDh\nPSLvK2OPx2taFkueXNbnq42YDmnVKtaSn4mOAKCVMRjLhSMk9DcscCqyvC8Q\nYjqy8z26c+ht8yh39R97twi85ODF6X12YECH6VWTXO+roIiQjsSrqdnocv21\n4D6yv20JxXq7VWrS/ULIPwzzO9kw9t1BGM8htYAXE7YnV2jY4T3s8WEg+PB8\nsM/CQRVdQAs7BERL2fdhw71bIer+Tj3BYYwvD0CPX6wuMgKxhOCAzAcDVaKF\njA3Y/+kLSvw3D8i1RN3axSlY6fTGTVpXN0Pq1p2cY4lQf3+/8KhpEUx0YfyW\nsyldbPADGOOJWVI+VhP7wGYswTOnVv9lqO36QUV7FpND93pCkXXy/RgowevD\nBAxc4tqfpfn/Wjr2Qp0YzrLAtlhdlT++INrRDbLa4/OLLvqhoXmCyN7xUZDX\nwPuJC3gK69tcNkXdaINujOzr80rPiNrBsiHRX4QCgH86biDvfLxXfV4B6Gld\niRV5\r\n=HZQT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA1mguOPIKimDqbcKA9hrIOZN2lnmq8qSOfNnCGIRZ6KAiAYJFbLYrruqUePzyUPjAQel7VZ8Up0SefxfIA7fTzJ3g=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.9214670d_1550061125484_0.6730623655138592"},"_hasShrinkwrap":false},"0.17.0-alpha.37189f07":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.37189f07","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.37189f07","dist":{"shasum":"64dfe594fc08c7579c34323958defc0a09b774be","integrity":"sha512-9YDAHoDpQVyrJlH9teEBvXZCNnBzXsrSHgBUencfqaE2tVvj6JjdXuQiwbYQ5Gpr/GiGnk+YqU9vE/62xLCvqw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.37189f07.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZA6XCRA9TVsSAnZWagAA//sQAJ7HYhIB3dCt+tbqaJqh\nR0AoESYX/EpBZMEIBznShKFEmOoUnEA8hxavx4i64SyM+13m2Asr9tAbT5eI\nGs7jxaSfVuxaMcbEws2jirDALo3IHlOw2Xs7Ux0oh+sS6DdBYOk4hmSruHrE\nrj46jAqpO6HH/OP/y53BihbVj8aMqZKWIVe2kpcNzsk/smcf8ICtrSUt9XCX\nO34UyP/Efu9EHTM7sYZwHFb6BKqnysoMbHkR3XUeB5O4yfQDMeDEDHbJNbbh\noby0porgzLh45GiCbzuDvSutmaHiW9lXZHVYZyAesX6yXdHH165vS/w7gcxB\n9Ns8Or084HayTxR4wH8nYXyFn27KGb2HDXmah1rdmx2zPqHU9rkoo1YpbyUT\nSzSqMseDEUFDyMwA6rC6+1M4/O323VEUDi0cIsN6iiMBTSKIn8SzScDd2UlJ\nld5Pz7851YHOavugypvxqUGGq3YVxgeMqF+mwAo868+TWyg2VgOPDYF/K/ql\n+H8HR/mZ3Bz3iddaAitQMkNK7dTW9kJpDUrt6EMqI9RO9yXLOrQE14em5B4f\n25iolKtnK2odwhww0WACCxoVqhoBM/mWhnJH1m6GKn/LD5RbHRngBx/S+jhn\npMjJnoZ1+pUVkkgSJK8aRp6WFwY0is6AADocPvt4DOc6bTdo7gmSQmAKW+h5\nB1m6\r\n=rNNx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIANBeWh8XR5XUr6c08KJuTZWKfrJx2YEjICjpYV3tgA4AiAxyisNm907bPXS+cotUJzkgA+ftAgxJO+hd77yUk8kkw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.37189f07_1550061207126_0.36111911715673495"},"_hasShrinkwrap":false},"0.17.0-alpha.b11606be":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.b11606be","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.1","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.b11606be","dist":{"shasum":"d655868dc7fcb7b168cb57ad641ec62adbe3d223","integrity":"sha512-OOcy8k3Ihld9232blPH/nfZ+4XHWz6fED7Nulhc3Hlni/TMzcKwnutRBZpIzVRredV2M1wuMTXYgw7bn/iE5Fw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.b11606be.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZA6mCRA9TVsSAnZWagAAbgQP/jkSaw7z0oTQPAB+NXVG\n5bsE2P35bMrDn4iRkOULiwcoCsTD0zJZ8nulXMIwHCiSSlkvG6w3jUg0EBqF\nN9d4m+N83ZJxXznpuoy5C+6B/EfaJmubwpc8dN10m/+Ptkp6fZr8LawH4A2y\nusAFxxzzQZSBihdqXgpqdX2XqLiXy0scvdsfB6fcjMHpNT7vSVY/ascGzT79\n1ZzMob52atymqlyGFo8M0bx6wEGRRntUhFitLxuvWEzE9jO9i4S85Mph1txF\nBNjHz6Gdf3G6rBka8gWSxAXoOsrVLsgz9ZVFUgcVlpHzD2dCJlvHjZM7RJWh\ncZ/DjpzJ6Rjg8A/Bwp/FJQQ0vGPF9HoDiKFA6BaCqXKSjTxtA/1qjncapJXj\nhcv+oc5F6PtxIFdyhO4Imhb6phWz9Lec7kVgF8J0hDOftn1Zv+AryM8ZHb3+\nPpXj6l2qVT7adrMYc8NRNvW4jPhgMLwg5VMVx/RBvexL2L6zD1senvMB7Yya\ntknwViRftDXkhRelzqvmgRx35JkoQSTsq+mOGxSHdyh99ndCImC9dKq0cO01\nXFinrdapNpvuYnm2KEUW5bgJ8hIBIMvug4WS7ftmdYjNhZRpwHi0eDhF3pym\ndXFFUgHxajPT7YaFvcUoOrk6fxa3wdIj1qionzx4VxntvYGBPPSnxMW6by8n\nBXpn\r\n=QtFz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAUENZONkz+/qtR1peF0tCzWEmFApFDepnDoRxE0mxqBAiBjmzIhdG59EbyTOvRJLlOkrXtIEnvRHs04Y+JmJmJJhA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.b11606be_1550061221410_0.10187173997291321"},"_hasShrinkwrap":false},"0.17.0-alpha.19b61393":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.19b61393","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.19b61393","dist":{"shasum":"817c00e8cb75f7bb96f04a71a8075e1458c7ce2d","integrity":"sha512-FIDqpnMlkqRvaADkjtunDWHLo7ooYv5wjDMh5gfO2hdfFsPsbFc/XTMJBh+1jNsHAcvH432/v6lSu9kTy3QOpw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.19b61393.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZA6yCRA9TVsSAnZWagAA0dYP/jJAtgqzdYbw4ihoaukf\n9QPddojsU8KaEf4gza1u8gNZ1MPE9jtzElNGGkr3GlrhCiDDQCu78EVrN9Xn\nASPXrzEPq5hN/q/ydQL4qCqb7fsi7g9ZX9EIK9ja7BnFe79bn8RkqP9ZRxhE\nKVBITeWZekSskgp0t9KDTWM7add3SwE4eMQo+27Rzs9glPHBcOz6H94FxDrm\nFKS5fZLL5dVvOA/wHvCMJq/K2DKXvb6wx8LhevoJQHBtZqrYhKIP+uFflcWV\no/XJq6zirAWc5s7yAJQAdIwCABaWmPzXyIHlgB2aNTCZLaxe0//oolgaIV5q\n4TBN6sirEV9jLLyEi6aC9v9HsfxJKmR8cCsf0rT9zGmN0TS4H+Vgp59pGMyH\nvrg/A3AWzzSLGbRl1PfBnk3n8JsMIq0BMGU4DY1+biqHheBi52sQUTvrU2fZ\ncCKnnqjXC9JXlPXx9tYNIEhFMckj4zTLFiufjhU+uLusEhQUjNcQA6KEFUrG\nDAoB9FnFQZOX3//Ceve5Zmu1ISefR/x8fTUCtLfbIcOQHkwoZRi0AhFr2pLU\nybviAnXShoRSVQ5hlGNQ2xu3m/v603B7Lov3CItoFGRZ8uOS2HNADcVgYOyb\nEwBL4ipjNgVdfxm/L3rsdwJNQ6F49yIIDJSDIteQps6nJD4OzgbUVszCkJ+z\njDub\r\n=UMcd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFmqvxMxC0ESyRRBT1b/38F8m1Rqa5aqopFWpYz23m9AIgAyd9NbhQcZwYc7eCQd6o1ewglg9EJdu6hbVKaU+1KWE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.19b61393_1550061233672_0.4631404530226153"},"_hasShrinkwrap":false},"0.17.0-alpha.8f5fac15":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.8f5fac15","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.8f5fac15","dist":{"shasum":"197fd65093b2fc937ae7f5715aa33f4dbcac4e56","integrity":"sha512-MiWBeTRZp2y2hrwOpHPV256M85pnsYo8kFk9J7lu35md+alLi0E555g2ZyRpJWgB3w5DPWfQoI5G0g6PwCx6aA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.8f5fac15.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZExGCRA9TVsSAnZWagAAoYwQAJWlzTWBItVnK3o9/qHS\ncuc3F06uQiL67tGU2bbhWoSYbLEUnn5MpxJy3CuYLLdbRaum1/8mPZ57jeS6\nF3NQJoXtYmETqIYgrNiQK9+RrimoLeCRf+66VhUzP6UbPPP1D3s6vZI/Czwd\nKoc5JA006J5Z7coQBgg7nVx6hfl7l2rJaaRDWfSyyNugefS1W7MgifaMGnLF\ntgk2SIFDGjbnyY2YMnYkPP3696y3aDqXW7ecBpfedAeycXTYk/WH+bsaElhc\ndX5H5iMDVgISx6ZTp6jRW3NUMgapGR23MdD+XJIBJ/jeKSHfoHDj972fuKFr\n/gb5e2it0VvPmS+oEO24fpwj/IUNX/gjl8Vm89pABd58Gk1XvKP+ZVd8lIem\nlAfg53k/UCB6ik/bciOtCHHo0xjQPYT9aCidpX4TMznwfQOg9aNS/njBdXXq\nT8cVqZ33OjbcdScIUFAMHB/PV2jFlNFeXUl+u94hfNLkBGxWKVye+4AwxugZ\nLP69IMsUJR2362KgcGs6iDk23KpR8KgKsFgaGTbryXEY0eRs5f23fX+CWzeL\nMVf5vRnY2NC4u2cGHnvLffnt/0R64JqXDIhAXtSnjLvE6IYeOYjpU41CBIjv\nkYuDWPNoi/pszBotJj6LArNlDhCCbd8M5cfGeU4myK/r83byTyQWubf5XM75\nPyDe\r\n=NPFr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDdHBSGtLzeMKVkS5ethucZuNIYEpZTWwAKFW1oIwqlwIgc/+P/iAowaUdNTGRDfux9cJ3EORh5BdTcoQQc0Uh83I="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.8f5fac15_1550076997758_0.7647433288535552"},"_hasShrinkwrap":false},"0.17.0-alpha.4cc9720c":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.4cc9720c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.4cc9720c","dist":{"shasum":"0cc4b5ac41d5fb58b81afe0e3534610eb230eb8f","integrity":"sha512-spfBITZfSwTRPggk/n7q4XoZdtMUI8AhtqWfJNSgHFCvR2vKc6sQs3+QPFZdXI2mANxp+fgkdBuMGwU9aVqx/w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.4cc9720c.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZGNrCRA9TVsSAnZWagAAQK4P/jflKofOTj8P5AfRnndc\nhwVtz4teQ4X7ITY/ng/jndxi3RPOUwlxWf9uJkNaSYu6cxRZ53V7sY5IiypX\njQ/97U8MMebFFxpKRP/AHnkbOyB3G086mvtrGXueKMzvYS+5SBqv7bnA0/kc\n+ItgtgliXr/ewUymoJwdgdseUGy45y20SZlYM+e4vCLOYnKEfIs7FBj8+jI0\nUrFGS9d+rleItEyz5uVWwB/c/cnGInn93EWGiNlzHF83cJLlSGxH46O8kxWl\nvN6Uw1ac8/e8K54X/o5LWKqJTLvjvsWtrSNrS6q9qI05boG+Ecg7Hp1KGj0Y\nZpEUkHTaMlb7Dp8kE+E5WigA0D2/CoAOrV0XKZ9M0gBC+bOgLRHUjuS+YMhL\n+QIOD/6ukeAcK9YM6Y0o2h0i8L+1MmLvWD5q5cyMSpoyJJ/pdhx4Ayy7CfEg\nvaipYpa8vpYUR9UPIv/XxPKHU487NVaeMZiH9xDmOsUEnT2+fcc7GG7cYEiG\na/TJ4R0OkE3yH4wuHlrAvj0GRLZQbKqUURhQUplZ7Jb5TKW814giAyIzlGYw\nWicXCSY/hNqUNfsxnBARGnA4XR/7Lm1hPpl13cg1JaMWh6kGNHqRcZj9cTPR\n+6AEnw6MqP2sGTQFSQYMQI8QmwfHmD4JV0PUHiHvmAsrbIml652vyl3ulsv7\nYBzz\r\n=eI0w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCE4vxE8rokC3FiWLi/V2L5sv2cDGkPN2+xpV2mAtcAQQIgO75ewD03VSEXA+iM9qYJfkLUMbLaU4xRufu2PPNshos="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.4cc9720c_1550082923050_0.8111834875122006"},"_hasShrinkwrap":false},"0.17.0-alpha.d62f37ba":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.d62f37ba","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.d62f37ba","dist":{"shasum":"6ffce63d17f6fd0b11c180c50f896349dcb88e69","integrity":"sha512-ZSuCLEJgNSPEBDUW6WB39iYkzIvjE+5+0FtsY5wrI6aiICyFM65ToW2HVLFWFuQ6txNOON7nPdCz5eEiJyMKjQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.d62f37ba.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZGuBCRA9TVsSAnZWagAAOcsP/jIA5cUPM0xcu/zE3WmV\n/C1kjvbenn5rbVk5YpexMaN/YNLpP0UE4wOcr26VGqguoHn5Zw+KWDjUP1LH\nK5jncFNYMapBKMSE9D6bBU78t4MjPZsk3N3Jzlqi2vDI8caAftNKo4If7BPR\njWf20+j/ML4dYAlQUnpAZFUWq+AVdaJx+C/AbUjh+Tklg3ozUxFIXY5+U8gg\niKH4FAM7vnA6jOp/lsAFsoObd6iWv/0eET9M4LkYbf87jyb1L0bCvhArzhqr\n5bNWoTkuRoBBpNUPj5i573sBG33WL2eerDHSIFCgfUE4lf5ySQWLJBSAGBer\nfZ5iA9CvP0zwy2PTnL9vB7VIjQLjB1MPkkbnfnpZVmqVvSCm0vX7L3ZDb89k\nxdwm07cfpOndIzXDR1Q5kc3mM4BECFf8ywm99PSjAXKVyf+z2jV4SCumvAxS\n2ftj6x7+b4YMUSnYl7WX3Q7Jpds06z0fOckLOYbSBY8vDRfiazJ7YGfMjotD\n6wi1Xfzoy2Un+lnrI7zQX7Ocvgv+dggMzAaThGFfNJBBGuZ7iVZemP9wOLJK\nx1EWpcB0rk7kTiOu3TWQ0Pw73fhPaCh3TsFYmfMXAyw3kJXj05H4eaiejCSz\n5sf0wYZDQIyFanAj4lIi9nhtPmr+PapAgVMoyJ+47bE/iLY/qUQadln1w2qt\nDYLC\r\n=t4+U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyVT8d8MUEcG8H0ObBkbzaj9COVOQfTF6mr9MzRVl2yQIhAPLF/FYlXOas10e3Tgq7mx0TGuopEyMcgCXzyUXOyoTz"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.d62f37ba_1550084993030_0.5470349836884687"},"_hasShrinkwrap":false},"0.17.0-alpha.454eeb52":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.454eeb52","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.454eeb52","dist":{"shasum":"efdaea188b3b993dfe59016a60894ffde7e38338","integrity":"sha512-usAtnRltvtIVCrHmvMHDgy9l6CUDXIINm92M9XdH7LpSjMD94ekQSGSdP58nV3i5VihKfhdo3rtOpqa6dCKeiQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.454eeb52.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZJRaCRA9TVsSAnZWagAAKOkP/RrgIdzStM5LNji1dOdq\ngjx3OuffhbuZodHDyN53iPhNkaDRgw2jD4n8dXNQYOBNYcxS6/zKxVkaYg6q\nyp+zbngfpfVfv3bSBbmLaSma11ludvTFsD/v2SCGIwJW9g6pF4QLKojBglOq\nFqDzay2VM9zZugxLJU+8h+RrkVw1yw/Z5d05UcepfcJV2yeCHjeRODzoA9IY\nPNRrCkOxoJObrbXzUGUNVmCDWgYe2vr4scHrpa356DuvIuIQwOaGBM2OPIFq\nEHbk+53tPJBqAa8XtdEpp7kZNkz2tLempyijSlnjBq4V4VMJA95wS41Pj0qW\nvxmeIJmfg+U2z6mDyYn2cWtdtUnarnpdHyjdo/B7i7T4nqpbvsTnclQD0cc8\nVeZjrDWFcsexhNi9sv10d9zuDBX6S8dsuBVAkSx9dshRw7luwwJW3nv+SQ2z\nhCkfSUNtleVkXsvNh8gDLE9hEfdclZAuEcVR6i4eerapALI1MsN1EjfqAlt8\n8RdjckdP9HistMieRmJZvq7HP5htj07nkJepJBqPf7zRojhuPW8td+IWOi8i\n+ceIc2oXPT+U9uA+RdYQcp2z/HnI7LJN4xbH13A2cngAJJO0H4OK7v20f6wx\nVWYVFZhEQ82mlOUDhEnB+Yz99eHT5XBmWw5YOX8T0eCnX8CAXTDMTVwmN/Ct\nqbb1\r\n=kZI3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDd0OlxpdcaPUyAiDpaQj6hf0hv5msH5N6YFh9q4UTB2wIhAIPT9EQebk4/sP99aGR2WiVpUhcmeoRBAcPYz15Ve1Zm"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.454eeb52_1550095450157_0.5307567008299112"},"_hasShrinkwrap":false},"0.17.0-alpha.fc75e94e":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.fc75e94e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.fc75e94e","dist":{"shasum":"1ede02fd7dfbb95e4c47c5823519772e224a35e3","integrity":"sha512-kVZJxLCLMIOvZsxo0+TcfHz99KS+v3WeGT1O7XDPyA61qrR2iZiMn8AJXUuSo3JIDmEUy7xOOuNlQ44U+72yaA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.fc75e94e.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZJg7CRA9TVsSAnZWagAAaZIQAJ8eVFg4vzjjPssL3wrK\naBdMromBcz825j3zFrCum8n/716Wyt9JbX+73aB4k74Ta7dXhWJiPIrfWTFY\nsr8nhR7i6/roQDhIOiuuZt/dAe8gfhvjplE6We2XpS4j9yuvcvQ2RLTX6MSy\n7tm+UBG0n8PQQznDHL1B4wNi9KDdxiyVyzHrUq2ej4j6pF5Kf+JYiw++UudA\nLBbiH6625b+Z8DIS5bJLqH7ghuFM67MxmeEKLsW9pyjuo5P6qRZbs2q9amPE\nPU0RrYk2rqTAGofg+dDlShJvnGj5zsYMzlF4JcHxakNhnzJjkve1MLy8ROLq\nZZsz6yitMmN29nXn3mMsLB68t/nkKEjJBNgSWRKaECucES7XMTk+w4N0bo6N\n9Coak2qKDBnGyZr/zTX7D+/mLnKIaxU4O4Fa7hpiK4nGYfOm8H2N2s846fm8\n3xoFv/fGKe5k2n9DDJSGfvdaI3jWCdiw2Sg0rhToKFzAvTvAP+oPTo5iPNby\n5moWlan8jlKhpjpUNL1KGQiW4MmB3+N1yqeFJ09ku/bFG5EdLlQeXyBhAw9v\nHbTvOAw9UXMQZo58SgceKRqlmn2ejIe94hgK5kWhSvRuPHG00MZx5nMaUULW\nQRQeS+yV4R9q3g+g9+NKaGj0XomTcI7n3MX26nz12l26Nua2IzkjJSzivwhJ\nZRgL\r\n=Nelg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFvEpNByi1I0ak1+wy+EDHAXBuZ82W+lNtoiWdxnkj/sAiBMNVS5n3ygiWsSYW5XD6jfSZBuYva55mEsdICkPmOYvA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.fc75e94e_1550096442399_0.04249965492043506"},"_hasShrinkwrap":false},"0.17.0-alpha.3327d70e":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.3327d70e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.3327d70e","dist":{"shasum":"8f803593ace0c4643fe6586b9eab76552858465b","integrity":"sha512-NEcIu2cPlrnBTZ/qPKHPfg0/CmIl3oIQ/QXbdPB+9hUfxFcoJ8wIcs9Ipg0UvSnOe3JtcyHWVzmcftf36Yx+HA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.3327d70e.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZKhgCRA9TVsSAnZWagAAVb0P/Am32TpJH7kq1rd1/EJK\np0xjF3nWFXP3jf9R/5Ug9Kxo9UVK1WG49qVC6YcH5TrJWfoeMjV2UAHF1PKl\nX5XqEu4GHPRf/HjLQlxdSi5hbJ0UkvPDpYRFS/QIoBdQxFQAwcFtCI6yps0I\n4rDL+9COi/BMkmrERTz18972/CaA+fo0biP+52eufNB/iSsihRs9LdHiVhiN\n3HBiNHFK64QA9YTIGzZ+Kaf4L8W89nd2bWSIfNRhzHLiuJdBpcSpraEhD+ud\nJ8IY3Vwbyd/1YOUDvx64tEkgQ1o+4RUv/TdEA5WvLVMIyspn2Jwy0NZk3oZD\nSAUZjWtD94ojYoZcXSva5uCdL7GxMHYXsp0HGgZ+U3g51V5WAzWNzM1xANwo\n3FoXm+Vwm0mbf/izkeJJvH1IkQo5jEyTiU5MKZUL9oZjac2e4lIWCF12bMyw\nHEmFIIS7xEObaN8Md5n2ujvMzbpxkLhDgVpUX2Kfz7GNgy2IqZZ/X6nea+dk\nAxumdnBvDaPq9AGmVPl3718XWdLZGQ2uUFslXMCdI5wHfe8kmpWf8hBb36hl\nfLxPI9BkBozXHs8pSK4awax6IncQVxpbUvuP5JoVkQy5DpyKXmZcXTi64yrh\nzP1sS3zFe3kvRkXrltCFVNVB+xL2eGiQBXtPXoYxCGL/OpdqMuPXGfj553rv\nirZE\r\n=fcb0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjhCi6OABYowVwqDv6Hab4bHt7oMStthxHBxvBJNe0hgIgF58J+27Q6PtjbX6q4PyDxZ2o6By/qzOP7NrZqKTeNUs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.3327d70e_1550100576042_0.9471462165596611"},"_hasShrinkwrap":false},"0.17.0-alpha.162fa439":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.162fa439","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.162fa439","dist":{"shasum":"ad0a4569ce2918fd0b453c9d1e5316c1bd1528d8","integrity":"sha512-su27NQvcpnBBrW1ElL6jKky2V9Fc/ue9wdgsDdx7SgAb54FfVSsjxIe7VfZiQ6JCZ9Ps4amCFgbQSlVgrBdiqA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.162fa439.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZVIICRA9TVsSAnZWagAACVcP/1bKcFv1MAnAON5RGFo3\nWTFv4oyQFWX4YxHMYCY+BZInr5esIa1DkvxIOzbRp5wJ7S9c9YSFGaLETjjD\nHQ1BoDf6Y44vQJCEi0LeFY6PbikJcNnH14TLyfftTBXMj02MX78J5uVwnGVc\nKOTDIODTjS7ZlQJ8KV/M97qBXy6HNTI0NSToaGWhszm7UgQdOhXb6Ob3nbSK\nry5SZ0gYlN2anW/Kzz1RQ3nkDYar4nPrwKXuGnEn+0g5MvWtJQDQysfEuJaT\nfBlOIpdBu53BSuPr2915m5o7hATazfEiDWo+He6WiAoM8phW+IWGqKfeSFQC\nQdGeLP1KsTyvgRTHk+GzdTmHOtc3UdyeM7EhvyMa+rM3IlsPl+eM+mqzIB7O\n85shuVELnqYnl0TGf/cNU3JJ9a7oR5div8LlaOESbQlNF8y7ctKsN1r2uYe0\n+Kiacq5rCmOy5l6BuKsB5QX/y8zrN1W0b/tqhRXWKZ8Kg1i6BLm7ea3TfgYW\n/FwdXDQXgR2Sqdu1XCEz7WE/BWVJVwi3kjrxzaOFWYnNvmgIkwCcv7Ks8RHa\nqqOyNY9cvKAoAFi5QbYqomvxu2A30O7Cv48O1y39UK5NnzgLqZfJCMeNx89g\nKvsZUuq0KVQE4pgyMyo4RWK5qA4lvIu4qu1go8GYDP+QmN2SgXYv+LZUqp3c\n/OoY\r\n=kGLa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDN9/tJ0x8fNGKMUG+teOjInknOKEkkPob2fIcLP+aXRgIgUSdeTWDDbkdcaXO3WmQhVXIC/c+20tsG1ShRE4aoHrg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.162fa439_1550144008302_0.17192801981545824"},"_hasShrinkwrap":false},"0.17.0-alpha.1e114586":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.1e114586","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.1e114586","dist":{"shasum":"60107248996f6dc7cada9c509a5658f57f8a0074","integrity":"sha512-phwKkdbefrinB54nsv/JkwGfJhLZ+JWjflPw8AYY9mbNTKSvoGZs66leNf4pCSOooWbOX11rO9qTHBX/P+9Kcw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.1e114586.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZbjGCRA9TVsSAnZWagAA7RcP/RR+60fETKs7qxWyjAif\noHu89n4e8iyGAQ7YSVDzzgw5GsTb9Sf5yl5SYQotz74usrkiAM+kkVHc94zm\npbnPTBMcglcV6+O2ut0U/4cfvpnDl51DI/JgBkIYGtgCCP8qd8cLT7hLP3cU\nfNbnD+AeDOpyvnhzWxKdWFKstyaFY4MUp6ItnPRF+TnuHNLaS8xO9WSVZpmh\nwoK9s1iSRUwvwry2EUBH/qZHpLdpJKSBlsPSdZqQS+G69Q3e6E8IV6tjnCtQ\n4XScvvQeiodCuwX7KNqw6XV0zIiYFidy2dUT3Cp1Q8XcfmMr+TjEkQFfyVz1\nUTi1384c3D42SnQw5vpj9mnrwt2+WfcHAwwcfPmc07/JIfNxH3BW/zFpaMw3\npH64w5ak6RLvvV6lNmOGP6bB1FFwqa1Jj1XVhkwHzABno72p6qy+z81WhpZZ\nqZXGG2JDHkiE1fjnhzxj68+2Et0yw7yrjUw/bwiInu2JUJwoRq9yVR8qawwV\nmqvd+Jat3RlSaKiRzjGyPMXSz3cV4ziItY1q0yL9SOkVMtuXh/uNIMAOZ1H+\nySXg6huTLWsJ3XOq7NVesVwCOyjYhJKpi9Y2Cw4tvQ5baiolleGnNgKtQcKB\noGdMcDEdMbnalV3tuLRlALECz+DHgdribDmvbXkj1kxsS8r7Mqz0PdBsNgvw\nMTRM\r\n=d+vD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGXihA7Y5FrzSw3v5sbfPpCcOYGHj6o8yrbPMAndWs0dAiEAxEfGC2hHJmtfnW5PgWYpXWnJGevXQUyrv97DqK/EO24="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.1e114586_1550170309554_0.04672616951124464"},"_hasShrinkwrap":false},"0.17.0-alpha.93a09bd2":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.93a09bd2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.93a09bd2","dist":{"shasum":"f1e97a18c67822aa11f98c76f40e9484c808131c","integrity":"sha512-y7fkojr7KAtJAflleCHS0PXVlFsNRuuZiK3d5GY/Kg9jneSdo/CqiNEmF5uaA5ncDvGhaYF4Ko1Pa4Od/dfVyA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.93a09bd2.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZcC1CRA9TVsSAnZWagAAXg8P/35AfHeDaT26E5zJe9i4\n/szgUhHXtyM22PboJysQLbUz/3JIJmO2nDve+cUsk92LOBIPiA1dc7mrFrZY\nVfN6u24wed5OH4EyWejSCj2Jx9iSFLLNk9m9uJSFOffXgSImeYFqobEbKEsv\nk5p67G5CGaOB6GTuJGiP1XzohBdwTWvnzz52YNsrQNasE7g1noRs3IIcxIeO\nL2YCpUMVa98ZZgk84xm1YXvu8v56It3ohCV95PavlkYWglhzDNPG+cricL6z\nH4dLeaQT6Yg5Vl19+XTx1wGKBxVTx6djceG6bU7dWkjGrkGyhK6nfNY6IfLu\n/wT2ig0DKrtF2vnNm6UkOGzqEidCrALSDxtBechv9/tRm9FUkRXZyjX4b5Sb\n6IgRFdLxdoN7ito0qR4eMWH93TTaogymm6ezK4UwwX04TOi+PW7TehsrZ55A\nrALWGLQqqf5R4maNAm+9BIWwSJXAebFA8CDo5Lk0/Mq33zUjGkAyL8qjdrzn\nc5j6LR3rL2gzJ05NKEcL+lWGejrlHMtUwK+F1UHfbBAt2FdNmZ4yVa/kvVuE\ngJzW2whn9Vo9LG1pxsJ7kT3MbbfkGlAnKFisLq0ZV0ZKDMvMIXp8HbmkgBlA\neTuQ4gI1d7xwJMEZktT/LMnJRl4pzoeyAcJnYPBfpW7ZtYzNhw/J2QDl3gm4\nURDA\r\n=QVvN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5yf20DxMzD4nGBrma7EWm0MZDxA2kc/DZkVH3yhs0DgIgDkycJcp/CmnqKOof3Hjjgt78Wt05FO+DIN6jn3GevKo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.93a09bd2_1550172340664_0.8077268813751117"},"_hasShrinkwrap":false},"0.17.0-alpha.a4533c71":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.a4533c71","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.a4533c71","dist":{"shasum":"748b0c04ab06e3b6d1f1cb3ed5bdda8cd558b5f7","integrity":"sha512-xor5SpRV6L/NiykH+xO0tqhNeLgJN+dHkWhGc1xY8wo7G9dfRm5WgjMsA1OkGaCOX4CFeneTFs/R1f/lITFKeg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.a4533c71.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZcV1CRA9TVsSAnZWagAAXVIP/3Sm9dRn+W0LCOunOmx+\nw9fxbNkwJRvzvgjD3auAunOyNdRwC+P3Pk8VW/uosnZgxJ9ioOPZHiwjx47/\nWNW7ICppV1aJsTFBXYreP/b3Uni7sc0lJt5GcjKqOVLZKJPXSKj/9M/Nplj+\nvgIWcOv3aZfRdlGddOlMZqZcYop0j2IGKe2jKzPFLoEb/f/NWieu7kIyBN7O\nhE3Qd8Zmm9stVydDzXEhK9iqFiG++1Mdgx+kzYc8b/W67/TmocbQgOcTL0en\nYIKLpUUPvjEy4+YbdOR72qA/FP5lj4VEuBX8qgtf0SyEr1pqXUfsQ8utxszO\nLFpNb2I5edWPAaRRR+Vnsh5tHK5m5vTSGNVrN8hoHjI7euTrbuNveISBTOlR\nkb1fqdoSGl2Z7qhjntQvIHz/urjae2w+d3jPKU0nhJ0cozrncK/WUhRPE+3h\nyeRoBsoZ9IVXDMD0wAbVQnppJPzplBIYkk/T9nLlxw3yrTrEFKCv5CknsplO\n40J2dS2HTLfcwGy6iEM1wFUbLabzw0hJOkiQ1VhjXugBzfUX3Vf83JySHjiB\n40ymecnLPKL7QlRaJ+4I+8UwMwBOdHeOWLD/g1Yq8K4jZkTYT2qSaoqktVCM\nxens64S3wb14H73Kj7Ihgsi1orXdv7gcxpo39KK8ZMYlL0ZH3Xox8w4GeQUP\nSqD8\r\n=q+HN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBWDW2zyEcqcZGc6BSBcexNd3mjAR7nkFSbl447h/kRNAiEArFWN650DIN1Y6ol3wlHxA0IQMcSwmp208UrW1xF9nYI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.a4533c71_1550173556427_0.7811751452733924"},"_hasShrinkwrap":false},"0.17.0-alpha.c0e1ad8a":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.c0e1ad8a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.4","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.c0e1ad8a","dist":{"shasum":"fff8c125345ba4139f18822260794f2939db4302","integrity":"sha512-n34YblvRN2BdiWa/QZZ2i6txDRuDiiiLSHHA7WaTK4FIxXUvKF9th1GUtWxEVd0nyEUsD6/5lNDX6v9/k5L6Ow==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.c0e1ad8a.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZt0dCRA9TVsSAnZWagAAXpMP/2Ws4v3Hv8TpFS20Klvj\nFSYQzTjvRHgeG6WlIHXW/VDPDcfAK2VfAwOMhmoYpWtiGDA5YGPlyTjk8l1S\n9UTvQWjSKGH5nbATWnNchJjtTHXpT/J9ku4oFOW5yG6zfPqTuuUmJJcSCYDh\nBikxi8Q+oqU/tJvlodUjHQk1yuZ6oU/HlbiGbPFTWHJfZ1GmpwEMxdWzbO6E\nlvrNmTNG49QKkzFOTyMkWzSjEXVE5VHzyGOqS9W8Xc+KmfA3BcY6zD79vkmj\nY1eI8JkAyQ4oI0rWz34B3Vme5FRE87ghB9uSCkIyvTHp32bvjsf4KXdlYJ1K\nrRn1Fnjzfh+H0B7txJy/ahmlweshWJYWz/hkAKWp4j/wqAb+D5MoQf3k/vNM\nG0v0QRYjlxSqOV4DVOZVVAxKo9p6agz8CQvoO7g0LKDKx+iCkptVSiLsfC1e\nrbKqEqaqxrGeoXR85kmyJ11u/FkwWs5m7bakWNyK3PgtC2bwd6b6dZEulX/w\nEwz/egnULUtwwOyumpttvdSxGoUrgC6HRvDjMAPEK8r8JNdMhhXHoRu4RPIR\nFJoIXXuYJAQvs1q1PfqsA/Yxrm1gSrVjoeaPY+r/XHtNyOzXTk1ImddyOlsG\nv0chSQjlrr48fVJ/B0cM7COnyDSVA7elxfS7TpH0Ms+H6atlJoZp4m5x2Dme\nBDkP\r\n=QWSD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDl0GAcTcQek5D4CClI1cb96Xynd3usGON1ec/PRx0PbwIhAKSl04Kf4v3dIh/sEFW/8De9R5Qgz/yhaAO/2rTMbB6v"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.c0e1ad8a_1550245148466_0.794617626044787"},"_hasShrinkwrap":false},"0.17.0-alpha.364f2fe0":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.364f2fe0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.364f2fe0","dist":{"shasum":"a2065c71b689e766356402f0d58b0ba0ee0a7358","integrity":"sha512-aIiMv4KcNdz4qjQZfhgWXwOP3FB2EoI17FF+6RqmMKaxk1f8XWQuUttGNRKSbMppA4gZuPTtmcIuIIUygkkJkw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.364f2fe0.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZxJOCRA9TVsSAnZWagAAg1gP/3jdxjqi3DgYPX3lGGW/\n8X16J/WqGX72IvoEuYaufMoDMyWj9m1KPaT7PVZrete13l+YKUs7k/UBZSO8\nL5UFZWsQ7BwMMe8Nl0q+oHm06x+cgr6bi1prJt32dZ1dcbxn++mRfHcJivxg\nzDRBLIWUHntoN6HglN/LOniH6/D2vcwAW3nbgnbAOkkg+hl6gDridqaTqErO\nJCxXqHSUoz1xkJRzT40VLXPk6x4PlHLRX7J5E+usclIlGF3OTquBW1MhmnMx\nUgBdkvb4Wlgr1VTAm6LXGcC3ya0Y7bDg2uyWxx8Ubik3Ni1YpyOxnWQldmtu\n3my7WiOemRbSE7o5u/713iM14YSZ/5UgiYv/iSTxVvMi6zRYNfsU3O6FkLKx\ngVbJuTOypBJhRtDU8FR4Ar8+9CFMHy2LDRvBgcf2AeSvKhI7wk8unQU0jTyn\n1Cbo37sN7GuOaZHt2hl/hlMpEqPgO6By9qQlstA3CIEXtUY6kgwTc3iYk1pL\nAI5t7VmOBjmN68s40EKCAo3th7BcIq+lAP4cp8hZmMKQegwmwjNG1T393wFS\njwzv0IJvciB6OhEUCOXTCXCCsf26dE1PWou+OhoTM7sXpPCzuooqV0zabx7b\nMjXA1a5j433q2tfZcLP3UycaS96hovFy7NzVSwRux/DKXWDvJKbklE0aOz7T\n1Hff\r\n=RW1X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzIgMEGo7cEtJ1nLmIVdMM9qybzibGUhaxaA3QF4Q5zwIgBJ2aPjlAIHcWiSUQojWIBXNfhWSG8TzCvf6cMI/P4ek="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.364f2fe0_1550258765252_0.7340703794088248"},"_hasShrinkwrap":false},"0.17.0-alpha.c786f6c3":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.c786f6c3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.c786f6c3","dist":{"shasum":"d6e3506a828c303eb769f74a1f588f5e93c1fc91","integrity":"sha512-HxDlHgNxWXYjSsOyTqZWgHD310oQpfsziJP04f4I/GsSdh/IJCVQ8Ryp7rmcWLiOieuxOKwGcft5MGeCP4cTGA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.c786f6c3.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcaonrCRA9TVsSAnZWagAAtZAP/3TNzIyxbIvWOkdu3hQq\ncG+LkDYgYjCeiBvV/ys3wOWW5c4bG9sq2M/ROoTfvxSRj0CkTkrrpMvvJwwf\nbUvGvGYD3ErL7aJIPzJyc6O3HBxK48WQbmECJGCjG0MBZa3LhSb7WqaqQ9wv\n2unnInuqq+vT9RxfKYkbmeCMD2hSkjbbDYvhi1YoeDjc877YBzFBOMn3BBLL\n/3R+A3U/X2AsLOJbziJZzcaIUqqkrdsKinfLRqWMJ+2bGOVfIKd5ykuXPwAR\n0ULa9a/2iA54xxTteA3Mr4+HsMdybRM1UBMJ6c/XjkyS4shbnWuJGBWqtzVD\nMV+ihzYUDN9FJ0ldndkTUNlsrMP7JhCRDfyvq733gc0PXGVNVI919k7wBCr8\n9i4Dm580a4vGPmvxOjGbMELPmLzHG4LPVEfbrtE1Dzv9t1EOdixiwkF7BVLF\nV3Z1MDmKki5EztZZSbuj6BOi+gu609fJqaFKS4ron8mTiFLdl4m+9WCcNBX7\nUdTrlZZFP65Eje9MAn9GtvmLMYjcamwpy+6/UQMcWWzdqdguAbzXCmOhMZGk\nKH2nVxcqG0EoDNFG+XxK+UfaUsyLL07rzfkz3NLX8zHeED4BJonvaXkbY3cR\nVQDGB7o6OiLa6peFfqQ4IVidTodbYDPT5ib8EriEoR+ZyhtF2EXlp8f7QkGV\n2ZMt\r\n=fvW1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIDtn7ezCJxlWN1Nq/3bgUCDR940V47mJRS6qZuVgc9gIhAJ0pKgkEtIFPUSlfRXhwomIkfQ5lm7G2dlUMk9YUjHlw"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.c786f6c3_1550485994902_0.659362781214623"},"_hasShrinkwrap":false},"0.17.0-alpha.0449b01f":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.0449b01f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.0449b01f","dist":{"shasum":"8f89fba1b8cb5466f5e9bea69aaca1cea330c8ce","integrity":"sha512-aqwPl2hVYK5Cj6OPXYMhStzv0JZHU4Bzlz0JmeSaHJ8XUFAW1RFzpNFHzDlItvPQ5HMJvdt6dWsqpPDCh8/ZqA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.0449b01f.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcaw0wCRA9TVsSAnZWagAAPNkP/2yFweWlItd9zNMZ446H\nD3wc/DW6vgzH/4ynjshciIErMmAu7Qee6AH0P3uMFyc224O3Pvbzv8x4MVsd\nRcxxD9ONOtSx17YZd81NA/Sd/Pz024nDHSzC4j3UjvmOitlTtQ/6rW1VpaNc\n11/p95wnNc6TZE5P1dQCdxTxMKhNhXppf6kqkRrUTJrQMZe3wT0D2lZg087H\navuZPvvEibfNUyl2Q+bG6ViwV98tndKQaduv+pRs4MRpqjl0Csh1EcYPHOaq\niGyX+UCjzeYGMJ9nYqAKULRnuPUvvbTOlqkiQ7Ki38gmhKPKQZ9nifVW4bHS\nf4cOeGMCKG/iqTGn5Zhu/kJPbzd/remY1K0xj8dyGc4YqqneJAFRDJ4x5IrK\nG9S1Wle/9QJhai61St7EeE/RqSBwZ1euBrViH0LKJ9HaVNVyXsuATvOqG92O\navrBP1Oo4J8WNoX9lBV5KHEykEW6IIJfK5Sp292C+QTnAPlPu4frWYmVCUda\n3N0j90essMxt5AZ8KlH4tH/FbijdGkHZVb3Y2ntSWKQUET64Q+dbwfwYsuCs\nI4vcO0814HhGHtCjudu3+d4xoBjpj5cdllAKajXZeJXwp/pPKW1cTtI8vJxT\nKrUbNRih7p1IpD0MWf6aIZ1f/HeI0A3lQX+iYwRcI9DjS0FHPayQG+7J2gmO\nPSL8\r\n=y06H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcV0w4orlEduL21LIfZnTDEOmyIsSaOHaFOSrc96Po5QIgeTmGedRLPt4TOgNHk0rjDJo8e41jlHlFx7TXgknShBk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.0449b01f_1550519599428_0.46950354524267945"},"_hasShrinkwrap":false},"0.17.0-alpha.e1b77d0e":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.e1b77d0e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.e1b77d0e","dist":{"shasum":"9c8f1ac2a2dce531f94e42db843ccfa1cc7876b0","integrity":"sha512-s8mOy3armeKRzPnBwrF2olAq4r7FoZ+BBAy3yJtFGo8LjKH4U7Unl8wPjWDOn2jYS5JeUGeRRrQyIcGcW5jAAw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.e1b77d0e.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcaw9BCRA9TVsSAnZWagAAmPcP/jiXWenJ3AS+sIim0ZUM\nmusTjnQ5GhKiPeou1fLF33DJNrhC7A9tx7ss54h+8ctIT9JnQpO/jfhZmASj\noRpPWDkivr0yINgOdtgHd4cLaBM/G2h0oFXXe8n7FfXNf5ch3ci7pVyPqxAu\n3VziciAYiry9VomUkR6Ga1QxxSk6n7uDtkPt040ipsgaN1bHIQ6zH8aVrsFC\ntiJHeZKUNjQ+O+GPE6CuAQNXVKrplyCDET0g8l8IqTHGPW/3CNbc8YixoGm2\nCgh+O6SnQgEEdsGGCHucVTtq7PmZaK+yOg1Ro6yW6kkgkRexDtJjfWb0nep4\naVdl8HPxX1SyidaIBzzjb9qIzTiBYzvU5g9yDJFu2B5lYoWdN1Ysw38qLO1a\n/hCP7qa5HIKL7Vl0x2dwdz+PdIJy+0zENHadcvVqd4c7fzGsClDM+MgQOgJC\nJH8DwnbHfaTdda41fwDoXtSy1FAcZXgjzKVUaISOmG5Q/4/V7pGniTDD9GPa\n/AUv0o0DDKRnV7V1RNgDAelBYDHxYR+xGZlov3D4vz4FMWdvgmmDjlpGWZxn\ntPgE9Cxxq86D28VzHGGVk/klHSq4/WDqF/Tk5OtqZFpKRVKsBtAUoTAEUgWH\nU234nxCGi7dnazfTAtAjONN1zgUg6uBtmyU0hRjoDSsjiHTBS6H9hIzPqo+U\nCx9v\r\n=Fa8U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpgZHYNjPpsFzN2nzJTjFFMXwoiktj9hKCnwcsIdsNXgIgBREZkuqrhuNRruP6DgKKmCams2iTTCq50iXoZii7cVA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.e1b77d0e_1550520128461_0.3053932163134976"},"_hasShrinkwrap":false},"0.17.0-alpha.6160f8ab":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.6160f8ab","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.6160f8ab","dist":{"shasum":"86346eb0ce257251d9a926aa4e98e10557e7507d","integrity":"sha512-/hpHaKJ/FSLfHCEjdhHbg9YI+GTIs7u8ZK2pGCE1iAZL7Rb45UUarpJtqmMe+Jz9mrWPFqAXpPZSoML7bnapJw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.6160f8ab.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbFkBCRA9TVsSAnZWagAAgpMQAJvlb0vCz/IRMeRAE/TQ\nsaULPLrBrP2fIugs3FQu2obV30hnR32LpMIKS0GtZJm7XpgiAVoRIDIRRvwb\n6fXZAWjZ9fyjCoa95qlxeKr2GOxRjTpuK40pTPGpTErp1CoG+16FKXO+riR+\nncHWO7RHTC/HtrO3Y8JWg4YJhLPjDhvA5fadArniSovG59U514ZIkXppL+8s\niZn24UPlFow7JCax4CzKHWTL2p3jT+I0F9LnBPIiQwRd4DjCIN38PReDSSRJ\nJfnfxjDuzO8tvP0b0RRlY15yXd/F3o0cdxOJK0PgsHdCavk4AaB84qFJp6jy\nlZitLOpHcsDzd4bLGae1T8ctAcrzS4TzHpJMR/1gvkUZgrkfx/DBxvCENWWD\n96xXQAIkwyT/SCKvAxWZXyNFcvE9rTthtLhIbrn+szvSlBYbPjsrUrZaQroE\nWzRj56+KK200vgQeSxmh9UOArNXkWcp1WOyj2WWM7GUgLtDGWdIESMBrRqNC\n2ADlFdgwUIa/SQV4e3kCCUQ4NjBGvFRrrbGKfDQyyedXvmZfRRYGDSKgm66m\ns2lW7xgAJ6cCTeA7qvQxtcTzggsA9DZO9KbKx6c77twyVsf7iDsuDvJt1JaK\nbKZ8/PXbln0SSqbmubaPDcYoRy4cRlFGqqv/i+c7uGFOUQzovnFY/BZFpkPz\nIwvY\r\n=wJRE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICI0GGUiuC8zLQ75UgTpvgPwZcT43J/7aG/uf/jNIsE8AiEA7JJQ8+thS/n3pUfWR2SktSvdmUg2+TnHQJi3JbUs/dY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.6160f8ab_1550604544789_0.6782785851837747"},"_hasShrinkwrap":false},"0.17.0-alpha.d1e8a6a8":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.d1e8a6a8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.d1e8a6a8","dist":{"shasum":"9e3d60757406d40a13d10fe222572e7049cf2eee","integrity":"sha512-Hio6HPJ6Bg3V9NFkaNriWhv6CZ9Q8mxCebRDxcW+qe3VS11mh6vmDxsoYT2WN0kEIdivOjlKr8Szg2u7TTeBaA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.d1e8a6a8.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbaqRCRA9TVsSAnZWagAANokP/1Xok5D+VDBTfHNM6BCy\nEfq0xEN7W5/+IkVPvBRbzmtn6GD0fXF+dGvpUz7Y3FabRjHuNdtP0xSrtPfT\n1EB4ZT6Fc+BOqg3od1bUYqF+G1EExgYFLF8VhpG83j86ui9elKFdGO8wuy05\ngf3F54LBcT+xzR4C97MYB0WJFMlzuoYM2eBr9J01xKju7Oxgt2UAd+F7C0ER\nYDj5FYUP9QT48WVQQky4h+a3c8DZVsC6zOiIZIwFrCHA7vrnaDY3gaHXf3Qq\nfKq/yphyWIJINzmAU+wXUb89eWpW+I9ezQY0ZWt2SlrNVUB3ghl9y5U7s3jA\nWdgU18mHr3SofimSForWyNsRJiFwIUL9tzb6vy8b+rMcTcQqlwL8WX9FVkqY\n1ZK6NyyiXd031krpeXEhQxP/gSQaUDYpSryhOGlFIWwbCgjKoymGdYQjx1a2\nrMaafdhmyYbvtTZJaqNcmUBb3DNFJDc562E2oRdnvwE3CToMqNWVWuT6IcRM\nvq9oiCqmsFss8FmQXYVc9nsTF24xSTtKjXsCP0HHIKP6f27udOYlwNAkOLLN\n0l0ECtojOcO5MqffJXLygLlyxWbhqOVRUnnJWFYG/YmBwQ1Xztw6A4YlNx2A\nKE8YJR2MPpjHHWmUYfunesqvOa08n1WDWcO0DNXGlWanD+/7CmsOBMjskNDc\naVnk\r\n=w5af\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcXhhnShhxw+ZaLdj/3g3hRqwfxaYacc9sZXpXouZn8wIhAP7SAKBnVwXylheRhyIMOOcQwqAR4V+tVpco35XCr3oI"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.d1e8a6a8_1550690960351_0.7577782424484203"},"_hasShrinkwrap":false},"0.17.0-alpha.77b269d9":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.77b269d9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.3","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.77b269d9","dist":{"shasum":"6cb90df9cbfc9588f2a15f27ed8874b339cad92b","integrity":"sha512-vW46zOwM6oM9AT1aSwuAK5PG/BVr3uBq1WKQUJI7Cshs43cpcdVTntyadHz4awQiBNefar3Ovjd59y3bXLitzA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.77b269d9.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbmkdCRA9TVsSAnZWagAAv2wQAJuLT+QSZAhTgU9N76sH\n8zOeMI+bIqVydEY4cjMKZBlhitYN8y+COo5A2jteqSJjrsg0wNCUQ+R59sBr\nEt0n2+9sOmYmDTCo+spqa0Hh79pIavQq793q3SKb1RkWwzTdnlmmwPQhZZHj\nobeo9jBDeoJJgSaxCxhShhD4DdRiXdQG3TW7V+bpBhQlN7MGCq1sTDj3EYe6\nboXUmpV0N4lwfqQtAVJKvlKXPS2BweMFHgQjNYiswL0HHRzWuCyw9EPCkTy/\nh6ZdJCsPf2vANE+Pp9vBVpvzPoroLVOr6LEF37aiLeOKo1gyMNX/B3r1ZLJH\nEOf1Wsg0PUnlF7EOewNqs/Mhkc7wLklg+8h9mE+j6rWImhb/UeggJ8Svlmon\ngNQLMURxx1brm6LYLFX0MwXBBkcOC7+KnlyfnrmmHX4/Xxm7yVot73Ztoo/r\nJzM73et8j808h8KP/ALV7pl5eVvLf8+BPvmVheA39EtC/3llBhQVG2LHHnCY\nB3OdN4GFbnbbqrFfv/uIKsPQjnpVU7MM6xTtC5aNkzBVqINln5I8m7vwlA8m\nMn40AD+I7HWb/mbD4/VcQz4yDXBX7BNdtfAmrK0l+qdeK9NTGjGTmTtHz9/Z\nVOdx4wBkCvwVjXrAXOFHnuHq/cTTk9/qibfCWcVjZFVXqIL41sR6qK0J2thj\n3I0e\r\n=bv4F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDztI4p5DKy1Zr5KlUOCc+yz39KLVcV3RRK1gkmJsklgIgWIi+q8TCptgVjvmfoXN0O36Yav+iGa+wqryygBKizCg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.77b269d9_1550739740728_0.4177258136644426"},"_hasShrinkwrap":false},"0.17.0-alpha.458d8f51":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.458d8f51","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.458d8f51","dist":{"shasum":"4d884ffbe2aada6c1c169841305607eba72a6cbf","integrity":"sha512-JIcF2ob28XiZapHnaB4TE4dy/qaZjul1ncZo1WUhTx7bX8AX9fkEiM9cs0oLRXeTU+t4eM84Wk55v8gDsyxVaw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.458d8f51.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbmnYCRA9TVsSAnZWagAAMo0P/29EajLIQZJasdJa4Zl+\ndw6/tdDh3K42uapeyKHkRWILnga9JOdDCAKtr++11OBzZ+qpt8yceVcKfAzX\nyEjaPX8nL7AGmD/2cIeRVCN5uLJGigHivtFFMFXmVfXVN0bbkMZKxxH3bIUf\nX8pw8D9IkB7gEkqERC0ueqCxgdLvKzt1olaWgwS/JcluwTvEhJieSdS0OCMc\n0alnieK1ksfizNta6WX0HbGF56NKyyx3Y8kDWozAymm0hbUYly58NGYxC3Ya\nuyS9e+2gfpZDhQODS2ijSUMFjkI0WElojgCGUqQG2KV0MJpJ7RDQtIj+lYFx\nfY83ikfrPLd/lLReWlQwAwFhvGrbV/dwWerLpExCzQJWxY2tl188dskxHSVG\npVRAm+Q+bwpepT3Y7PGtQtJ2VPYGM2i1gNeG3Lz++pE1A0vJ0S+encKdeIOM\nkUg3UHhMd/OLCDxjxCH0ELYkNuC23dby8Y/QBAQKG6i+cOJlXdy44pmp0H7W\nn+f18TCmUxg00i4dSVJk4dU3GdLH7R4TiZPPdxaYwdiNZ7kO24lgOdiG5B57\nUp7yOUjnkgrkRKON5FGxDDHZk+7bon82mUCAx1jYKoCJ9KR4nZfYrTfDDHwI\n2Iju/lSR1v/aXKR11SKEJ+rzHitfIX9JRuNQSGaBQFFS6ZlSTmLEH2jq6yXq\nzDhF\r\n=78Cz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDepK6rHMXxloWA12bm1VB4pInIZ2OlwZwt/35gZtzgkAiBdZMRx9WN3GnxdmmKzFOIcejarM05TJha9rTRLKpb/LA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.458d8f51_1550739927244_0.7982515429809156"},"_hasShrinkwrap":false},"0.17.0-alpha.727c5e3e":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.727c5e3e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.727c5e3e","dist":{"shasum":"0863e16dc3b78d318f03ce7f8e4954d7e406f588","integrity":"sha512-MRN5JuFSaWqBySMQSbDkNy9WsiJVituIbErlXTljOAYk2xVCV9idQCNa9dVv+1MYp7BcA58+d/+vFh50GMy/eQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.727c5e3e.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbmnjCRA9TVsSAnZWagAAx4cP/27kMaBotQE6I+VpIqgU\nvhR+f6gg+hxlS2b1TDGMFUdkfpf/Sakb7nsLl0Wmglat4WdqBoAH9Z1al/yj\nZ70bbBczEUGRhMe8O/v1qemXv/mR8yPbc1gldYwcqWSEkkPjZtYE3zhBrsFZ\n7lp+sTNWbpKup+63UQybrx/rbW1YIMhz0A2GGVLyXG8yHJJt9RCh98LmK3ih\nNEuAk6dhgT1hlQPkTVadmch5DmQg9KpvQGbhSwjwWtI5CYG2v1APtycaANbU\nomUc2jBO+hhAraS8YNt3pXJhsB8CR+O5ciEgVqIahy7xvWzsS6sDasg+sgml\nuoxokd+kWg6Fp7qCcrMkQAPyZeDU2DO3TbWYgG0LpDN/ekh/rl68fy1TmtSS\nPFwTgY2DRBnj5Oa9dU1/kue4/vYqXdmJczAzr8Nhxos+KqZnr08qvRAtP2L8\nkwd62RecBXvc8e9m1LyFWNdRzpsJM0NN4Ba3N6N5sywjKBaA+xoW8cwnEfHA\nW+Ukbzc9Ee1lcKiLvsmLZQ6/uenMCcqo5eXMA8587/0YVoI7NyEjFjTe7DPC\nqXN9HR448MDbKoiNYIEosAkOjy1a3b/4cFJGm8rZe27dYPkBMmwtQNnEYwmc\n+Oy5BVPOVXfMmGkt5Yn1piXnD2BuhHeBbSr1ecSPfFlo5ud92UTCv76vG5hT\nXaqt\r\n=D8UH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCY+TZ+RlVUCuIfHd/3GSLR1/r6046wRtuKyPKx4kONfgIgI0usX07OxlhkC2Dwg/0kato9N929Ca49bhjIb1030bg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.727c5e3e_1550739938818_0.6484273132573666"},"_hasShrinkwrap":false},"0.17.0-alpha.630cecdb":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.630cecdb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.630cecdb","dist":{"shasum":"11a2dfe3a6a022c0085a4f6340100c18bb38dc81","integrity":"sha512-exbggByDeBffbWPyHKDiMGzWg57/o0Ht0RNwvRcfsl2MlPPnlnfny6+hIINy4qmVwiw1T6h+MbdPwC0JsNeH9w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.630cecdb.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbmnzCRA9TVsSAnZWagAApqcP/2tPTU2eZsYNQn6ozIRO\nS5mpOsol22S85BDSt5J1OXvx1Q4KckZXps3rBDOgvm5MBDEq7dFBVeWm/UXz\n4lZrCCQ7QuLczpU1JC8VfD2GZ//fALxowTC+pllHfN7PlWt2whvt8UTFxYid\n99SPAOuBi21yFHSbuJvqyleVzIx3ds5SSqUHXnPIm4TP2k/BFTklaEEl/qc9\nCUQgtrf/VRtExv8eDxJQgYAZ3h3pejVKPNZK3fOd69nO9V73VhCoWURRLsFu\nuZoftXsvckBcWCQGCaD7gElHC2eIrVuUzdB9ciMtjvIVFGTSuD0PskVy/QRJ\n11NKBa9/pT0vsj0wYrbHrTcnOot6Gyha2maeAX43Vbq0+0HUwMingBqW6CZ2\nP0G9jo3pCsdwx6LGCEHsIV4rR7cwE2oX0hAi3fbgkdJVCfgumQ9kd8bZo5ob\nKR6pMVrk1RdBSv/orodSEaKubNiFFuc11HcVoDI9YjddaZ3+cHmUykzvL6xy\nh5fH+wuntjMJT83MA4vE8P+ak1OzSxrnNb2swt3T4fjtX1M9JZvjWVuLG/Sv\nMF8OHz2280xTAydSfaPYcnWf+gGkXiIETq+LLmMwWzuG1Aq+HL7Z1oqV9lmg\nNhcyvntj5S1+XYzqIRfHrbJ4hfjDGavYaMWkMdO3Th1aeQX9jOg6J7zjy9jj\nX7kr\r\n=qzYg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEo9Cg7GPOIY1jAkYyl6fhVnh7XQktVcPloWYk4xcD3GAiEA38GAAE3SUY0mZ3v6ZnGImIdsSoGHwdsvTzwFVhzoAb4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.630cecdb_1550739954433_0.10979235829118816"},"_hasShrinkwrap":false},"0.17.0-alpha.fcf549ca":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.fcf549ca","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.fcf549ca","dist":{"shasum":"386abefbad5cff60cbc3a3efd9749b28f54fbb18","integrity":"sha512-zBiYvOdSUcWhxm/0T0yg+Uk1U2MdDu28CTYiMc+8MEnGgXxN9qTdUtSYuxJy56C9i8kVSI/4zaxVoyShNLpk2A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.fcf549ca.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbmodCRA9TVsSAnZWagAAmfoQAJuBDzg+xa6UPct/k5IO\n9V+PMfzsUkfzQcp4AkNM0Np/GsCfAj/j5cKJyBkThqn0tFgzN2vJr9CCx2Vb\nedjrE8UtTZ8NABrY3rx0nyJi6HioMhY1r0CzZnE5YaTFO8hqncIOljYnBmL7\ngY73ZSFH2qVgtiT9Ip4z/1rEBU7xwAAC4k7jiyZNcEqOiN8Sw3UF+cZ+06Il\nh7ldt2yVvA+9TBjdjZtk6Rg6iCxR3rwATpX+WtdDTlS9JjLIZuggoLp4O9Oo\nrYH9pkko6a/saTMmrgmg+gHqm7MR6eq4KJd18ENRHdREzNuzMi1g00N3LULq\nZ+Dly6XaDlkibnWH/6ZHia22lgsgfH5GkagSxrsgpF1X0S+RJB3oDA9YPuA9\n8wHw+J1Oz8Au2+VHT5GSoiawCvsL++tQuYpFIf0DfwDRC2vrcFq5a3x2Ew88\npxjei++Lbj9mXZub/Bifu2uyYIWkizSfNvCJ3eZNBM7HStqm2hr0xMLUywgX\neZTrmUqK3fV7jjvkzTQ9Yc0dyaOOzhWoD94zZe4xJdxj1Gt6auKHgGAiwlqB\n9qzUjhWXII0I0sWZASuOhSjea8bngFAU4iNBAmsjOp6R5RK4R9mOjUzT2SSF\n8lm7JguY/ObBjJQY/gwKcDoHp5t3K9CcjjEApU+aNjMR4DSJQj9/XFZMHyz+\n/RaM\r\n=vSRV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDV1QiFvgb1/UdhLbD9zEKw1jhyLRGPIHy6RM9+WvxZpAIgWiLw88ZUYaiOENSRotM85BuACXIAKIZRSSnYctar6wc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.fcf549ca_1550739997412_0.35253662028368526"},"_hasShrinkwrap":false},"0.17.0-alpha.5e86c7e6":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.5e86c7e6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.5e86c7e6","dist":{"shasum":"4ff6b07f1f2460be9189099dd466f00b946f12f7","integrity":"sha512-hne1YUeKEuhdd+mAYJw79j6ARus9Xshl8PZUit1SEw23Ox40PuJUerPkgjRWP/nbshtV73vsY654YE4pjFW0Rg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.5e86c7e6.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbmr/CRA9TVsSAnZWagAA+pQP/RXosBcZAOaDwzHTfc34\nMc8gi4OkdSv2c0EhMtHJ5Uc6k2dYIAsrP4xgi5K/vDCDzCMc3kW8iri2hPYz\nP8EadGIyNauvHJFuWTHzN0AcSUPA6I3gr6ZKoM4fqNn132RSh2KOACpEGPE7\nNYMgyncNjJ7CWFT3YS2xdVLnI+7TXGfiajBYvlFju4ync1Yg5XlfSlLqbB+P\n0cKXuyyWO8S3z02m4y2DD0+CkUVQqrbkuqcgvXbmkDfQs9cazYRfObPEtYVL\nbxjNEE92/R/kgDoEwTXmVNhwV2TXIrk3uw3NSIp/kK3698WmWEJRp9aE5IWw\ncNn5/LYdAznzBnD2lwJw9ocnryw5WT1Bgyd/cSaUFNc+FzuhafrAUH1o1aP5\ns0nhC+YDL2lwWfjn/tyaEHacdelMt5x+ak/8gTvjdWkbIhswcr77BmXkQn7O\n1gYtCFSK+mlqnD/O2cnmqOSUgJdltw9TBlGef0VXbHtDQ1rOpeL5AG8TQNbE\nRzxMawoc5g4VINgVijkGrnsbJVBoW9rWkh8HjKbFwp3YBPTsJXRfZpZo5D4v\noboW+jmrfM1Z9GBW0oZzJxhvElW4KRAeJCvHxmf3kQ+NpZ0MHPrf88i1Fkys\n+9YJApNJTF0gxaYvaQVbOzwp1jx4EGcPoTRnYh4+VjtjrQI/SN20Kk2Xz8ya\nNCg/\r\n=Hbg1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGhGVZfH7uDRWn/3VIvI5u2Sykmtomm4WIYmb3NCqIzcAiA67wUieyHNBCYZr33dD4RdI3Ev6v8vfNGaWX3XRflgHA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.5e86c7e6_1550740223286_0.9276624219463108"},"_hasShrinkwrap":false},"0.17.0-alpha.4b70aae6":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.4b70aae6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.4b70aae6","dist":{"shasum":"dfe5fa6c5d1f019586786f4d21f0e377dd82cb0e","integrity":"sha512-6a2ty6LvtLNj5zAwBQrITjH65uO2zbWdz7bqqN3iGtuROubeZE8dvmrDf2Va2GMtWnX8djNGltbqdLzMdefgRg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.4b70aae6.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbmsMCRA9TVsSAnZWagAAsv0P/2NTzYv5FaNTmPpMxGOH\nlDvnPdatoRMHyAiGQQPDNsaoFISbnAzMQ6iv1Sn65mI5v+7nAd5MQR9gBBKj\n/kIIuCGhKn72iBcLRPMOWuEw8MoVzxeVpOy9VrdjguYI+pOtG1U3EdFalECt\nVua450fwHFnMjgYc92CkKpThEvQYTUoiDslrX2fRMluey3OyO9NId/KN2gQp\nuDH0WJhkzI027gW/8KDf7pEgrLVRPwuIIKTNeNL2Yn2EVBNBmkcqLI7NYNAt\n96//MEreXQlw/NZQOjG9Y8BEtgDj8zCFUuvzNoQoKv8PwKlY8mxVnaJdsKwf\nm8iGHeLlCAoz6OPpo1BLK88R9nQsN6tZD6BNPGM3xdbaY1eRpWqEi4vjaVPx\nRzSYYH68cFXSbanSE/5A31WkBRYR7+vOwnSPItokVzPGCqQUlvmM1o29V7K+\n4AWrUnv3tdl2qZFJ6Un8dQytUi3dodSQ2FqUdZ7gwNXISM4RgkAaFod844cL\nYZm08/XSEbHF7wszfLQhUP06kBVCnxNY4KXRueA+NPpxEGGJXQJnfR95wLGP\nTGfBOqo3umyVW8RjDPIOiJ+8RVvxaA7lEuGGuVQHx9mIVJ5P/9GzgX9nWNfF\nvvJUfRuaOlVG5HwKibXbfADcro/BKSedbotNCjZShbvvLTFcY8JjIWlofG0Y\nnpuz\r\n=oF0N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGd4+muJ8QqOP+4t1B0XBNAdh0OjAhC1E7S0FB7dNbZlAiEAz08gDUyq2t75HWQXdDS4JAHj/AsAvT3aCmLUoB9M7jw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.4b70aae6_1550740235570_0.7657002631916374"},"_hasShrinkwrap":false},"0.17.0-alpha.d1a322f1":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.d1a322f1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.d1a322f1","dist":{"shasum":"aaf562428f2b0e6b8dbfaf1966ab5db17edb6065","integrity":"sha512-hHrU6POdKSuP6CGqd0Do26WXgTsKEua7gHY7yaTjZWNqyeZroysrj4gtlhmngwpEKDH1j11bsKfIxR8YcZumSQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.d1a322f1.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbmslCRA9TVsSAnZWagAAlncQAKJIzusq/LIMm9VEBcvY\npBExi90cDiKFskMOe8+v7R0PGMtF608qSDJbDWP3PjUqJzl1CG278S03aEJ8\ngOOX1xeRGLW2Ba5jXd/qZJ/4lelCr4mC5FhxTXQCxKTSAwtgsNBQhiMQYaNN\nmpGRRyX9HzX2jjbKOJB3nHhotfj1OYGZf+YTGdyjFQyaMD8S6wdTEzNiOdtQ\nyDYPyIDTht2TIcjgcCk8lX1NRkDfoGQsc3qd6JJnsVY65BLMV7ADJEaj8NB7\nKuLM0wKBVNScQhLHSSjUB5IuZow/eza9n3J9k32gup4c3enOY2mxfojCTJuj\ngHKSB/CtbTEotRSV28vCNSafCDJZS3WmDMfRUrymthbx7EkTaofCLoAl4LSV\no4Fq2Ww2bqOrnIeaik4PYz+5JbkEt2+wLwRm58PTWBnTtJttrtXaLEg9lg6F\nI0632wV2rgdgkAa97GT5p8RpIsEQJSEBXKRz3RTmriMsfpWf6eMPWNiU4e/4\nOMBBMAzvb7QquQ7s9caWz1nVGJcqNnej48GHxnUSaytLwy4wuzkFpjrHc25b\nSsA+eSteCe19ijuVTe3BkDNXQw5h1zIeV4otvufIDiM7RGxxZBxTitVPeB0i\nbwlFtt+0t4BMbuJhs4ZF3LlccGpk4vvTcxGAXH+XJa+GRdMkf+b7yYVZ+JU5\n4aCj\r\n=Q5zz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbSMJjYZiBIb1ZmHkzhxHdmKCzXot+bAACVjWMwd2CdQIgdJYlsWu77TFDJEk+Oqwa9r2BBnpOaenJqy3mbqNjP7k="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.d1a322f1_1550740261299_0.7070393563059227"},"_hasShrinkwrap":false},"0.17.0-alpha.7f9d17ea":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.7f9d17ea","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.7f9d17ea","dist":{"shasum":"d8d6009ef9320bfce4dd8881ae175fb8775f3cbd","integrity":"sha512-D0wm3JWd9QzKLan25abIpecT8q0JBiK+bUjR56rQiQW5akyrj5d4Bhsl2nBkydSJgnGc3Saal86EUmD8xilupA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.7f9d17ea.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbms9CRA9TVsSAnZWagAA7yoP/j7/liNWfx3PeLS5fWtG\n27CPbNtVticXQJ3Rdy/qLHpfuCcP3kqHlA2Ok/G5p+Jvda3HNuaLdvd8hdkw\nIhzu5Z+U5yOHHuCO9V+f64oe64nawIFCBJZqKLwxTjCdh7lkbu+v0K6bxTJ9\nwjVC7jyQcG/yD/78JqUTrT0mbyEHu/tMC6n1/RHUmMxtkyLGf5ZSyjHCXT3e\nuMS1ZeAeeZmdjhxMGsqHUEFgn+U8fuI+lAA2T1iYOi98hImes6DcB76pZUhe\na0yasdQgsWQrtVR894jpclH08rW5zzfsONV05IWeud34TQsFgUh4aMpG9Mj/\nx0egrOrO2dxhg61hEEP0AF0z1Ci1OTCZKI5M656ZZXreEqVVQT3dAh/SCnOH\nEXrY1b4fzOvjV2R2MY5CCAp5rSMpXnBYPZ1MIAlFmUUkMls2+zizh8NmKm2d\nHSkr++xnyfBgDttXW8qg/TNjPRhIyVGUNJ/F1ONCZNvf/kmnteyXpAr99uJZ\nzRqqK/L/rAwMsEkdLPZy6M+CHUpjdswfR4upihUdyhVvC1nkWb8/QA3QZO1p\n0yjzR7Uc46S8hwIvIf4jCvuw1V9cWQOyY0F/qpoV6pJ9fsXSzKHL5QMN+p71\nvSVbwp9qJ1yKpBtqSZmIxJEqQifzqRsQhyMQ4jxaagAkrdimYEqdIkVPFuTQ\ntQDv\r\n=GyjQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAHCvN+hNSpQ3CxXmtr4LZKy8fuBUNyVCnSpKigWB1XUAiAHftlAMHUd4e2n/R8mKlxIDvAeyLJOx42R4vq+IzAy7Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.7f9d17ea_1550740284822_0.42716804179363277"},"_hasShrinkwrap":false},"0.17.0-alpha.da193459":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.da193459","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.da193459","dist":{"shasum":"4de4e0c74ff79cd673facc9b9ce59a05297271a7","integrity":"sha512-JBe9j+lMRxPOnHugE1boWcXz40PHI0X2Px7Lc92YRZ2soswUHLS4kOkWlH0W9yAyUqx89Lt054zYRAdRD9Kj2A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.da193459.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbmwDCRA9TVsSAnZWagAAGGAP/i3OHCUSTtTHciaDzzxp\nB116HwLWbJrF7TqIqckeH0XyLYsw8Xbd+Gmem1PAM40/z+olJf7DJoTxUWp0\nQND5ip1xsaYpyb2iIAH2j2XXO2XTnr8lTSk3Y1euUUyrwfq+QIZoOGtNPIVn\ni8etTX18FbxU6qf6L/nqL2oKvDMOpwZkYbp4mGYwelrTCDGwhkuDXQ0HtKUH\nTAqBgj9x3qz927mpUjfmXnyywhgwyfIwA5hNPqSUFA5rnrwRm1TLRA6eOiU7\ntpaqhCjoaWzJ2rDNWAvgCApfe86JDQKdM8OMY/NKFRkduCJxLiejFp/vBUm2\nijzwflM1dm1kdsAQ/M6vXxdNnZUDhnjHCyf3INIeyJFKah/FnmW4z9iwd9yL\nwRJ0HRqOiOouzCYVbgh0TUuv2g7hDh6z0xZFcZxu6WtPYAs+8FK3kln2U1x3\nRxz/xrk1dWJPE0VhjOKM+vHo5nrXvkxQWD/tivizVpdso6j4Lo9Iuo90XW0B\nWGUzuMkU6dUNgyS0IRGwqM3NQ3XWkWt2S14mqoI1S2gnJpht5XEmEDS3HPG2\n3VM9XdTRH6zrSpVjPEHaYJwOQtFDZafB97dFDfPYBmWi0M66x99cGNuEGh94\novas2YUetOOK2zyLr3wmMqLm1YKc8rvBh2A4UbIkRRa/DBKX4R4mnzOe0Rad\nvFqj\r\n=IYcZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5uotcCSHEt8RdYG2RARXQT3kbaPmkuNj5C28tgZCIfQIhAMtOoK/Dgj3uPz5rDhdbz5CVafiDtBmC5rcjIssC2L5c"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.da193459_1550740482666_0.17722784574459816"},"_hasShrinkwrap":false},"0.17.0-alpha.ca704153":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.ca704153","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.ca704153","dist":{"shasum":"00a622f8d2c813a9c982b49501a6840d4de1031e","integrity":"sha512-jfYOcG5/qniJKCYbWOgTNmh/sp2TdK8R71fC3TZfD1qnt//i2bnsHdG8CUdV7z/QLsRKH86BJ2m0WPo2HjOAJQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.ca704153.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbmwSCRA9TVsSAnZWagAAYi4P/1N38D/hOkSVyGwQ8Yhj\nUPR6Gj1w40v6mdWHm9dft2yp4HXtkdNNI5ieP08ZEv4I+lIVtDmoCgTxU1dP\nmuSnSjKvW3Nw+Zo5bAtpXGhq1GQ46MNeHvxdUdW2ZUiWEg19Mx2kpbOMKfFJ\n154sX/nlbRW2VDSjlHvVb0uFWlK33zksA2MfIbnqetTBKS+b5J29BpLIid7j\n5ckWrq0qMFy1p2YQPkqvyRiPfEzBXdTOPVukMVaOjDss72u+jy+qmpuj81Ik\ndOp1F3pAqOVWiBOKdgMehjeY415poddIZ7awLaDEg+iFdlFUAMjNurjLbIZY\nfIPwKpHnDWa78xPkI+YP1vMdG3cS90MzYSOcucJt15rEjMDN9k3k7dkTSh2Z\nNOaDPBUWGoMJSxOWirPtGQ8pg3zmLMdl8JgrKx51pGjZhz+M2T4xj1rpuisc\njNATOB/rwBfzBzwZSd0u9Q1G6Vi23465bPl8VlL1PonVeufJN4efikra2Ck3\nOnE0I0MWUNUOQt3Qqc0a9RtnbDxaeS9n4/Q9Nd8ltx/0mYEbkAZxLZi53jLW\nP/NeutnmldSMZF6kjnAV7IXbbOJqkTHhyhJqbDvUDsjE6Q8A5+zR83v8d9az\na3Dx6Nyu1j6XlokuHT9eExqDKT1hKO5XeDyUSGX9FbD4a2Uomp2u1y3O3gRf\nBBvt\r\n=U7nJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICZWwsflX1Mu6YDwvDWg0CUI8acpvRgsU9PS7+aG3SerAiEA10NV9ocDAyV5yZVqLmm7s7TduplSija1YgWZmh7DVWM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.ca704153_1550740497952_0.9104278662467358"},"_hasShrinkwrap":false},"0.17.0-alpha.64af4343":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.64af4343","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.64af4343","dist":{"shasum":"e0d09fb1033c3f5bcb0c1eeb8927a7081fa6f63d","integrity":"sha512-2b8G35gk/TNQdLu1CgikCZECI/YaHqGbnql/y3Jj/dzb4KwaO2kZCinq3NwHx/ph/YYH5wlTpo9HHHot6A0j2w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.64af4343.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbmwoCRA9TVsSAnZWagAAn40P/iLee484Y90IB6+4+xDJ\ntGgDXPszJ1EUkkZWIEue35Q9/wSGNfp2BXb/oLJ7DVtdlowk52U2/jMig5kC\nl9itEH+W8xJHCFmcWJQbLraZ+1vmaWiJ/9CpgfVkuEMOrYXdUAOaCYQtTQvj\nGukGHiHxh1LJTEh00KFamPsrBaJPwIRVt87l1DLg0O4gvb05Z3mI7sNM3nmh\nAIbaxI3aLPG3ENQmgaWcZTbMlmGKSDl7pmtLqbzJvU5P6gaSGLM2U+YipD7L\nHHxbZBol8WSTAsRbdAKlqAbZoh8ibEkFXHdmgK5m2AOiV0NCnX9aTD8Qc1Cj\nabehkI20E2HwwWTeNWYZagWXOguhTrcNUlCPzCTdoFHYR7cxOS7nP1NW5Pb8\n0RoqtkKx1OGtLMUo4ySuRW/n3qM1Sa10MFO1zi2662frX5rW9CwUr6rcy+LX\nYlu3SVa8iI7PsxFb9SekzDtkPOUv++azt5ABXnyQEtSVXXdtr/xjZVRxlmq6\neAip262JGlOH22dCYAk+ucp0C5Z2MPeQMp4wxqO3SmJgsSPp7HIA3g8m2skZ\nD3P6geD2BrtG1kMRyostOe1xZR9ysQVpIbFevQ3MQGseXaSmMWB3WR5/Qvtq\nW+I7gfcBun94vGVmblENNnfrhdcrRoZwvIj+gS2ejtJrrP4UBwr+Kv4ufVv3\n0wXi\r\n=diRE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZhMYtbTN4kdlqnJakVxLjLmB9hWPreTbEgilH4DNlAwIgLH63UfsDtfejl7RwDXYzs9C/IzUi+7DbgcmZDCcxZlc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.64af4343_1550740520154_0.6236629574309462"},"_hasShrinkwrap":false},"0.17.0-alpha.5975d30d":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.5975d30d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.5975d30d","dist":{"shasum":"4bc5ca6bbf2dede082351f626abfdb7e32376af7","integrity":"sha512-QvyxWS6TcrFwGc9GNKRxvnq6bGcrQjPSIU5PQbwdzZnphb3ygmaIMFlIK14L/XY0BEV4dJvoQSAGC5x2bPSKIQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.5975d30d.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbmxTCRA9TVsSAnZWagAAxcsP/i+PfwV7oDKMWuXR7BKA\nS2twALBaGkaP1K3uNgoEWHx+jR7oTfVpWrhSNOjU5UXZ4Vx1s7D2+HVFEJ4X\n+azEbwhIiNqHZ19y/yN+W+AqQjkutzG80VA1JSKt++LdnYeaQ78P9VJwjD1w\nVamBXXOl1JIr+ExOt59mTMa3tlhE4ONV5aadP7LrWoV8nGLOtHNuiy4L8CbO\n/iZyzzo/gt8g8mo/aehFhbjssmquLycwdAh4AZSf0mImCgbcDWvwJnVdmR39\nx4oltb4c9EgvAsa/sPyABc+G0PQGMVGmtybbjZnvnVDAKsZ5DYPiZbFOue0C\nuIowkegTlxDWi4WI0meLbaQTd3MAHae1oMgEESk4kYiHdm3fDwJjT+qBJ24B\nJjw9EGuXCo7XoF6nmTeuoeil+RV8EeqGQ17nzjbobN0UImLBe2gKhxe2Bj72\nN0lB/melUTuaGPoc/W0GlKEW07pyYyXtkqBrnl+DWc9VtYUg9VF01IkrQ3wU\n5AWy26HRKKl1fT6QQGsBnCCuJ2EMCUc/niperLIlnUakrGTyEiFMXBgR0lwd\npkiDWFV9ycZnipMLZfq/Kor1C4hEOiIb9lgSEIubweHU4Xnqh3wGIwfBWZE2\nENtq4MXytbecJa0oyJaDF98oxOr9WJ8/ED9Qhn28uLJ1zIq3dXxQJtg/YxP9\nih+o\r\n=65tn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB2JWD8WN1Cf+Om3RHg5/x/+uM9ZYovZcOvTtcIpXzJkAiA75xJSKnQfiRp/87G/PmMu5hoNtBGPUtvY+4KkZW2TgQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.5975d30d_1550740562172_0.2659743966686132"},"_hasShrinkwrap":false},"0.17.0-alpha.4e27ba00":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.4e27ba00","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.4e27ba00","dist":{"shasum":"d51a1cfbd0385578c2e351b2405c2089142dbc4d","integrity":"sha512-lHtp9pdt7ELof1swehSw1F7/nM8HVoDB+0ECZX67C9tPVqraDuQ11K5dBXSgkAekv7g6YxexuDGZFG/0Efr25Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.4e27ba00.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbnIQCRA9TVsSAnZWagAAUaoP/27bSUtsRRUBJ/bVS76B\nzHb97493iLdgPaQvhgT2T3FuvB0F6PS/BQH8Tj/cjna62zvjq2Spg4Q9ydZi\nCSzKBaJuBtSq02RJKX9iADIoNApbzZrWq1ekvZOmOiva+0KVTfeCsDwaMDR0\nYm/HWdZ74a1cNFGBVnaqqHc2tanm7I0H14ftqECTyg1btQFD7SKefKHdS8+x\nJKTT8iwdleHtREniI3qA4wQklSRfKj8qzf4eE7ZzJAPBcEllj19gpCFtVfeY\nbETVyICe0CjKJr9qfCkO9xlcZ15YhmA3p9w5r0Su0YccdNnN0ZF/8ugaVxWf\nvCfxvj9Nw80N3KV+oWLZQoRwGtUlONkBTgxG4NBpSdl30D+OXwMk8QccjR9S\nAljdjFfYiwR+rJTTcO/T74N1kqHWItxpeW+k2V8mSOahFr4CRRTYwaAtmxWb\nIfJxbr+aa5SXGN2wHS7kqyk/fN/NYuuf+wVOYDVs5ABw1BNqjfSNefN0S8MU\n26zBiE2uhOxqy3v9j45P1d9M9GCo1ujK8OvYnSQGGiQA8I2qQf76OviPe+11\nuSX8z6IZPTmJQlGE+UoXGUt5LlyBGb7M8bHXny/QzFOA9cYt8LW7PpiOmY9D\nMdF/rVatzD01njC0hrb6zpbqRlxrPvnhRR5TLb7V5hP4xDYDDIeHDAO2FfXI\n7fWK\r\n=E5H0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDquD+qQvBQ2BHgeDEJS0Kv6LSnkrSBQu3GYy0KKTWOxgIhANgQGPXrkFntf+O3KPvFZ+u4Xrxvr5p/au3jU4dogOAL"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.4e27ba00_1550742031273_0.868075615491487"},"_hasShrinkwrap":false},"0.17.0-alpha.5ec953df":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.5ec953df","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.5ec953df","dist":{"shasum":"7f275fd6a5ddf3751b748e36ddeef56b0d11f856","integrity":"sha512-mJXK6T6NOzV7LajZ6M5FPku/1RiX26udSHTscshnFQwvMur2FUEV04KrXPh1s1plq5xd007s2SXMUdK2axS15A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.5ec953df.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbnI8CRA9TVsSAnZWagAA7e8P/3I1GRyQR6dnlBURNiWX\nCu0H4a3ilAMduXSSf53ddZZBVqYefxMosNfhRbxg2S6msPyVPsGBe2jwoZrv\nmMtvzc3ddJhWERf+IoBDzAzNWyPQMXkyMZigRcofts1pVwZa6HpGTVELd9/I\nwVafiM3PdwqwQv6havuHQaJfKxdmwXraBtRbH7by0AX7aREJ5xPw0CmyP4iI\nH6xVQtAEQQbASxC155TTPjDjdkM2bJSX5kkWBag+esLowVtPJl96E0no/Wo7\n90hoJu0LLR58TYTcbCEvt1j3IOx1VEmIbscqoUod1b1jmZ+mJSdr7odTFYO0\nmVCBbP7ONvhlbD2Rm1q6oKscNAeYYRaVcjTs7LcBRDPwCRNi/n+qMY4MMGGZ\nyDIIi/SciH4JVvLC/lfbGpQwzv66jHb9EdGXIpOW6TPuMtrY8/xsyZ4Mgfij\nYjmD2tkvdaw8AHitRQ5hZ4/BBKJNVul6LYemIlJsAsk4dztdh9jhzY7E9ppY\nl5S54LtbNWOFs7mXGTwzQ5FvIyIR1PBPFjZhaqaxGq3eZcu1/O2QvVzpVPLV\ngO3wtSMSjKNqLLd21aJSnOEKUsrTU0H/Dwzg2tjeQfIzq34pnNSdyZMhbZJn\ncnTbpbZUy71+ZTGm5Lot70CA08qQ7kQl0bU2uG3H6K4gI8kdvVI/c2x2LwNS\nbYT9\r\n=gS1d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDY3IrGsu300Xib0DwpQZw0W6/c5pbj6EWwd0BxYRS3rgIhAIGQfGQmZYwvzgtVlchLTRiHCc6WU7aJQZpL8Mk72ArD"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.5ec953df_1550742076089_0.455130210021357"},"_hasShrinkwrap":false},"0.17.0-alpha.8380d996":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.8380d996","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.8380d996","dist":{"shasum":"a4c2920444073b6b389ce88fd01c23918e97699d","integrity":"sha512-Y83QE1RX0TeFk4wk7//Z6PHwH9f2gsKtyUv7Q4AWD7s7F5Fsin/mvOBpy0nLfHV345zKnrEHvgRQcLp/oB6fQw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.8380d996.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbqRRCRA9TVsSAnZWagAAEcQP/0baDSqzmisqqk5VSCrw\nND0o6BmPHYdIBnqnlNLmuMd7XG6LJS8OxcPD+f7c8cPLl9qnt3ejqKh4lUAz\nIti71npp8SzwfO4Sqqihzga1EolJoaSOw048RB3JZWZO67Usde0Ti9zHceJw\nWkqKksOyM4Ft/skVDQEDruIdETtx9gQP0EYEolV6JwPPWD7TLteRnfk+DFel\n3YbgGkA6f61aHfginVW6r7hJdTACUGuCEeIJG/KhENWln6mFPvxOQhGA162o\n01pPmB1asHbRMEIRO2Qe9bItr6/S1YGI5X0T7z1HtZAVyr1wZE8Utoehi+kC\nlm9ehusAT1OtzFkEFT37BtpyPdDxirI4H+SRA75zPCJ8/rfEQyOfVVZO31eV\nmE2jKN9xvDuqR4zYJbVF6vUpUqAc8lUIg66k2EGWYHL4EZr8HOtYNuuO6srS\nBpfk2s+Of+yBM+KUZCGcy3gzAO0wbuI1DvoQvAJZt9et4Ol4O76FzEo9SRY4\n3Rytc2q27C8I4GLG090sJRBhMgoWl9ka8arb8Y8EM2Wc2/3J2XaqUPsz9b3J\nb42/H6njUZfuhDTVvjoX+fmlHRGGvy00zgxeXlILCFRzREllRQIHQ5ibi9/p\nTCy6SAJ+Lilw3xYJzsM724V1BQGeMd5cw/4gNLFgyuQPwUsyb4yo4VpPanrv\nOrzh\r\n=/SeU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICloZoVGUxaGdXBHJTwX0dZjLBwI+6PH27wJN+D/LsBiAiEAnPvGNauxz0ZsycCWlaUteJ+t7XjmLqmDJ6GVVle4ZB4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.8380d996_1550754896303_0.2894154773517106"},"_hasShrinkwrap":false},"0.17.0-alpha.e09f4a1f":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.e09f4a1f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.e09f4a1f","dist":{"shasum":"9a379c5dabe593d347a50546f610a188a60fe910","integrity":"sha512-5jFbnrMTKKKSTWYuVProBya9YhRvNjTZba4L95YlvLhd1SGy12o/1aJ7YWcT6qvlpoyhEHUWiRZpLYH/vxdjEA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.e09f4a1f.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbq5ICRA9TVsSAnZWagAAMRoP/1tUEhTojLyzR/ZILhpr\n6l7NgoxPus3di15yZYea4S2MK14eB6gLsGds2vL9Wsfupz08/OBApA6xs84+\nYlOnk/TAzI3sFiIHBp8KujPm0pMIE/fQ+/SBWK0sa3HSLauZVzi2Ae0NB2fb\nk4X0+NK6jkEWGUCd0UrDpmkPlIlOFjILO/XySGMS1KHGqRQDL9jqeu4wmWAe\nr1jrsyhTA7++XHhLdCFCaLaI8Kj/+5nWEtxKBl9ScpJZmDnZMVu7OvKr4j2g\naEWRVX5A8YuIcAY4BiSKgohzPkO+f3jh7xTmpjH5I1SZms93KAJxX3L+6fal\nnD/XQgh5eV5G1LP6qblsW38UkV3wP+CYf48re8ovpVq668gKmPAzJr2yo5RM\nGHrwHRQ37/5/AvFWDz5CXXRte2SoRFty/9YNBce2RX1PFUbDF12GxKWA64oh\nUmpwc+jmJfntXEZCWjzfKlqKJHRITgqGUHcRXlMGVT4E3Ew+/+3iWWutuDLr\n0Zg7ULsyDUbSQSfZqNvDvQMCZ7UiyZd9P4rxq3VaitLeFRf8DoZhDN/0W6yP\npjpIb/L0Teab6syplraK/svwFYyPTo2gEK7kGYgFK8UuqICdJNA9nhvLRWfe\n1WFCffrysonpzW1i57MC77o5KW29A3BEX/U+9CnCFQqjdFBYScm8FHEFbcjb\ns4KR\r\n=7xcM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHsZeD2Ye3OgIhF2nHiW/xRUdfigLKAdEPcJKR8zw4m4AiA3pgFjfNxTpD6SU+DeLO60UXsTq3RXhkYTBi1WopCZig=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.e09f4a1f_1550757447353_0.24376791383611085"},"_hasShrinkwrap":false},"0.17.0-alpha.4c63fab5":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.4c63fab5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"23.6.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"23.10.5","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.4c63fab5","dist":{"shasum":"0ba667bdda9983a344a1932126ccccd0c7b817e0","integrity":"sha512-RAK/DHotGFgFFDi6064NZ2i/3WqYKslDxAUs9EsBKbrWZxESZYX/ISq/wzPzHcjV9H8il48FRGJSJz4Rdmninw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.4c63fab5.tgz","fileCount":17,"unpackedSize":16000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbrsZCRA9TVsSAnZWagAAyusP/3FxAZPXlksTwbj4YWe4\nTBHnCV7W7SO0oa8NYg36IAFiWpln18X4I1Ei/bCRp/OPJifbOtl6J3Agyo7u\nPdZmTK6hhtkwGyYv8FdakgSGfdLH9y8U+7AwjEpVdSPJt4Fpu0/l1iLG80pZ\ntHUqjnk8YQvxJME+OaUiFHaru55231FPnoXXj/ij9L7qQpQu95csDkSiSAFj\nYyvNvYk8bsOeB3hTZCYBaEm4A8x3zNSXqOwN4Cm0NregXwx2K3jC6zpGDpxq\nDOyh8YpjzuMBFtpDL5pspBJgU5/CTLKuGpVEZRPlLDGbO5oMse2Y3jlt7qom\nQImHfU487VfrkpyaFX2Skf59VtXx2zFMMqGz90sI98A5xgUn0AcxhlGyTvjt\n+pbwv5z49pFPMpFwo2dUbJb8KC2duUyo3PNrTGgPIS32jfsi/NzKSpbc1eba\nFbKZkngj+LR9etxO53CMLVktptxWV/hxJBimVFAOdIYu3T0rYfKkr7rfgbE/\nSEPC/wNF16XNvW1A2+J9tsnHJjZKtZJqk0yh72wKc1ryk5hX7zA808yGDGxr\nmX8QKB2GCBYStjSV8m3DPqEM5CoO7KdxyhAlBq/KNbpgZwVw6i/fPk+BJUq+\nw0F/hnUyqst0yxuBWbHBeZnOgdSVDQFS+JZuV8aQhG0+d33B0gg1HSmQyzAn\npf6H\r\n=1w6Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAYqJ48jwXB7KSqNFMhsBc4+fXmakPEDe3eHK2e1bOQQIhALF1pPyoSgnagkxiFPIE4b8iIE/JuLF8mZaqY+MpMXAv"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.4c63fab5_1550760729139_0.21948443209215607"},"_hasShrinkwrap":false},"0.17.0-alpha.55dc885d":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.55dc885d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.55dc885d","dist":{"shasum":"1158cd08b62f8e1590c0e6a5e912b0a60ca67c07","integrity":"sha512-6MISqLiZ7lQYvyS65odi/L2fdwassnrd2ZpjZICftayZEwOz3vqyHMkOoFy4QdDkNc19+qh/H40utq+rTM5quQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.55dc885d.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbr/9CRA9TVsSAnZWagAAnr0P/A37pLChIJ92iKFb22Bw\n7xPSXOBvizLmp1AbzB8/pofBV506hZoyo00yYGzWPJynyI6WRo4KiGaPVZtb\nVa7WQ6p5b77twmwmcXu/jW5Kh5rEapepPyRCZgfqDxFkCdycSkSJRShUbPny\n0iuyhnr2hDGwpjjlsRKA6yfleNEToOFlQkHdvTJG4rsOQYBWS/l9kdrEDSHj\npYUDxFy4Cwfu4lkikD5MvsqDrg7/5j75jAywyrXMBo+GhTXbcrM5R24XkxGf\noC9uiCpSalNcbpP9cu2Wt/SFYHxyTC/mwZlhE2bs/Pd42RQSMgFmuOXpSnR3\n9XdmX7FOD+kJZEu8dAPp7OrLooK4NZVD+MsMohG0ztbZ2DsMkWndMpBAlWi6\nVD6CQzSHWS5zdSVXc2xzY/WblT0t6ia+t/ruVEFudpquku4I42WHO3EIEKDF\nOEUufA7Dz/sZOs+1SVO//i6mI/lp0M1u1Pmw1sDOJI0ON5WywS5WvwRXeN1K\nm03AmuAgW/ZtwV+nISskc+4cG5xp5uvjyM986IIgZKNj9CrX1RUou9n3oabZ\nz+HPAuUFSGxkECCN4pS+W0wPJjPp3qmA4i3OHyI59Z+gzwzyrgrGO7LL/pXe\nVVpbfawbr7qQmKK4/2Om2K9OKihdrmSsVqBBiQuNSQhMPoC+3KbKkCnzjrk7\nVkrU\r\n=rRTG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEIE6u3Zwaw6B6D5iz3jrsx1a6OWjVryjf7V4AoJ9XEYAiAa1s/74Cg4bwkhJdiK81bZANIoBa9nOhDGoZZoUNHohA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.55dc885d_1550761980468_0.9009095346736455"},"_hasShrinkwrap":false},"0.17.0-alpha.c66a85a8":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.c66a85a8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.c66a85a8","dist":{"shasum":"4c711aaf9c893266a9b48730e85fa31fb026a2d9","integrity":"sha512-k1Keq7k8EhfuwY6dJsioqEMFnWZpQzVR3XuOHv3Xj8bY1WUxYOAiW4/IqfYycOe8ZYNxxW+Kk174lvpj3Pkg7A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.c66a85a8.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbsImCRA9TVsSAnZWagAA0JMP/ikdPmWvBo7nRfx2Qt0Z\neW4mapSviI8wlMsxfKg0ZA2Fmp3U4Oy4aMwQk6XP3I4IIRStUavgZBZCOrE9\nblbbuD6juBL6hX99uxkN5kbi9ivMoJuaZnM3I6TIAaEFFju+qpUtl/s6XtMz\nkCui0zoFUBpOfmEfLQnJTK8yxgzCvtcOgslw6PxiELZy/Hqw64xnFNPqdDp+\nt1zYDSjiq61LTKon+UR4WfXDPzpDUSnxb0VvMb8fZ1Pentk5m8TeSh0sX0t+\nVvQXq+OTQmkNX8iR83K4ywxEeJS5o6QDIPSHsq8MHT/rugTZIcd2ckEo6QxS\nwhQvdnXiYXcqo62OWQI4yZUfqprrv147H0tuwIi8B4ot8Qmx0PPrO0NzEGyo\nJqHpxz2l363+H9lC/sqCQQAaIOYOL2XmyTHnM2WSMU6z/aZUv0qpBiLecflr\ns2JICybbUDUpB7XaAhfAxRKekusSPicyyOAfQ6bvb/tCns6gcQN4NSN+3ml6\nrYLE1dqlQCtj9Bj9YaeZi6B+b3+uKoiFFvtvcO3T1rDOeRbDQBEHhYHyJeDy\n5eoKhtB0pYYQS1pA//OZLuB9p1dTtLnY8mhMm9JRSsiovYiPtDVeqGBCdfyY\nm7GzNgAUEjsWlOcUhOCi1FZUk7dF86Wlm6iqoAqyURdZnbOGe9Vdid6L1Mcn\nUr0M\r\n=EgK9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9OYKXzm1HUn/eWILwToOTzJgC7OfBVgR3pPUKz1yDLAIhAOdR+qT0RucAUSBkWdmztotqOc5Y0zrURFOhMJXobUmi"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.c66a85a8_1550762534127_0.17915890735756324"},"_hasShrinkwrap":false},"0.17.0-alpha.619abd30":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.619abd30","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.619abd30","dist":{"shasum":"594261a241cdf1fbda1847c032f403b26677131f","integrity":"sha512-ez5GMKdxYv4shyQIcLj4nl7SMb8MZHYuSYw3g2YRklCFs6IazHmgybHVS8HqkPbWMpvBkVm31qM4Ku2NXb+FFQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.619abd30.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbsSmCRA9TVsSAnZWagAAVCwP/3fq//z/vBJaTzSEnc/Y\nToRX6Qq5GRFlVkp8AufjUlePIgso8u70etdHqXy/CD+7AL823/R47+k7HpkX\nk90ovtZPZoKmhlcwJqlzYX7bRfyGtQ/5WtTMXdIFTZR8sbq78I+JQqeKVG/g\nEXASBSMPG9MNixVaMtEixnCs/R3cHJWNW5C0D0VomdPie8AUeWEF6C//NAwS\nvXkex0wXZVUntnDhhh0D4tvG7/CsR44mrT7IEpUWckLUFqcwzTsAK5Nqn2MZ\ntoudj0cTGMKiEB26fr1P6V5aTxWESAMeur6l0dfAJFBmdv0pIUfEYkv6JOXS\nBZ7wIgApKCyZQX8hLL1fRuZVvwE3dM95IobJPyNYq09LZjT5TeBRBvolHwRt\n6y+qysqw0za7HKQM+3Zy25cyz1R8fZK7boeMeFnvjG5B6bWoOwojhJhxdyF+\n4ShFyLC0aKwwEt+q2QIkD1DFr5ytNZjIPvRcM3hUIYtVOOMf9ldaysJi1nS/\ngTP12u33gBVU+pnX3oGKyOAq2AL7eiEP1R7eqFkKis5+kCxRNx5rOxX82qB3\nt7tesVmlvPvCKmWcl5GLQ3c6awULUVwxnh+s+iy4oMGVvVNCKy7LGZ6/Y/Km\nvlJpt3UJAWFR3LPpekz8pHiv7A5cMikQTTme8mkyfKQpHdj7TUcwvVaroYkE\nqTc8\r\n=ru4s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlSrQdLAeRvOV5jDFeSfxsqcchG/iFSCrurLRXchz2xQIgCBh2I3+NybPai74qU6nC61ZViChvmJ50z33LjzeWOqY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.619abd30_1550763174365_0.5700857409875182"},"_hasShrinkwrap":false},"0.17.0-alpha.97d32252":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.97d32252","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.97d32252","dist":{"shasum":"794ad6edb17800cd457f603fde8ba9fb5650a39a","integrity":"sha512-wjXhazX8zf/Elylu80hDFiEqqURp0r/LF07T157jAqjYqpOCloZJE8mA9nzF+OS17R8TPft5S2oUhcpidu1BuQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.97d32252.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbsWpCRA9TVsSAnZWagAAaJYP/0pxE3wHjYbVVRD6gJYl\n5IOjdK/g3zO2RiaXpSfdRDgH2DpZU9kosSnhsMv/+3J8bsfc4iNMrm1kByuD\nxHLiwXW9xQgX4B8/i2KRKpSNYvkVxxKOk5WTgooO1dIZQwkoBcRka9PTJ4Oi\nDN6RhTXsCAebS5zpDH8Ai4FfWaPRwXsWznbfjg8D65la9/XjU0cX2+EdaakH\n1oLm9fe2Gn/wDnFZq9WW1rWhhvLuLLzcvlpRHPt/fzv8z0oKSWDckbLouAct\nPAv9bT+riCB41yYXEnFaeTII1C/SDDG0mp7r35YEOqa8t7HjcXaWcEhez8yn\n5gVswdh9fJBsG9oIGKo0mS0T1FFwGXlA8SRwMxctak5IvawJ8CkA5G/gc8OP\ndidp7GdevDWrAFoIydZT8nORp4mOY2IV0xsNdVJ+cuuWibcDF5E7WXRZUNtt\nBAvxDdZ5l29o1wM3MdJh3kJ5dfvE3pcr+kzTCM7Wf4mxDn/M8Eh4xzaggO31\nZj1lI/sV8HdfqOFGefI54DklE6HvDzC20Z7+rkOTEeUG7+YYrjOmZdkzlV4p\nvtm743nlpgy9qV//TNu3NA30q3X3LF3T0r4fRXRUK69p3iBvWPJ053HtFvTL\nxmRsJ7OqPx2sOmWOYR3PvVxI743086ShcBOpGFbzbsVmzoSnDALhd2XvXhzP\nq7dV\r\n=zNlx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDD3d98CPsIjPtZoX+aVYTtf3MTdiIQepEb6J8OeaBaUgIhALzzIs9+2Y0ozDSRU30Yd54JXiIQFTbwlq7qiri/Q0hC"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.97d32252_1550763432510_0.1165235044615438"},"_hasShrinkwrap":false},"0.17.0":{"name":"codegen-templates-scripts","version":"0.17.0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0","dist":{"shasum":"ffba0a91e5beae89a891217321306a7e8b69f70b","integrity":"sha512-F9EM5L0NwXvQ0/fncDXqLfkTY0VS/X2+llAXXf9wAvj0jzEJe2vsR3S1oLBfeS8LKHPd4G2HrWVFqYcKNraUUA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0.tgz","fileCount":17,"unpackedSize":15984,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbtg+CRA9TVsSAnZWagAAr6cP/1fnOWQR2bjiUBHvgk1S\nx552OG2vd47Fo90Mu58Ae7u9m7zw9y8LfvQXjjyv2yTwyf5i+mXOTU4LBcw+\n8hIUjbG/GxcGW0IeTjrHcPdrmgEFVnOtyNR60uZ8gbwZl2bbQMlZEEr1vt8X\nLIIvxsDI/iUb68FDc0SXWepnadPekUwI6F1QrLPHHuSzzu8SydfC6e7hS1lA\n0V/ag3IUgrcbKJ611vIM+WCKCFkbtOxp1uXERIjUZ3O1XsIkGJAuQEHgr0Ps\nKAJybPWxaWhLCbcFMr3d7MDbR8xPDrc9yWlB13dIyk6PoFDQL1/D5IuTb5Ti\nEOcCG4qAHWco7IneYL6Vk2urRPETbJAj4LhMqB5ADPn5EV/ylR4NtkLsSecr\nBWPmk8eN1QX1sMl1vy0lW+F5t4nLF9aMETjmn8Jgy50yAFvCStPy0PIewoBU\n5SZXgsijAFiMjyqiO7I3mPs0Royoy1HwlgoOt44Ba4ZU/9tKRcs0aFmxsUNV\n5L3+QczdConbGsEmgVmTF5JIh9RzTyw32EFGzBseFB/yM7lvTeX/ZQB7tU1y\nOq2s21zFp7uAdd30MagKmxW9AAWG2qV8A81VAUNI8Xp8guArPwchrTTPYgPL\nZXBeaNbP+6EFbJYcRZIfLSpBShoUKxVnohQsiIINg/ob14/+yGxg+oIJRZSK\nUnzk\r\n=tyCp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHJ+qEV0NnXW6uxoEYZ4gwROuqjYLHhTRVUQ2QreNU+LAiBFNHuUkBV22pM0+eN265lC7lDKmAH0h5NiBuCSLb0L5Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0_1550768189777_0.2597280238155688"},"_hasShrinkwrap":false},"0.17.0-alpha.b0d9bdaf":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.b0d9bdaf","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.b0d9bdaf","dist":{"shasum":"f675a947074452915ef0c05bad43231ac9727a4f","integrity":"sha512-1aFAs0lArHXZ+WYM/gXPoQmyGfPbeuFfeZHvTWG/e7vPn81FociarW8MbxU/GINKZGqxk3Cyg8oA+iNZNWvl0g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.b0d9bdaf.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbtmbCRA9TVsSAnZWagAAWB4P/35sw3mCcuirRXgLldiW\nMMJAv/TezVteeVTttEJQF66Lv1MO/L0J7nQBjdYCXFY553OA1oGYhOF3w7ZE\novQXtEiyC1kCbsiHJbJfS3HmFh03OZrdKHLeHkjlvWpI1FwWdQypPt5+shEV\nKa5CewfLyWK1Lpb00fOvEdHmw34jY0NFs8VKSGm4PkQIkSIKPUpFRvvU3fL5\nOv5qHVTDyaKqC7KyUdXRQOLWJtwDRohGB5ebFMkcY40qG1Kl5huYPDoJtZdK\njkR03dLlT3RpvGxhIfbs1hcUC31Yb/O8I9q/YlIJIJRRJrhZn7bbnDxuYqRY\nEOyd25CrySaOyqsGyJJUyxxSLNU1TNefeCsIKORxmj3cbPRIFcwi9xcnSiGA\nBqn93wLNMP4lOuOhIlVXOHreeACj8NjyeetxzR2LO9hNlpeQexpgBMxcEmWR\nUYa55QkG0v7hgN+JnC0xu1O12q5tHIdRylW+I/tVtbse6B1gna/rzYOEZrpe\ndhuwzwO1aKU3ODhCv9nnFdOMhrUvkv9zTiL/CVlwMTpLERmhy5z3LpMnXivI\nC2O/7LXTM5J8ZzqNgc8y0o9V1NINku4VqWuyUkp1x4V8WeilbtTsOoQJW5ou\neiHakMsH5ZwBq1CHYFDlMK8iczY/ruUz0PMpH/3d9QEARPMmIjyYZ98HXvAq\nYudS\r\n=nvju\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDpo9XJOYLQ0O5v1dnoitSNvdgRyOj/uASfqoJzL1HMEAiEAns7TQqgLq+C81nVHpHSQnG3XvEFH3oeDbleJe8LGm7E="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.b0d9bdaf_1550768538381_0.16259736193369467"},"_hasShrinkwrap":false},"0.18.0-alpha.8d78a99b":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.8d78a99b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.8d78a99b","dist":{"shasum":"a8f73c7cc08177d427d8e83dae612646fd4b31ad","integrity":"sha512-CHSF8X2E6hKK7dZPSvBXLHhtWfaRhtkS1DT7igKHkWA58crVTkfQBbF2GFld+KxwfxGqcTY1/Qhj4QyKnvvRiw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.8d78a99b.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbtnYCRA9TVsSAnZWagAAVZAQAJkgp9cojto2IuYRhDOB\nV20s3hk8M7tH5iO/tqtwdApoUje18iCoTc0Cot99C7AYVCWuOhTFVHCqZiqP\ngzWcOxpUArv+XFJfl1nZkOg7grDGJVEaesKaDLmHLlECDJgwAnFzgTSTWMt9\nWpiVDqIoE9hsv8esf5IL+kllg6RCo0VesoxaAEBLAW+QNiW4AMPIu9ChUPOT\nv/jEZzLwDJ51aGeHRwkuQ6FFZGHhNe3D3DapmsMXj/4CgR3fNV2pWtBZGbyf\nfW4JnfKx67cFhMnXHdOCxp218wEJDgcjrqOIWll+VBZh1p0QiSPe99PZ4NHT\n8HfAIewkw1QHDZ6Qe9lsR27TXcooXBpFSnXPvfD7uZlyGlr3V6RIqipIkb7N\nn6zT8SgOMPbFoWl5dsGpeIiojefh4MmB3tyVdNH1OqQtCRT3yBuaOHpAZa4U\naxyEH8YS5RvLnudozonji3rkBGsZefITJwCpgn9xgD8WIBumsxWAt7SHkt/d\nL0+/iq0VhC08kwKaHMmXqUQV7/8G5MMnoC/vxVMXQWTEFK1m5y7LkTmqeBz2\nG7F8LLoBIrD8ReP2UW0msrEqHVYnjS0eLJ2LM878LsOkT1/ea6D3gQPbHDDo\n3GM5klxsNAdZTKSiCbBOjbllb++ftDeluI5VJLhojio/CEVSId4bxIIbpOgE\nBLFJ\r\n=J6Pf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHHSyeRLQ2ZyUk3Zkzi38btvbJMpqm6iQOndgN92Oq8/AiBL0u4V7TrHY8Eb5Utmu6hMv9OrNTb4Nyz+gH221oR4SA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.8d78a99b_1550768599303_0.6074389765609554"},"_hasShrinkwrap":false},"0.17.0-alpha.0e8f8952":{"name":"codegen-templates-scripts","version":"0.17.0-alpha.0e8f8952","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.17.0-alpha.0e8f8952","dist":{"shasum":"90c25d5d7af72c86c83eb8467fc097e9eb3611c8","integrity":"sha512-mBWBa1SybsxV2LXe7HfDVto0NPJRrg64JX1EDtafQw8kEBWixnxr+xqpE3chzKh/JM37Mf2dYuHPxVrKKw+zLA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.17.0-alpha.0e8f8952.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbtoNCRA9TVsSAnZWagAAr1YQAKDI2KKTaNHZYK50cmCo\nVYcZZRoC455h3QaB4toHkMQ9F1FdKf6XqAP0j+sk/VruA2ndcu/9x6d6XhYc\ntLjmFTWECfa3Uh/oQhi5/hZrUMGQif9Hs8Mn+PbXVjRjIOPLIX4HtTeiZfZg\nUdY4W/X1nxNjmrV1iiPv7efxqZnqoL9zR0mj5oARvP3W5brjQUiqPgIZA3Mu\nHc1sJ0VcPIyMq2+buJTZhUuaabH5O1MxrdIFfG1pWANmfK70wg0rHqCCPh6X\nOIRch6bi2U9+Hu6zHRGpe0a7dwzeNAHapjpSbpzodo0KSxPuM0IhaLGXlfGd\nq6QpBc9ohAcCZIG3ksd0Py29N8fJi24BBi3adK0JwjV2yiLoCkm88AP1Lwx2\n8zlRwR1EWctjRfriI21glt8iFRi7R3RQvEecENAkY2sDJR9dFcZgObL3T+fQ\nQIHWAJaGLmjCIpTh5wTj6XQ2ckacx+yZFWqqHqNptTBAq8ZBCp4oVha7k4tx\n07z/h8B/rZofQYY7WhSl9xoUhVsSKiKeMuzf39wro2DWz4mzxmre/8Bh+/hm\n1wQfFiqEUnNeeBkjfTmNN1KOcS6hnNGuXireKHDVw8CyIWN/2s+JZuBllo0u\nuqlXr2ILzZnb5OUIdmBrtuqXPV7ijkCmBQB2TchNUA5zdtUrcvISlukHl+WR\nS5OK\r\n=GuLO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC893I4rWc3no5Uo+5xdutsKSvYaeLeMaw3Ddp7wZHXawIhAKCYAZCR12DB+Njagg5jc3iO6dHFM3vk63Oq9sI2NPf9"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.17.0-alpha.0e8f8952_1550768652464_0.7650051133461941"},"_hasShrinkwrap":false},"0.18.0-alpha.27c1fae1":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.27c1fae1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.27c1fae1","dist":{"shasum":"562e8afd3124cbc5fe8c29bc423e71cc9f2e6e85","integrity":"sha512-0Zw/TbtDTPiataJVJwYp8/ucqk9BQy8JyNsTF6Rfgezr+NxP85kRHjPvtNYwR0Tb4Iw50MzCbcP0NcMu2iZAdg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.27c1fae1.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbts9CRA9TVsSAnZWagAA0LgQAJAb37a5Kdu587K8Jjll\nWyosnmBQyka2rAHGWuc6tCcscFLJyqeX+AZKsKPbJMBhkaNMG1zjEw7DU3zY\n1nmX0FoFkxiFtdzXI4h3n77Z2hLM7BR02mOZibJh3vhkX6qBUDvnUrVDgKuZ\nse6cdS3wBIPs0ZSEMj1HG1Yd4LmiM7SDW8ehzfNaOXkBtB9zQwfVDrdMOpcT\nIM5RlOwHDMBwcpc0f5xNJirbkbGNAp+hBrNtjsFr2uFNtV+pB3Ok1CEorkSY\n5eKTrVBXLhyfsuB+r9mOJdrJ7Djy27XXFUnm5Z6ZFfYZFFNWGhxJ3LFMBpRf\n/hwZCgLOLe8yfZDtCqW3YOuBwGZtXsVuoKZVdWJglVuijUQhouJZzb4ppT8W\nqSCsJXPs5KUo6cixmK3dmoukby0WQZtIPpmopW85uAf4zB0lfH7TPIzt121X\nIgyp7ECjVAcUr1pJn01wIrT9+HW1ixwIr42Wwlj7WarC6WvmyZOdlgDsEvzW\nLbq6GBrkJNp/DsCbmNb+9MoNUkefa+Wvdeo0vVRUEPImgGp9mlWORULdgfiD\nVDIQQPBnkRSCGV/89gT2LgqRkPlyK+yHI67NdTmeBDAsYxZJ6PbNr8PzbP2O\nv9G6ZHPZO29jeCfl39fZduSMJvT2i1rvmIVOGJOs9udTwoEM44pTZcjbDCJR\nDyGi\r\n=mDGI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRxbrzB5gWcrpIC4G2ITrpYeERU6iT5Zz0N6NvE9r4KAIgIb56W4JN/VyR83ge/UfeC3Ma60AtlO6XItHMqfzJnlI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.27c1fae1_1550768956234_0.9031618514237039"},"_hasShrinkwrap":false},"0.18.0-alpha.a44948f6":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.a44948f6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.a44948f6","dist":{"shasum":"9edaa217f471fc92db11bd593c959c7e95c47fec","integrity":"sha512-IcxU493qZcL1a/WOgVsvRNBX3ib5TgYL7g/SYNkwnOdTOrmQ4+VSuRdHFBCZnGyqoOwWs/VzM80b0E63z1wrQA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.a44948f6.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbttTCRA9TVsSAnZWagAAyCsP+wTfnSmfBUwC3PEODqCr\nfBmHd+yce4JACTUR2gqBdHKS9/RHZoGR/RgkQhWGlYqEVz/nFs/QmFvBHxDL\nKCTupuhLCWbv4HpEqdEm49p7zf2lJd/ipcGyBeuk7edndor/yWAJ7oyOv9ej\nVtdyh4i/QmRmi7uvcLRRyGi0QXytgTtBSWwjtZx75awijg56zvV0nd6Zs4W5\nFjpwLvodaaV+4a+Ev2N1uz1P0wdsOlPLPtTme2HPirvdbElU6iUPGkkiAwtG\n3+LzvDdIiGH/33I1QRjn+i54hDjtB/fj/9bpABBN3liY2J0dawq0c6v9+dDq\nYt5z/4H/0FnoRdbmXMgdl285Syt509RlxRDgA7x0yUDujrZ4n1MAcEvJj2oO\nfh6GYy+Un58jO8AY9fb5ni+/gpk+k+poupTk4EeyySdQABAFTf/oTh4W3Zl5\nHIpr4/Spo+tUeTXHG7DEXNVJgVV0DgZKf6mmppeeNcDtYscPD8omOPjiFJDN\n3Wdvb32jndHqg928bsTe1t8b8P3lXk4Z0SBFzIPlT1HURkiW2QPJyrx8z74M\n5SJEGrc4E8/BY6KKeBG6I3akj4wnchvW5uVI96wkOHQvn+yH2kvB+vIG2c+9\n+pM+5GTt80LTACMDlXFi/AJtn7Mp4ut9i801Hhb2CxL7bqRnMFUA+4V/MBaY\natiy\r\n=rS7C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfrICgVtc9l0kZdJ2S5mSBbt62Ky8Gye5fyRWG29I0TAIhAPNPkGuSH8auv0mV/cGASIjb7rmAo9Gf2wTGwPHatkYZ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.a44948f6_1550768979370_0.6197860206545631"},"_hasShrinkwrap":false},"0.18.0-alpha.8aa51132":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.8aa51132","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.8aa51132","dist":{"shasum":"610f7d638e6f8aec431dbdd4302bce4ee53ce97a","integrity":"sha512-Vrjix9L4PimsGirWksWAGt17VQKoBy6lXrm0eUXgLQtj6JGidTAqn6ZBUiyMN6FaGyn/aSHyFg0WBIOD2LPYqg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.8aa51132.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbvJUCRA9TVsSAnZWagAAF7sP/0gDHlOvHAm0kjZM6wX8\nDyq0rFkj8HLDeGSOA4u5XBnb40ry2Na9BFGFcbQg5OltZFFAnAmElkInGLjH\nf5aRL062kKcjGUXeE7UinB4ZWV9VUUHEUH8JN9yhEackyHQe01+t/PXQeVIF\nqj3MzvPKgUkKJqJF9LcrYwdguaZu1v4O15vKsmdnd/GpfqzhkuUZxjuPx1QI\nbSigg7aTdH5nn5wFy1aCcMd8kIfEphmZpz5ytwoe+OTBIR9x76NKBweC+xBr\nakyk/9/dAjQ2RxtTmP9kqQ4+v4cHwbjwRWynDaD16g1Cuh/fYN+OQl9IuC8i\nP+YviLe+ay6OelerU/p22oUhKrlxP59IpAY5hUxcgGfHbHvFmcM8YAqdgmFx\nwaMW30NIqdM9aRTgHf8qvjLWtDlDdLjHEuKOkKnEje31AgIgEozi+JiIq/KW\niQPVZ2VsS9pB9TIYVxEwpIaLXJweZ2oW1dGhZX5wbV+TaKYXeSYf0Bay0oZj\nVgUNpBsTEhjIApzm7no60XRJ8JCd3qjyF6CyzVvAz7MkP/c6ZzSDRFSdSA3c\nJxPHCSI0l7XIZ8wYysny50pbX2rII0YN9UIXivMG3Yuc1pJwF8tpjo1QIDPQ\n5DvyAkTI7OvVyPRZlsJDvcKt2US/R9tR4ck6g3bxZ1vb8ZTHIuFuhHVqSXHo\nWrm9\r\n=sq3c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVfej39p4W1SoAB7XDPCiBTIVWTJoqLH+qWmKHf3Oj2AIgExgfkA2e5PvyZFmhIhgrR+L32TK4kLjUL8MiQ+R9shc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.8aa51132_1550774868033_0.08135162980176225"},"_hasShrinkwrap":false},"0.18.0-alpha.ceb43702":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.ceb43702","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.ceb43702","dist":{"shasum":"155719685b911cc52697e9eb4109c298018485e3","integrity":"sha512-XJDmmyiHibwbtoBWCqmOqfxCeZrc/aWOIkvxDSMmBbzzczrPxZcWpWaatDzmB7FFixsnUvxviaF9mqYbYIGCOA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.ceb43702.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbvzkCRA9TVsSAnZWagAAqrMP/09xpSi644HRvMqfU2K+\nfA8BB/v0e65ZBWuIvFCyW/6siknC16vHGRaOe+GIrKVGwek9EeDWlJjTyEsa\n9gwDJFXCUwZ3v1sv8wF4R1lqUrD9EPaoO2h2JiZ6DqGTZs+f0+SRhRBPH4Ma\n9/s+hI256ddCDWDPi9AdY6D9SaKbcnfD+Ov+k/znW4ZsXM2D42LkSQgd2+kQ\n49Bwu7uctA+DM3H/aOZIlRFmokLN09Tw1LH07EZxzEOeFO3jyxwYVJy1ZXPL\n82pwYQP0H/Gs1jK9H6LEzppkQdfKrUs0fA1OItaOIQfKSNKuiuyFPlb9OsIO\nJrsVmk3PnkOz2UVCaM7B3ITHWL3xpaOiUdM70OV+6uSc1yk9Xbe+Js7wwvc9\n92hIG9KmrhzdGz+kCpormeTfz07FYcriOxb5jP8SjbhUWOHgELsHdxi5T8jq\ncqz+2dXYHDOdzbrjD2yyI+4fxo0vLjakZLSc4p8ePi8ELMlIrW7/CpBPqdOg\nEYemSvCIqoXTqTpsEeT1C1WMfsmVl0qFi/7S6Y06ehO+4gvRw3G5FhIPkJYX\nG+vx6+CdY9ctJnbaMKKYC2xpQrjYm75v+HhNvxRxbym7McXPau30xjPm/ti7\nWPwrJZwPYyroe1aKZWqyDZ2hD4iNQ2GFavHMqb3l48BAw5z0gatt10WtOIYd\nXhHH\r\n=avXU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEPwrYfrigV9lM7p/P8aQ1FUcvYmR50ThfDcSQKaKbzEAiEAlNqC+qEcl8+9MmkD3s80jZ1rCCRPMOuYjzqhgTXicuI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.ceb43702_1550777571636_0.9393237239012329"},"_hasShrinkwrap":false},"0.18.0-alpha.d0f02a78":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.d0f02a78","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.d0f02a78","dist":{"shasum":"b5fd3b1b463660397266e17afe86ee943b6adbf4","integrity":"sha512-kmJtk/35ygbeUenVpJmcxOxlvu9nwQJlanj1QuMHy4qPKkJXknG1mkWAs/pjLkwljmoOwKF/vwFChKIqS7zjjA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.d0f02a78.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbyf9CRA9TVsSAnZWagAAMqkP/128C1ak7x3RvHg5fLzd\niIDnTBhZ34Wj7x7YkBu6UYgkICS3OWpn8D9BpN1Vtisit+IQAuDMbK+QX+GZ\nm0gdwpCd6dl57y2Msy+2g3him+f2yEZpyfx2oJFg/Er04FZceOe2Ft3xauWV\nVgha3C2lmikkDNUYUAOMurnV2M2i+nPbx2+ZQv+MnKY4yDdbseUxetGQ+bx3\n9zBfVNhGZcVGl6VUi+c5/sJ0u2yzK1kZvstggqWNb4L7A1aLzidzP5LBsCkb\nebCAyJa8IcPqabaYZcrfZjXRvMriMYPWBxA27WW51I+e/dXHhb7OOl6VQsSI\nI+02RB2+jh3zr1p+8MuVGgrbW2IZnDChjUZ7zBzNOcWydcLz1/1kFAVHQVDD\nFBK9ollxFfzbDcBNEGH9os9fcUZs6GzEPLD5VoWbtwVa78tygK+jIpDwQPEM\nUudJW4ITeAUzBkda6BHtSZN5Mz+gbR+cGK7C/HeeANHqxSmWEiw7TPyCYo+1\nfy11hlNuApYavIIY6Ydzot8QcKU8wKVDfOtRFqYVPEGU4KSUoX1+j0o+yQNT\nkTeTzSKSMAONRC0HaviOHWDdj9s7OycbpFbhUIThRh8H7LGC4UYx+tL383D2\nRxnmnczX7zciGq6+G9IBQNVCLdfd8oYTIdBSb4WbEI1N12KOM11CwK67szOp\n95KL\r\n=RC/s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRuIzdrJlz7YWUAMveVN8h4j+PkCIst51n7lM6J2QhiwIgYoVNVw94uTxzQ6I9CLBwBMoAPojJQjAIO3QN7LGi7GA="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.d0f02a78_1550788604471_0.3322955500884477"},"_hasShrinkwrap":false},"0.18.0-alpha.83f3ea93":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.83f3ea93","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.83f3ea93","dist":{"shasum":"546c4ff48adbdece6a03b00e85b77654c960abc8","integrity":"sha512-GxtVHChOqeo6uilGZxVjSeDzqAw9W8oLAvTY2tNbplDrfzx2zcXTAIS4SVS4jT0DsR4fPArz9BmParchJ4Ec2Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.83f3ea93.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJccFHMCRA9TVsSAnZWagAANyUP/3eMFAg/Rf7c7vSck+Mo\nN3ud6aHa2KzFNcmJXbsjlQ9WKtXnKi9IASU3YUCuZUeLbw3dH4BrdwGxh41i\n00qEyujIKS3mQIfz9v22aE/S/tMdYE4v88+9u/gsgeJlYKJPucOmfUqzk83W\nYX3OrtwND13uNXf70WwFVdmIA3/nH9r1bKXCpFE0waFDaO06cBj5UivQnzLk\nisPKBwehleVkuDxKNGbZMqeIzDSyoBV5miTQ3vt52tQOyjyCJDp+rcMAVESF\n184DTFj9lpOW33UQuBdze95cP01GNbwNLZMRzo3waWPho+OpweMgfLe4Ms+x\nJonzLG8g5lM9xH4Gb/0H7fWjFhBzjescMqQIjxKAHWXSgvI0d4UG9KMQQWU5\nHo/84axHB9TTFDHwEA7dBn7uDxBAVq53BI4nWo1dzEydESBWhURXi02sswR7\nj5cjol4BoEg+q+YG+Ui7Tgq8FVrH72mSLEsrHFzWa4p6DehQe1binOZ64B9h\nEtJX9n1q+hVmAMMRPipwbsTyJWs/6GdOdo2ywAgjoQTfRU861xQ5KagqMVJu\nFw19mfgJ/OY0drT9VkObkKErG0KK07Qf7AkCVPAFxkP7s6ZjVTCRXithyJ9L\nRP39CSI6hwtcVvFA9U5TY6DT23a8UL0jwgUn7thq5jcI5zLyvQuqQZIsMgvE\nPzbu\r\n=ZdEr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVWuW7cAx2DHcXhDjZAEaRiyElK79lxzgWF6EsDxvnCwIhAILziy2aTdE9dKDohKfKUCk87Vl1aHsLOuXD8AaZWpVc"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.83f3ea93_1550864843337_0.5977299344919182"},"_hasShrinkwrap":false},"0.18.0-alpha.c0dbd980":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.c0dbd980","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.c0dbd980","dist":{"shasum":"6939c9fc91db63a7f534ee335a6d1fdae605dad4","integrity":"sha512-p0IrT21rUwo4JGuW7HT6vbzYEZLtVSjTwz4sA2MGH6p+QMaJj9tJFtucQKGD+G/MJwXcbCjIwi+EGee/i3ujCA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.c0dbd980.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJccHkGCRA9TVsSAnZWagAArwcP/1Tw2WGYA/UAlu8tTtTU\n5WJe/kRh4QLbBRXiSUGudaIFk7qRC58KUu/5e+l+5OnpV2x7h+X9C7QZ9SWu\n4TMr57ROG12hpdHDv+QfmSNRhxzBUH1R7eor5WWMl6s6aueueYZs2eVAXFdk\niMbEzYeCPNFlrk1eGb6K/wsV8qUhjNz6mx9dDuas5VaNKaRjEBItBSsc9xwK\nT2TkWOpyZ2HRoK6veAvO1SJzOcK+AfjO9j7vyGvNtsyNyCKjsa6Rv5KOlkb/\nny0COH5KAt9/rJq4oC+L+ljZ0fGNyeHdjDc4/zthKHaG+px3JUCnnkCj8wrh\nh4sZWPxOen9UR0KIvSkzb1LRdkdCTaOeduwJvb+f65Uoudy0scobxP0uXsTc\niLwMv6F5SlMpo+3PFrc2BR+YxKdX/LkT32K/oz1AUUyvvnEhkIYdSjbROUCh\netQNcIVNKeCG4tmBWM3rrZZuHcVYQnsuiRbIdu8XDHwI5zcC5cD9bVuDFyvt\no+miKQkB2Xl7Mon08htbyRrg3rN6cGxOvBFyyIDBkrsWJttMkA7Rnk4bxQMp\nymg0CLhao3HRK1Q2R/YtgBioJMuxMIAhJeiTzVhhEibl9aiP6hAA2oCovBs2\nHxrTGW3J1KIff3kh202aXz2HNO4lldWOB49wrbmyDsindGS/bmgiConyUUr7\nGfBY\r\n=sP3T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCuHC2BkY8YycaPOl0kVoa6xO7tZr2g3UYFILxlLbb4LwIgW1w5oVjKPaX2oiDOTAHWfEhach9D+qIc9Trl0YYy72c="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.c0dbd980_1550874885328_0.40334965540864776"},"_hasShrinkwrap":false},"0.18.0-alpha.1eb2c148":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.1eb2c148","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.1eb2c148","dist":{"shasum":"8416f63f118aa1c1bb78d1726555e16bf8067f36","integrity":"sha512-9fRwJtjauQCtYzvt/wEpZtPPk3rRM5XAtf3Zw6QPCXuuz3dhZ9ABW+WJM3iUCVG1jOKqoEtP8JN9m4UOynxWRw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.1eb2c148.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJccUzECRA9TVsSAnZWagAAJrIP/iSpXb2//LtO3r4LZpas\n18Xh/LfO8a+H6pM9ESFj1+V4x2cp/oXXAd9jL0koszWQV2Ktwjm6hFygBnsh\noZ77RGJe1dCDNzq9PJS7f2yzt9IJr3pQVSyJnnkwTMwbMzzzt4Wa73PtW6VZ\n1yMiDKGG+AXNNFNLJ2nBgjQ13bnfqng6En/WSsM5zWLKswyR6WB3ZZlcblPh\nCRiA5Siax5VkGIMHbfWN20CUe1T43fBHSzRobhH8338WCTQD9tBdmm3YHGnB\nTGrl1TQ696e8TQzmVCfREloUFRaAHhV7gF6ga76O2djr+VrtgcAsE9bFrIpe\ndF6V/jzki8givPC+8JWlFBvGSnYwtfNktrjHxU+ZD8n22mMQPW/nOtg47yBj\nHIJLDw61nziVtUONeU6eS3WaQ75zDfCeZxnI0xEG1ACw99PbuyxfF+BcinJ0\n/JkcOOUGSoctP8swwcpLqTG+k5N3gCyh8gJqEIMbReaVGgZUUydkcolGBir8\nckRRnJmSUy5E6PWvuRNYUelBQMmRnAXYoMv0P1tpcOnH+1/YllA4i+QKwQHk\n1DBws4rminihj1jSD9rKSuDRmPhtMOGilquINc4i9vBNQKltUIsrZxjI6ltl\ngJZp9XAnH9FKroZ+KaP+Rstxjr0z7d5Z0ce4TNPEYofAsN2j46qkd8hpt5Ci\nRKbg\r\n=8dWF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4HJsDXat6bJGBTzi5ow/bJOyDMvDJzTHesb+M89/noAIga7e1JdNb2vOmFG6M3FA8HMUSYzCpdHgVCSZAvpTuV1o="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.1eb2c148_1550929091911_0.674659433698767"},"_hasShrinkwrap":false},"0.18.0-alpha.a7995ccd":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.a7995ccd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.a7995ccd","dist":{"shasum":"95ea43df04cd12a97d593603000872fd2a98480d","integrity":"sha512-azpogZVfckedtOMQ2O0Ui6RHJb7EUTG1QIinKjQ2A6ngM58G1cPLlzwOWWcLDK+6ztZmElL/fG6pvYQT82unJw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.a7995ccd.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJccclPCRA9TVsSAnZWagAAAHwP/R6ZsKFqjYpSDAxk5t0J\nzbU0niCX/ywi1G9vvXbRwPKjM7E9WFEzYzaBzo5N8pXiCizF0wc+ueAmT6HD\nc9mbhbmYUGWuSCQpBfkK/Ic7LjqtmpUj0NVCKMuxWMx7WWXIwMR3jNtuhkW8\nwXsWi2M5MJR8CTdw01hjgpRb3Py5RH/dC4mAkcMivLqz4DKwIjDYNxZTaKJQ\n8p6mUS+uhzw+hXWhB9HSiwBgppbYN4AQC4UpZIPlt4Z7zOO81VUAbj0DfKKI\nzhXfdOnjVR8LMeBol9cxgBuwF2XrAPFwTv51fuUohv7TpV28+RnwYKj5/pX3\nDoSDbZtSzDgH8uJLMTNOygJfPrf9SYf4kcNQPfiGZBqaNbHtF5n8zf1gZBZI\nx+WXdor819bc3u4OvyPROhEE3nnsPkEzIR4GWuO3sfVMlFDRdO3pR3HU830K\nVpdbqf4vXvjKQtr7EHtkVFoQOpkf6XxxGNV271DF2TdwK/eTmHu6UyIaNL5A\nN0/WQMkgVq9RmHAcM0f//2lpMU6cuVask704Hk2zjnUmk86GBgXdnlcz3haw\n3Y6zxxAnZt6BZXA29TDMIKCwI+MIgBHR9JND9JMmWhtmioKrdbpUlmol3a5p\nhiBeVXqykiSMKcg1NybPRXrhPU/Cm0WpowBKnAuLj8E+lSviomWiEp4HBLkG\nwH9w\r\n=qmOL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0CHoiVR01k+OMRvz0X6z1f95kVXhhgGNhSJFhhlXqygIhANetve3rjyZeVNCEUnsNZGGuXS9QuSmbKxdOGMUqraEH"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.a7995ccd_1550960974246_0.22592133789532487"},"_hasShrinkwrap":false},"0.18.0-alpha.70d34459":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.70d34459","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.70d34459","dist":{"shasum":"37ee2b83fc518ffc151b817b54f276f99490487e","integrity":"sha512-qgPSr55OUdWCDzSNV75LmmQW+0ysn+ifaI9pBa4BgdHO1Vd9JDzjUuo6Ee8n0xGUbBFUCQSX3iR/B8SwlhFocw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.70d34459.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcclnWCRA9TVsSAnZWagAA0jMP/RnnF7Juv9TclVCNGJ/L\neNaOTG/D9/yl3TNPIba5cWmuN9NfcZVvPTU2yO5rfwYwjazMqPr51ZBxtbZ4\nXLk1IhUununozH3t/g6ul1BacvcljvvKGEa7fyalLCjZaEAP6S8jq4eT5VfV\nO321YZsbZMR8nPvegAQ34aDEy+78Dn25jiZdvbooCQtkBbhDOfVrVzx5j2q5\n78SXTvWMagpGPs60snVPrsxgF02bnr2ftEozj8cj6lZTVNuWYurwTbFqwkcJ\nZyYhv90cbo6DP2JbxrKkXBMrYRLtDIEKTZlSIRo46Agm0fGbrfCVac6tMOug\njGtBP+kYH8kp77quQmh6WC6tnCbiTdueLLdMW4wR8503VJk6GHaKah5Xmm98\n5yDwkkkJimqELfzmrYIKiQKAWn7hfbFXnW9Dm7lQoSiUdZiJ03aPPPcG0ETv\nNw0/HE5MmcbAvLwnci1GltxnJ+Fvst/BnX56C+vMINk+XjxPofl7eyix5ufN\ng60Z/otysxHCqgcy2r/TS6G/VPOVtPUOVrnYuFgSlJEV2mFCuHNw+DqzkQWy\nDyDRZ0Oe+U2kvYSHOzoO3Nnl3FiqG5FqOw+xu5fngfzDb75tMketol8Q89L7\nbcGyN8rSS/ai/Yp9ZfdZFslR5XlnUZs1Fimz0GhPZjJL2W3MRvIw/WXxFNWJ\nSUv8\r\n=hFlp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCokEmlgzVQZ/0qJbUniNanSpI/aHPteEtyfh5ZXgi/9gIgYyW7xYMwh69WcrSiAQsP5dErFsOdQZJq2PRJbpHsHpw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.70d34459_1550997973644_0.6393870073472117"},"_hasShrinkwrap":false},"0.18.0-alpha.7c36b3d1":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.7c36b3d1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.7c36b3d1","dist":{"shasum":"a16aeab659c251ae1a0b5a2dad7c1fa248ebc09e","integrity":"sha512-ZFdlAwb0J7wZS2TalMXVwqnCaIgzKLuh6tSPxIlKivkgK5iOgWwrVYfjFHUsnlPaT6OXexYYkYZxmn5NbR1I2A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.7c36b3d1.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcclo2CRA9TVsSAnZWagAAFpsP/3HNX7nwc/3FjUpf7NuT\nBTsAmrw9kIifcb37B8v7Ww8a92s3sd5hvbtoGK8I5R7v9l1gW33lNI1w3jQf\nOre5O5b7GS3Dhg/Pcoi4LxWYz6rbYOegJjOWem06gXnPtpBOnchtfqTlNO35\nv8dv/8y9jxRJi8OZzWLFIYBmhUABcjZU6XGg5qet49M9owYJf8ZiZ5lTfS6G\nAKiVZFa8j+upuTyWwLsNqsD1vdK9awKTCDlUX6Xl+VBrEbUGzAJs2fLS1pSd\nJ3Z6vdiSD0WcyxjFkrMhrhKLTRXgrsCyPwKx2J6ijNOBmev7NsFUYv9hfLOp\nvobSBDVKX8pr8MdjqvRWoRGnR8HORs8MIlFEm4L0hL1K1vmHNuBL+L+hWHdL\n44GAI9RCqhgBlcuolYbjPro2VITLiFMzGdqSsFLM+LQgWjwYJC/DxkzjIusg\n66zYRuiF44oLrC73z42g3QM/kww0Ie6ic9Es12B4W5+fTK4Ip4jLR/kOlJZ9\nMoScstlQ3LxUy60OYf5z6tw1032wDrKKRHH6A9e+ilWDR7s3W428/irBHFmm\nJ7j1saUBzaUuDXWEGkJDQK/6kWZbtUEJt4TXE50jqVVPOF+cBRy5s5DAQli0\n394b5VLhxTgu+5e7YQulsbkhiCSyWw84KLudUCTRuTnoiLBXgjYSq5MoIHMu\nwnYb\r\n=E6Qf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAWWiQriTOU7t0HnXM7Ck/347nD7vd+06emB4JdDmydQIgdHjBDFph8BginF4tq323R00ZAQgghvczk1qeXXUWY5M="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.7c36b3d1_1550998069863_0.15053113806144158"},"_hasShrinkwrap":false},"0.18.0-alpha.600bf546":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.600bf546","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.600bf546","dist":{"shasum":"00c6a452871f252aa25039d6e42c5c3e94a5de3a","integrity":"sha512-nuVA1qNv3WWpQCuALhrY0H9So+LZ2shhUXzHh4LUFJ//KNfXwWys6INWf8PsapMXyAmSwmFLmRaWCQUYnX4w3Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.600bf546.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcclpdCRA9TVsSAnZWagAA1ycP/1CG37xzxbXfyuskhlKF\n83w+iMiYz7LeMJBgD7K4f4VaZr19VQUePQ6IT0xocIOudZdO0O/NSjvwDofn\nxVzHrW7InDzgFNUvWX9GFLJLH+3Av7XwJ4hPrr/FHGc6biG0fBYcqxVNURrD\nsJrtjGzHWmCVXoYPMWrpBoag/XHrxW0chb7iJhucHB9cdWlJWkfAWKVgvt8y\nqm+m745H22jm+YlyeKHI7W26QJPrNt1yPMlcHLCojAjtUO97CezAI53vXMOt\nuSF+JHrQKBRxkgxPMTmS1EEzJ7j5OiiVvxHtXBFOUthbY18txgBpMyHtPLC1\nmczOp6hQNwVTYwvAOmAKOC6mAwvzmF2DAru88ZIpX17N9O+WJrnlCtIv/Mt+\nnrP+N7IfLvfJn46haM16jXzVXG8pH+5FMQNbsX2S/Q331GbxKCnKeZqT0ReH\nBfhNO56Kcq4ME86Bf/7OCAt7835+LBnvl52Zz4Wv1vvJaJyTTqLtpPEBJpuN\ni6WSdmeYgL1siDwyRvpWxB3VhE3D+EV95OIiaCu2NUNgn5uYsPAIGljUkQSI\nCI6+yGhYxqOyXrhjdn2lLgWwQK/T6jUat17pcb/MfAfDlvY+5kZvachRCtoN\n6SMZdPtFO5IlexVnOeXEsbiPMe34rOTY1BVJgOAImOufVH5C/p6ZHXJ3FILQ\nXs8P\r\n=AvEY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeb/a8/hbEh4bkWJ1kITQ10RH7XIRG8VXdh7ZpMRK8gAIhAPUWjuY472DpvN1tRHnVjw/+9AyCZRkIGLZuoCur3+YV"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.600bf546_1550998109277_0.34723699065047886"},"_hasShrinkwrap":false},"0.18.0-alpha.49a260f9":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.49a260f9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.49a260f9","dist":{"shasum":"bc78c1c26fff9f078d6c059bc2f40e74d06c0805","integrity":"sha512-QCdfxW+//qlU42KpOQ8mgoa9zkhQCI57k92vDpzQ42tn9hUiRSbygFfpv9NCrg3qCPSLZFU3h5/bsWAXHai9FQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.49a260f9.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcclp3CRA9TVsSAnZWagAATZEQAJYIAKGWkBRxkJcFnmbe\n092/LM+1gnZlbpAvu2s0+RVHQoKvC52gC4uKpHahwWvfy0jxSqK/2jT/bbgR\n5F1tsJLBzEcQOkMIDIB0iu4BC/cE40EAl/afe7nrOF5517yqoVsUis1fma7O\nNN5vRMIj2WcF54453OZFN+atCNkvTBCS6NiYiL/osFL3GSeY+j4NVrQAmS18\nWZfbwMJqNQ/NIV3slbKcxS8B5WOAmBz6S8CMw6QGCgvpAmcukIdBwTXVuj1Y\n+jRfMJm4K6BquGYkG8dTecK0zFztc+GYooKQw36BwlTmLk5Ll2IrD71puMvi\nQupvxL4PPoq7nXTpWfXxp5lqezzHUZBJgN/F/QdTB6QxDBSzKDFGpgCYRwri\nqZPlHzmH2IdS30IaKn8T3eFdf78Wo4/4+WqD3DavzIJB19kHBdr+4TpIavwZ\nCph4yCWc8sH5hK+bb83E5QYm2ySZUltjjuq4g2HGWXEDiJCOdP8goFc7JyXt\nRBtB/XVazxZ58cJIdFo5bKNLMgWQAnzwAv+4U0DEkIm1WQFzKJ4Z2zOog09G\ntTWfgonpjWnFrhWJ5tcQLXY4iL4vZIk6mF9PaE4B3kHUYTwwscPjRk7klPUi\nXuPpCN3LTEkH4pBDD79zEgQoiTsQFwbFmzFl9ih4GlOAw6GkyHkaZw25JurI\nRwO7\r\n=exHW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICObiM9pX4aORd1HKBYUy46PhujV2CJV0xaeOIuGW4k/AiEA2A17JvNw8V8kBF8dnA+pC5SsnowVH46CdtXmdbSy2xs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.49a260f9_1550998135127_0.7434480726780046"},"_hasShrinkwrap":false},"0.18.0-alpha.99a4f6e4":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.99a4f6e4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.99a4f6e4","dist":{"shasum":"740e46e5a9c7dadcfa450129308faff22080a62b","integrity":"sha512-BnEY9yBC0Vznmfk73oGMkMrOl+lEzKwWNxQWxcrMKzk7Eh9iRiwzpABkbv00FRBe3vUBqlhXCSxXG4qjkVQLWw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.99a4f6e4.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcclqHCRA9TVsSAnZWagAA4ysP/1XWClgPI133Eys79TAa\nYyRS0c+myQFBmPQeC0/C4soAaipK+twxz83EU5bMBIX24mbnFhuCmM18n2fL\nZYSRk3I5f5T5EAbI/HFr9ZpMnr/6z341lfcqIojrGkm2Tarm7cG/FrfVTvwl\nOngE0vLE7X+rbYrDgrROF5fJlL50+uL4E2M74SGnCaMSqGE2AtrvhBRgGr7W\n40FVuzpccxPKs626BDA/S4qZ5IYH/g+wjv9dj+2cNx3SVEO/ECNDIv1RMPXD\nK3x4NkVWV/3MNPqvuyy7T0bCvJ36FKm+iFH4WZY9mc/i2R0P/ZE9Yy5verm4\nNuk9vYMVr+QpYq9Zo/OmSHIqIL4y9FIX8ER1S4yhMBakdrCT/fCtuY2TAtpY\n2YzcmCJkNVaM+pEG5z/WPSmtWWR8MbzPL9jiJLGYb+Yoe4+tOQzdhJQrZ1su\nCuuic4IYTSrQa8p7wmfQAfFUi3LF6+X0RsIOpJCxOHbjhROVTm9qd0VLUNSN\nGn1BUbk+JURi9P/yDrk3ylSw7G2/s+36vTYtrgBgIecZooS+Z5l25Y2S8Mb6\n0ykdh/ugO3Is3HJb8JExO1bnZC5nxFZgq74QeYihquM7SFdjuU1HuUd5J7qa\n4skI9EhVA+EWOLiWzByfDbm4gdrc9aeAEderAzBdTuB3jwq6JMTm42yNNLdS\nJDIZ\r\n=K63b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPA9+kdP4xe2LprL41WTJzSFbVuOZBPD+LYim8otlHEQIgKlO2K7LbWB0Fx8SiBO2OkKKQN7A8utEL3h4Yd5n+Xrc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.99a4f6e4_1550998150774_0.41805814950123854"},"_hasShrinkwrap":false},"0.18.0-alpha.b4239bef":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.b4239bef","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.b4239bef","dist":{"shasum":"e95438d0df6c93a21359f280ecefd223ac86d222","integrity":"sha512-lU9TlcOvZnbJqkliFH7EK9441+Va8gxPVMf9UPcV9wPFB2/FtFeXn34CxcobutogNFiXPHOxU1uyDOgrrk0a5g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.b4239bef.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcclujCRA9TVsSAnZWagAAIxkP/A1F7CSqvby16c07TgJY\n0LfNdaOpVb7ydL3Jva6S5jXKwCcHQKAd65CIEIvYiyBi480G8F+WsZ1LEo5T\nTeSYCMtvofWs9leIsgk5cXWpFl88aM9/MDvXFT/SZItLIxl+fa2cx9F1Xr+K\naARZGMcEF/GuPvITntEnTiptgiHNYcOu4PKjqRFl2IxFlbHGPwHbEA8+HlxQ\npL6A8mYdMWdukiinDnUg7K9HsBCbbXp/Xl34U0cJBH6uIsY8WB0zCEqwpYDR\npZ13byLT6remtOuNAtKYgRwPhJEZxR0NytGzCvH9C7iS4NCQqkp03RefUzyF\nJn8HJPphwy74N/bl93TN69NgpjUM5PAoxb0tpgd4DAzWcSUtGjH7tDgrgNFj\nvXgbFQZEUOvBr31jA+YmDtrEwTsZAEwoRjyFj16VFxrTwsdYcgf23YAXE7sI\n7wxQ4V2BQ90rvyoimJnmO1v1j8mdYs6WLL48MqpZ8RQOhuk7ZYmZjImp77z1\nQwM3PuLG5RpO+h8sr68W9i3nsMW1Apv774R5sJEbJs7Rn2HX4Li2Qprv7VoL\nt5swuass9X2p6fCu1a9s0pgSthUgdkTcnRpXewiWE3LDRU0a1YE8KAdYI3op\nWdYgeMA2uLSnbWQ2x1++tNGut/42E/A+j3k0qNOlL3JUQ2kspun1OmxYbrkD\nJR5Q\r\n=+gV9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCv9OqXDAk6lQct2/NEiWf57TeAvClZM4m5VNdwHboHNgIhAJv2OS8ifiX6b5s8f5mil2uJ+PdJl5oGy+lrz7Uhf4fO"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.b4239bef_1550998434734_0.047615187800261305"},"_hasShrinkwrap":false},"0.18.0-alpha.849703d9":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.849703d9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.849703d9","dist":{"shasum":"97a3fc6cc7be47452777c291377d643fba1acf54","integrity":"sha512-WB9YESjxNUkgACz7WF9+BdTA0kxBL+v8TjXXZKa5zryN3hTwB5OVIRnj3AUKI4SOWMLGQ5Zmn4xfLXev3V1Uxg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.849703d9.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJccluvCRA9TVsSAnZWagAABhAP/2Ep+dfz86wo4mSGMNb3\nQ6ToCwE2QcEkl4yrW6jm9mGVLClINPYAHvqZyavSoeqZVipK6KvCfR3lkZ8u\nevs7/b/6fvA1FzRLSSVPOZQz12fMRcW3+ElkvY+jAWkpRmrDlOg71bBZil8l\ng1MJenzL9yUg3AAWm34zO+36oGK63VXM5hSz4v+0RyNX7GqSblpTIGTk18m3\naCTbFqoz/H+3iyMXjL8NMnX4QLGob+H8D1NSbK0BHf73jZfKF5GfplcQa1h+\nGcZ5AFAqK3SqGA3/1MRCi9KzoCuzrkb6/PBeQgytzq1RXfvLigYf0taU9vTl\nSDF12tpKQK5JaxfGxBXfP+eBQ72dgeN0z+hhFYaipkKeySFGOSZfurQpT7gI\ngCmOLMDpHUXj6sbzqJtOR2jfFBGSpe3tcu5mBO5hQnaKPnV7qSUozzs452bY\n5NE3FiaOfXs0neYDW87Ktys3fI/UhV6U0LgioTGSJVrsbYE9qGuikjLojs/c\n85dC3XmxXo6EypU+iwr3p/sTlrydsK8kTMr6eAUXu6DcB0OcJ3ru6mvEu9rS\nM1umvmLKv9dveUYWW7ID4K5ZqqIfdkHVqAcWmRdj8b1da+sh/XRh12bOzg8D\nyZa/1s+2wOHStn2zmk/e/8JBu+G3xzUaZFtmH0l5Y0a9lRzySHEjRaudWYtw\niNaU\r\n=95Jc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDsI6gtNiP/84Ov4TvkNX+rM3yqqMkqIiiUzsGEpdq/ZAiEAn4nCJT4NMYgDlsfRqQIw2gzuGOoO+NeCiDenIsYqytM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.849703d9_1550998446671_0.11888915720798687"},"_hasShrinkwrap":false},"0.18.0-alpha.0f480fb2":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.0f480fb2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.0f480fb2","dist":{"shasum":"8261eb56e6a859f1c48594eae9bd8fd2e6c6a7e2","integrity":"sha512-qaDIvJQaQcuVE2s+/+hF6/cLsnYw5FLeaKh7lPDJmoBXY6H8V0A9hw6Hu7sVPx1iqCj+vmew4+UaXGHIyZ7txg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.0f480fb2.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcclvmCRA9TVsSAnZWagAANM8P/0rHcCMsZlHhC4EHG8O5\niPigFQszMdRA0+UwT/liKLoD7pJgHRLZU0EyDgFgM3ex1TNBqi9Y64mzRMbA\nLOvFVhtXyrvvYqpOk9DbTOr/oTGWueUmqQ87cplNHHlhGLcYsPoUhMcq+7Vn\nQDFv9Gyrdl8+C23H3/amIfN2TQl+U1qbVUW2bBmvXqcB16mIsVZDbHjU6T9/\nVd15huZILmhSxP7jz0ab4kdktVwDOgZUThnihRAW/xO4TRh7OXBa2sFHmWcH\nJpjZbtlypXG0LaN5r/GSdIanm+NLtbJ5qdTkapakmIk7FU1H+OUA6OKZCMTM\n7ACuUjzN762+mtegRzjVV1LrCyBNIQQcGDcHohrqI7K6KAfRDxgRMvWe3VPL\ngqZrbZPSLSG9hAhlC/T6/8TRx+uyO4HgqxwwV0M75kH+EO3na+8SPs8GWMVH\nLp4sdJtZVE9QNR7vp/f7j+9eYMEq8uxc9yC4XgmovEWDFFZanSm0lc6LxWeL\nHk7HI3zrBDWc2PkbirsCpOGcPaiiD8wZRTm9QWw6pcSQIsdscSNONm0LAzmo\niML2owTIl3OyVMimVsp+3zid88eHmpXsVXIgKoKEx9/76X+3swgZZAerlB2W\nHrlbuvTT6tOf2OSokoadjFl4K0aF6cKebm+RPZitwOZ2Cb9GB/tNGnsGSZou\ntPRr\r\n=kWUo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHgQsoCzlzK4NKZ7mRjsYI8b7C3JbiRO5esXra1hdkXLAiAX71FrGSAnsmP1ZnDyEjOFLFCC/H1/WxGWd1g0TxBNzw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.0f480fb2_1550998501611_0.23779681133976882"},"_hasShrinkwrap":false},"0.18.0-alpha.67555352":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.67555352","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.67555352","dist":{"shasum":"a7d7f7899bac3be3d86f9d0da5e1e93853d3731c","integrity":"sha512-XSc03Jh/sDtJMg4d4cI7WQ3C/XvqASzzPIGQTrsDijMJJ4IhjHmOWAaUeWtKAAvIMpdQZcDP4YoyCtlTEP8cMw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.67555352.tgz","fileCount":17,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcclvyCRA9TVsSAnZWagAARuoP/1HQyiZmXsOE13kmYLYn\nHgNhKB1guyEiLHR/O9axQVxhbGyxAyBTb9RnO5rEIU/hazUpH3Su5SmC8cwY\nLEbCaijQSN5nxpJgttUMdwhrkTYt/E8ufWs+zz6pYDOEcuJg7WiDfqujItMM\npu2+Aq7HIV7u9DVMd49zR1KjfIodcsAnRwks8o09CMSXaazoh4QKEZlpJHFW\nnKLdjrZarmZwNeBT3uRYctoj064dXEBurR/3M3m72lFbqAUoF4QKGZ2McHza\nLPs6LuMVouY6YcHVGIVQ/WtU6LOHHFRv26SEj1dHQ9SxH0nuCcfYjds4qaX+\nb1x1NtzqMZiSiDhcDI0bjPXZfMg8YC4ecx8MGb0ue0joMeJr38650o5S7dWu\nYT0OikPHL4aftDA0Vj4+jE/fm/2kYkw1mU7vKNU0RSDoHwteB5MRZOCZrcPy\nSqryzVpJR/CRfn/xr3gy3ABy1CzNBlzph7OXM1JeQFCM9Z6bIgW3iFlyZ6j9\nwZb0EemaQvYou+CyoCrY17smtjLKgZHCHZB81aZcVPJEtQx+D6BlTkQ0WnVq\nxwGM74rw0HvqAF4VDVi8asNehS1KxppNRZ9iobH52/27FphyozqIYVjfc6A+\njv0rD+AFZ2GmcDLi6+tJQeDhT/n8Wh2FA0GfYfVZc4gF6p1PwGzqZ4C0ZMxN\nLXnl\r\n=yqSM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFG6ADX7G8ykaYFpFTztXLTU+WqQgpv5GsIbDDXctYSWAiEA0fPpgHbRPzH7SifzQMkgLMCL/Kdn3dI2BC5OnxBIK/E="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.67555352_1550998513955_0.7171846702795874"},"_hasShrinkwrap":false},"0.18.0-alpha.dafd4ae9":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.dafd4ae9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.dafd4ae9","dist":{"shasum":"2884cae174288a854fe0de60a9dcfc2f5b3f19d1","integrity":"sha512-fssprn2j7oldObq2ruLTG6Y3kV/pNFs9EsfOUckpTyS1Uw/YjnEs2R1VR+wPi3aVF3EAoGT2mB8ZkTOhHwAI7w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.dafd4ae9.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJccl4HCRA9TVsSAnZWagAA904QAI0MFoHZnTbEFaj7SV/J\nvyCRisWdbbc5KomxJoHeny6CZMWH40dPfYiOSLRhjTQR5xs1AavA7R3NR7+J\niKsA4GEeWpXtYA1HQxEoXPQ6hW1GF1L2ExytsgmJ1Q+mz7z1lc268r0X9N7I\nFlbS4MO1L6ahUh+PeunZGno2ZdWyHe37DrWqGCdkGwFZC4TEmQmeoxXE0o6P\nbqi11+oPLByuNCOkTL/Or3+YJWF7xwBSX2gLIRTDjVhGZFEqztvop4My4LXk\nje5nYnWuL//l/Xe3Pkq1bfCKP95GOg0b6W0NxQsuR6ZYN1x1Fvtl5Jm02oWa\nRuOWqvzBqEieui6YaNqX5ahkZeD7hcg3UK0cjp4qmJqCAEhq+q3eGqnpYV+v\nAPl/Q8iU37Kgm4rT5uK5XqXSmhOQoybTkGZGP4csqdco8rnp0jAaJx/HIWyU\nwh9QqnaXhcn6ahIs2Zvy3y/24nzpQL6NNV4EDX2+pWGnGRHOy+IJyaQhpXir\nbfXoHti2NWozgzqUg9vDNLqV/+6OX2/RRbGyGjkIo5cNzttNHZwsPWOllzaK\ncB8B2imfE/VYM0qCoVqLkROcMk63Ba/boR3gbyRJsMuFXuNVJY7ZaLu9gT83\nVOhDjFbNxFaGL6GpYY1c7z2uNDeaUqXb9+ikvPM6p+8C1eFOmiQw1yfaERiT\nOJsS\r\n=PXQ6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqRoHjgxCM1CykU3Ct+Si9Wf1xQ7FPEIxyl3MW+F+4vgIgBzpnAwsi+j2AQCYvAfrdtWXZZCFgEdsmlMokwmC5LKc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.dafd4ae9_1550999046522_0.4224394148440316"},"_hasShrinkwrap":false},"0.18.0-alpha.5f1df926":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.5f1df926","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.5f1df926","dist":{"shasum":"8fbd0d4b3c99b68fae502cb5898791ed50fce816","integrity":"sha512-kH/d8xBcV3xKmn84IzG9W/68mEpY+9O07s9cwoDZLxs1dWQzngLTQLQpwbTDUcoe+5sey/ROwe/ke09X8/R7Jw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.5f1df926.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJccl9TCRA9TVsSAnZWagAAg4MP/RWK+HrbeP+KXiyoJlxu\nnTWquUIkBahCFHovmvK46MP6kfofPxuEB4Cf5+5sddH+O7ITqyCh1sTTufjj\nfof2v34nzUGCLcao+NumiBzKKmbasTWcvSHAbO+nz2GakPkDG+35GpohE+3Q\nkiS6yLHGMIjv5ejczL0LL2rPEy+RWskyCwfrHQZ6D5hXza4iUmx0XtZkyv/7\n4Dw6AIP9Rxvt03VgMR4f1E7BIrW2meLU/TdeOTqMKyM10LyErPCVZN5jYZlS\neoy12cXaNy10hmth1E0MpAcgYga/IgxQpgAE/OgQFV+wdWTlf6O3+Sv3wxkC\nYRDpVw+5S8RWXDz+aGg1tAuad1LMEXHTgCw5ZZuD2ik/QYL/AaJMrbWKcTG9\nQganK0YZfbFgGwlTQ+r0X3OYDDF2SXhu9pkhnTavxh9dZ2BaD6RjSyIxAiBc\n/CqJhnTlVpDg6xvnd5rwzcSn+r5YZO9z6cpQuj5NvaOZwpsqDgWbf4uMg7NT\nzKqYEwY53Lg4ljQmqFUjWmvtwjbXivxHsgQH+N0Q6QwUkqWG6cj3pZ5b7HOi\nD7JZKUfjwA3RA5sxREMRBDQ5kkIInEMWVeSc08z0uECY0XDiXZZ5C9Jla6VG\ndxS4hBbTvnCw/WCkuV60L2UFW5QG5QwV+HgtXhGc6bHq8zpVojwFpR7N6qf6\n0AK2\r\n=SPwn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSFJCE0xb236pRDwJk246ArYCUG8XNjTegxkGPH0sVuQIgI30dScYT8qtdAfzbbVkGbmiWcNDsHw7Y8N2svqP0ORM="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.5f1df926_1550999378176_0.20702664297041662"},"_hasShrinkwrap":false},"0.18.0-alpha.d1f1c3f3":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.d1f1c3f3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.d1f1c3f3","dist":{"shasum":"f1024b455be5e8aef266aabe4076026d93959274","integrity":"sha512-NCvcwAMg9CcjUsSQ9k9161c9LTTrg4w5RBUp+fLvlomikNuWE6R2xM4+BlUNHb2pz6UUKDl4FFtJopSgrkFiKA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.d1f1c3f3.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJccn+kCRA9TVsSAnZWagAAescQAIuy1vI+XMqnsUAYh5mz\nPsarWPW7KtDZ66RIbNfQ7mVyKQLoa/OKpq71Wmo5jLKeCIieuKkwJd8KV4wY\nQok7tC04AB14dAiKvbY8pAXgPhaaCEkRHImdauLT2+Op4nEZzGS0B1eyOsLQ\nvjgSBtJV7HvltwWj48gA5y8jw4C+x4Um159tLTfvI/eAjgxVYq70lhrBFoPN\nr/+0Hei5pGSqJCo7WP1p98JGKh7vWmqaZSC5xBVoh6PqiF2kU2BrC3jB3svH\nvnH2nPjn8YTz5Cj2f2McPmCNK9kTyBc6WwjjyXGCPG8Pv6Px0epBhPDEFHv2\nqDInoMQniM0SJt2L8Da2akttAt45itx049Y3I8L+QV7v6BCRKExR2O8KHpWK\ny9wRp3H10rM+YUJWV1K/z6plH0dvFXEkBR2cLdXmOHgoHK5gduW5zemMHx+x\nAicSud3yEcNeR8CLCx0tjaXsTlbLhcg1e5IlZfI4s0/vthCNN+/v+RpRSw5x\nhLD/n7Mksxb9KkWzEH3waGUm6kwScLzqYrF8TuOPXKznpTPyZRKpduOdPIN9\nLdRR7cPBWHxS2+eGbR/jE8JpwM3uikoa7YvRA7S6ia3TpUY4GfrnnVQSTOuI\ncHHmlxENgjcBUSht8SEXYsDbg+1HYX75gpwBX3GAix523XjDh1yOc+yV9Qxl\nolm6\r\n=N7Vy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDn8jpo3X0NQJxw4Rbwg1bAOwnVsijZy28jo8ptdg840wIgNihTxq25u0Z1eA1pjC0rc6VGXQ4uq8d9lVI0u0r0fZI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.d1f1c3f3_1551007651457_0.6700114831107944"},"_hasShrinkwrap":false},"0.18.0-alpha.87e1dd92":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.87e1dd92","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.87e1dd92","dist":{"shasum":"f8e8492effdd07d8c7500a5bdaa5de09e3728e90","integrity":"sha512-wbYxG3Uus1+VIsmA+bbHhzcwvYx+HhokQtSC9yM4DfqXKNSOUsqhWGjxxdOahUybnQiAphR11ojTZZUqWDupnA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.87e1dd92.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJccoqACRA9TVsSAnZWagAACUYP/3TEwSaix2v+es3AhxwQ\n4nOCp3X9UVQf7Z/9ROpC2j1SHJ4VrFLBpyH5BnS8b0m6Q35FLNl/G8BuZxGS\negqZIUEoNG/6I1frdu14K0zK6DH7A8KojPbVK47rWtuCYAonB0yQZSYJF0ra\nXiyIsgA6h+EPXAEeObAPC3xy4QiD1R9i+at3O3JYPZx+tSKyTFICHkdz/SV+\nokdgpQd35MYTgnObjPG4PigPYnEPoKrkQdf/FTkHasyWkiPdF6t6g3MQyedR\nseRfQ2unU8fa89NaH/IrBzXhUEmaNUCDVXwGZvXP46w/fjmot0Tv+9OklTlY\nKbCUBe3XXAtZSLOp9MRryRdc06oYstALAev1RldAC+6XCjfJMa0DnQv7X+I/\npY8kg79CgnjVNQhc2jDeykqQ7Y5j4KrP9WJ8ADymfAUHytSqwViEFW3cIq0P\nMAKNxxP+UPFezvklixMTuZ3rxwTXzLNY8wBJBbnhhmnNybRsFTjBYxsWsJHw\noVVAA/1x6Azl3eU94+mFJih2RvTlQ/Dq4k5ks6FXhHPo5NSjgKCv4wZbzPC5\nvaHLKJm1FqT2TfsOfRjJZrxd1QMGHiqlCFYs4+Y2Nt4Vd1fbLXHxigni+JBm\nhw+ybQnqddWHdRG6L0KEAbOiBpNGvNApVgAO1W6AhDdQ/Y3WpvI/lQIUhur7\ntnVf\r\n=lmlH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD47Xpf98IIhMFFMI0SihaxejglVlAYxxNGhpLRIGXOoQIhAMSG1InLT4/IIu7XnJxpOZqIA7K9NNJXBalZ2gHyod6c"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.87e1dd92_1551010432221_0.07989043193014345"},"_hasShrinkwrap":false},"0.18.0-alpha.5d4485ef":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.5d4485ef","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.5d4485ef","dist":{"shasum":"dd458e8365a5b8974b5529eec21b1ddffb004a4e","integrity":"sha512-yWyycOZh13LPcpoYUpPVUMD+pCKuKLinNowFxY7EmcHjlDncXVOZM77zTA9p/sfifvfmWeO7M9srMnwrDmncTQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.5d4485ef.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcco2rCRA9TVsSAnZWagAAG40P/33ndfQH/vlokK8i9EUW\nXwoOqc82ENDYdO3oappFeF2Mzer0NCYAswupBYQpGr0RQwhNkyJpaZcK2DvP\np42O9VmGEXvB/LG6pTy1P9mG27rXTTCRe7/bUrH+r5+9yoPFfKgulhSLPJw3\naJ3nsjO6HME+7RCrRQfvB4j/Ar5Wj4wbD93nnHrr69HVWyd8i3M8rd1jTkgC\n1r00T6+mda+ZT8LhSyx2dNTvboGialPyGydtCWFYEIHLemu7RIh5pnr1vjv5\nIqJ3wlJjrr4BLb0tJU1cJ4p7bDyyk4kEA+Y4eeQXhci+LY0gBR+v11IGgsBt\nY0W9ixTu9+9K/CiUsVUUjueQWoZVoISThTzblx/NiB+HzTqQCEda5XBAWrV7\nXZUhbe9pyU8e0sM7IvbzC25d4Sruhrq/YAbdwsxztZ580S5CuYAGFZGEChqw\n2/UXsQxiVypIUQvGG2JC/bNFq+s94MTDK56Ve6yjKZD2iTv4QHKWzmbU6KLS\nD/ZVYpMebAyeExUPen577bXFwV+hYowHSbbg/BLjGzZC4zN1vMLtLWmlWkRz\n4YqImQJgmq/ZjoGkGb/igS4+UXioJiVnleCcIkWo3GQVdyWIaEUeFschbOti\najtuOVH0cwwflvpkG4uqzXvTxN3oIf+Zu4sjumYg07bfEAHb7e7+B89hNBjC\nYKrK\r\n=yD3f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDoRVqQrcyU7fOSq4x9W7vvth8oWi9OW0DpsFfrUEP30AiEAmgMnANAjwF5lIafGOSmT6ICteFjKZXFB0qnUY3+c3ZU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.5d4485ef_1551011242760_0.6355317264535678"},"_hasShrinkwrap":false},"0.18.0-alpha.adffc901":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.adffc901","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.adffc901","dist":{"shasum":"2a2bc439bcc4bac88c2a0d948af83c8e25237983","integrity":"sha512-vRnXXRA4RjQARrIvpHfBYspJbKjoqUxohyGNNwVMMrl4diYihU/WWNvZGqz4NI7dRAUgkQYiElU4iNsSzw4B7Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.adffc901.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcco90CRA9TVsSAnZWagAA9oUP/2bB2lGKl77psDlGeXSm\nkxPwppm0ciLTl9+Lu1vnWv5mjejccKG1JrXKv5TURX3QSNR4xFpEZGjLxxYR\nV5+GGBdD1LLk+kRN9W2zUl6LqlEQUJHmWuZkdjymTGSRX3/0fDl05at/S1I6\nbvp1bQX1/9yDyJ5Ad/yXO36f5+QcKn/OKDAQHcODNHSn5fuJuVU/slIOssqf\nBE73Zm522IXg17jQpIv6xEWhC5QOYI0R53QxPbo6icUYo+/V8MzuwpBx631r\nC36T6HmpBRf3iNygpLJ/qjOnPfWH2ZenNVw4n66poU4aho84DkRc1fG4FnCl\nDXLr8RrUGJ3OutLN2Gqw6axv+iqjLNsCCoHjI7tJD5Se6pvxbOTfZZ0IGtGg\nekT8FfR0p/dcE17+oBbmBAki2+YjJ/9SZOF9jXqmqZ9N+IHjrr26Aa/bvdcf\nLCfLQIt6wph0Aq5l5rL7A9L6c18JJVVEV4QmN0E4EIqBaIaHbvJd6CXmIGdr\nuYoCcz35a5DGz44YnsYmRHe5R8+n4HbPxZPjj60b5Tl7D3TdMLJAqvDov2+3\nv3yK0bkG3I9y8M/DQzddINEPfrC9uMqedZa29XrCgjB4T58RtepHuysqacpC\nQsqw5nY8Yfm2Q/Hm5bjHnGdGJs8YqjE5vy8+8eaP7R42cdF6VaBkBy++aZoY\n7f9E\r\n=scyR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFo8xXM9zoA3RlWDwJgP52LMaqPures03zpn2Z6eXvJlAiAPnwgf0btsTHx496wsCbElQYIAGssHBuyQce7/tKE9lw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.adffc901_1551011699244_0.9993738952120608"},"_hasShrinkwrap":false},"0.18.0-alpha.1d6f8f58":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.1d6f8f58","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.1d6f8f58","dist":{"shasum":"9c4fa83dfed9c9186109f023f0f0f71e80a4d6b1","integrity":"sha512-/4C2PuEh1rWTHukDXhSLiTd8z30RZ//5tULRJeRKwnFxJBghiHW38lSo2GNT1MkTFsvShvbuoYBLZAImnT+pjw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.1d6f8f58.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJccpL4CRA9TVsSAnZWagAAYXEP/inqD8kuO/6Un47eKOLw\npvrTtgfigcsHAjtfmVqh3kZKBmIWrh8jut1/ImUeI4hSvevamxV83Ph67tit\n7fG6I0w6iiTTVyoh8wXEXU/eSxME8ibJIT3Ik6T4pXNe2K3KIqPAVnPcyJWJ\nVA1Qp4SC12noMvvL43SEsGo5i5fKaS1vtWWbHMA/GV/T40awuGAK8wap7/NJ\ny4RxYuogbtKaRayFekL7tXj4CxcrhT92ui5W1c5oj3+ikzvMF3+UbcNQElB5\nxOSNk8SnVGrMskcNcxY6BqL6peU+JQxBRHbU54l6MPRAZ7dva1r83qrkzDV/\nw7YktQu7A0Bg9OQNXQHXjw9vmV2s9n7gCo9NJEndc0DOj8QheaLboefddk6w\n70w72ChJSUX66++smGgJnAXYMnAWplR/kV7hT0zyJubDhpu/4sVG1djeLOv3\nqoYyDE2d1pGiO5hGV0fCVc4dsCgEROpEiUUYmHtXjl7HRzaTDLB37CGp0xBO\nHcnmHQPIwB8b/q/YAUZedkWZ5dNtpo9OirUAdrcW0SNRhhUTtF9jIbr7F3Cf\nWG1rENlcS5WQzAyDGp3rrzvg9QGFJFX1NaFbD5m7uqn4WacnRNZbkEMS4bNQ\nNzCtqDIUpqj1BbFGmMzuremV5xBD9HQT9x5Pf2NkX+YglF8s4JnJdm5qWgTr\nIx57\r\n=vfQk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpxjWFVAHW4tOSGaEIotRSGYbLylG026Pl4rNLU8/qbAIgIxr9TiQ58WTLtSejoLw6v3ZCtjLcqVWgLfaQe4FT2oQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.1d6f8f58_1551012600209_0.3325821538818283"},"_hasShrinkwrap":false},"0.18.0-alpha.be27c7ee":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.be27c7ee","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.be27c7ee","dist":{"shasum":"76b848bd342663140239784c2350635c4fca4c09","integrity":"sha512-5PW7ROnaN1CJGE3/z08rPWMogu8sp8jdmvhA+Lpl44xssKsWFcoFf8nLh6DOQn7E7qThVzheR5vRIWydnK8ngg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.be27c7ee.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJccphzCRA9TVsSAnZWagAAbvgQAId9XVe3SQL66N630OEb\nwFw4ZYSMfLII44wv1kDoTcIJjAL0BF09Xc0RyO/X1PjS1KvyZcyIoojJpFZf\nF4P0Jf4CIx0tLfTeRgGBp+B/4D37iZezf7dToA1htknVF2eadub96TemheDj\nHionBwWTWNhGzHHGyxwqHWPs19Rt9E7MWNjIGF+obH2A19atueQN1p1SdHVY\nPCitnkZMKaSHAFDNlufUrkX/P9Y8RRfBCWFoVBDwflvyrdnLbSMkZBDumN75\nn1gYciqSxlBeq0Jw4+esaH1ejTPCMSg/ftlUd8cjswotxhbSPE77TOWxYKsb\n+zm/6clyoQKMBayrZkalElQl4lGquaw73sZp8dCK1BA/RrfdK9Y+ZMiVY757\nnewNif6bwoUTV84uAquUDwxv3SDTu/dlXW3p5YygEhUTZDoiw1/1Z4K3IUib\nC/kUYNIC64DH7ryPWIO2aFQzaZE+pr4QBwVFhjuieg3rEYUOEa0ncNjX8OpE\n8DCm9YIruXupOx0Zf2Fsnj3gqAGW1sDvWiWkfPEj46UyZOb84EBchYJG/qWH\nPGHtFgypGo97UucTCNif3KJ0OHdWbdNHsMhJZUGoPbt6t0O1aPuWohXf8drx\nRc30e6W2pGmTB5ZRmaDuIgVGUAc/DLb7gBoHD6c08625c+zw0GTu5Bmi29tk\nw0fU\r\n=ro4G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOHM/QpK+o2vC0mNMe1od+tGUaYEbeidCck9+xp3hAjwIhAOYo6u/nV1ZVqhQu/riPL9XQI5KKnOx4pE6MqispMxhn"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.be27c7ee_1551014002705_0.28144201690470405"},"_hasShrinkwrap":false},"0.18.0-alpha.9f16278c":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.9f16278c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.9f16278c","dist":{"shasum":"dbe7759a2f5c65fb326a2ba93bb93a088c655d93","integrity":"sha512-cnW093rdhsF347Xsdj096D1fS2t/VEd7lW2WRS5zi60gU4Ccw1hO/MYSPINsePLB65WMy5zta+uwDMN7IkzeIQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.9f16278c.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJccsCwCRA9TVsSAnZWagAA3bAP/08LiwzVXvAdCWk7FGAN\n9SzkrYJA1aFg1D+a/Xgv8DItmXzHU0+0aoT5PswKfG/RgKbpGamqXaYWAaou\n+oH/qwSXPbyyDCKD17VDhG4Zlc5WI7bBbvdz4c0485xEAT70dQNBHuvGgDy/\nObwU8t2YVPt2HeLV9bzVrFVjaHqcbk/K2UB14AR9R0csJj/uM3pZVK93C5SS\nHUAQp1kfSv3KOOXJ3ItSaMN5iXrY/BBwUqMkDEyvkxJSU29D6X5L5Y27goJN\nt8FDU1w7u0jAqqOf2kcKIeUSQAzE+w17vNZbYZ3MZXq/loeRQgrGfmX6N+jc\ndBYjo/9SO4CzTj75zeQi05q7/PTgofdq1fiivDz+d4B9macpneWDPux0lphp\nUw1xdwbfi6TacQCGWLskGMmLxths8aCXh8Pxs0Rlw/8c7/GrLTQQ+96D/M2l\nhEfE9YCeVhTq0OU1Xylm2nRilHa0NdexzzYMdhfI8J+ezW8oilFRjl/PeS9L\nxqmSm86l5NFY+eIf43VAVwsWjghCgg2Gp0H+kQyOJ9NA5dQnxdmgqGGhxAE9\n72AtDvuA9HTa27X1ukthX9y/MghoWQG8YikQ4qovTtQ1A2/2xVf7XeEtqp6h\nWEPNEvwP/7GRdTVlkg2udO5BsgQYkCBraIpbZLe2MawQZLwVLiz/PSRhYPGn\nk8dd\r\n=u751\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClwS3cZ1VkL6ENleB8eyherdkaXGoxuLPUIDhB9CR24gIhAM1EhrzugEBqVQfv5jb+495s7eMP2JPTxwK1W+ZcnG62"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.9f16278c_1551024303931_0.6478039426983793"},"_hasShrinkwrap":false},"0.18.0-alpha.23894f08":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.23894f08","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.23894f08","dist":{"shasum":"2a8f5e6697da9f9838a42333d7092efc96dd396f","integrity":"sha512-Z80VPRZu8h7nrBidn8jTvmQkCE86wURS6OiSCZ1TInx0Lqlmnn+06ytwfQk5JSDRBggL3shBT+q31dznjnBxjQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.23894f08.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJccsHICRA9TVsSAnZWagAA8oAP/A0t8mCWzrkR/Z8A9wTn\n7EP4dEypztqCh+Q0wbSykfHAFaN5FJqEb33HHJsWrsLOXbY9XcOU93tTkPzb\n0PrUGMf/EmDp51fFo/ITx3Me4SHT6FqotFlrQ2sw38rKKrli1msiye8Y2J77\nzKRfuklKCPXIunXPViBRSPlFjre4hs269cl/9El443BSJ6yuK2aBK421XgXN\nNmxdPCCEzCvn64lPvuHp+WC844q15Rl/z3fzYllEGKXM7snkkdDBP06vFeuv\nskwiNWRVzi0ozS5LEj7M2CKjh9hPhp7JJVuBM3aSzLYxchpLneMmxv6MiwnI\nEiFU1Y3hgbfUQxRDCHLYF972Wp/IwqguJusJAVfGoJIMY6NIUiDtaf32TV7s\nBCaMQmrx90wf3hmr+nXYs/SEErhoQNgqfdy9ocXv1vw01r/Ljmii1mKuJvZX\nTCi1UYdkOJ/DHO0DgdmtsQwD6/gfxCJ2Z/FKE06wbdJGLXQmk/uUgY7sNerj\nEHXSi7qNLohv9WPWZXYiIadigIcH0c8jlfCXWzmDVD2bBDobyDQ14u19YSLf\nMhiPUBY1NblIRU7IYh6R/ukFC6hvsTshand+Q3cEI9o4sOElxNCC9l8xmzVu\n/wfMpU3ax9SO88IGKsxIdbwwvQSUUpl8jnD2o9oTWIcpCtnX+9a0Rl2BVaAs\nnvvs\r\n=QgOZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBED+z1c4/RjmtJG54LmoIZVZFwAolj7IHW6ZAV+d5utAiEA1KFdgdud8Pt5epgSfsbIkj+9f6SSbJlcfsWu+3ZnTsc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.23894f08_1551024583576_0.688667826838536"},"_hasShrinkwrap":false},"0.18.0-alpha.51462830":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.51462830","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.51462830","dist":{"shasum":"06feecdd794449118a93c782cac8e6c5a4dece78","integrity":"sha512-VVw3Z1BE7piHy0vZ0/bvGBF+vpJ1m3tdeVn3QiAT6Z6YYBrObGjQY8zqHPWyDi7CG8ErSfZBsElvOpGfo+zdtA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.51462830.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcc10iCRA9TVsSAnZWagAAVNoP/1++sOuDWRht0WhVXzfm\nkRXZALvKcLelvJHPk/FNTsR59oMOsvUcZDVoOhgoOCxhl14IlwpR10vyZCBZ\njkelvMYh8QDaKCM7g+51bh5E4bxWegZVt7Nsxl3rvK8UABqgIaVdoQnhuu79\nrdkK8JxUN2rvaQiSkeAvbLcvcChjZr4+ad5YuLDPkf7FyzJNoBffU1pxKJ/G\nt9P7Q+CPFI8j0ba1sh2uB3SExqdT4RMNwCyfJYEFxiFh4eJFHi75kXS92t90\nomfXPHMJnd5/gN+Ipq4PWpXeU8TQmWHUEBDye4KDUAKEIo1Y0V1nSP2WNbT5\n4+ez4DIQ7luJbohGKfc+LG1ep22GGXjFfPuxxFZRs2DtngjVeiNpVsWNqD+K\nW89Ha8ZPqEKFFdcgB7CbjaLtKwS1z3J8wwRn/hRn0AZWzz/N73sD9AgXeHgW\nHZGQMMFrp35Bqa7QYW4I0cUWkYBwklf7agJFBOd6P0DvOr/BLdm4jALIGpmZ\n7f3c3I2Fdxdj+w1iCExDvZEOYWp9TMiQjC2Q1aBsnk/eUUfu20/opYcLcXyS\nNkISIoIKyoVC7hNd+ds5MxESWvmO9jesUwL4A/Ah5uB/HmsPD7AbJts3fONw\nlGIH7zYssmdPAthIQGeydfVeGF6om66aq2UbvELjISrDud0a17m1q9+lHKh6\nlYEv\r\n=w0lB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIET6f4Sne078WGr2gYbS8kjFgegNbbGaIhmznI7GQW0RAiEAmw/pGcF024Kz3NI0E/Ntxu+eGqLjzJXucK7ntcf7qy8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.51462830_1551064353406_0.6427019400835563"},"_hasShrinkwrap":false},"0.18.0-alpha.2da37bee":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.2da37bee","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","tslib":"1.9.3","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.2da37bee","dist":{"shasum":"bbfaa2a093a3f1175bac55f815c1e0448d2c3822","integrity":"sha512-r7sxxR9V2je1W8Kj0SpscrQfwArTJqHhVc7qkQtvktGXKDUIzb42yz24ho2tfWV6x/i7IZQOp2M8hRkRZ9AraA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.2da37bee.tgz","fileCount":19,"unpackedSize":17283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcc5neCRA9TVsSAnZWagAAifYP/1xByJpEV2DCMZzOjyvI\nkfq1kKkzb1F9LergwNhwBJlz9ekeYEysgvoTuzVsEE3AbxBAf3SmMmKsQPy8\n4PDAMl0LPO8opDWNUgenLztagSAGSetxyqaqHpxSzBCu7Ah/yGT51OnkTGOa\nhgETlE4RCfCig4jKdIcMszuGHNHLQRu3AUXh/xg5r/b6KPRVE5ACXs6SC/7b\nDA+BoY55+EYqNMevd6MBCsajIMkfbBw8EGUVhZZ/nA/CZe/2gTQFw9+1lrjU\nMGYQyTQtn51+fO1xSmkZeAh88dodpT9JW+7aiLv2Pr8StadfbQ/Ei+huM1JV\nu8pZKPhC4VZo4JG4TKkUFPlDKUMt340Uf+Jd94yYa5yoQZhHhcIaYl2X3tNn\n+L3j6XI87GeZPRFMN0vMvzeOeJwrI4GDGm0wohqO6BQgaA9HEFdhipQh5w7s\nqnuaqVPS/s+drcPnJyKivfjLEAlrzJp2JMmvnsmNuAjH99zJGZ6KEcvrAjkF\n5PVk7PQMEjav18HukRoN1CrCEHyIitUbqOV8K2YxF0sKraALOCz8iygOP8F1\nDhZQ13RjuGZ/OiZx6/iFUaS1ljExOeTpaw8elh5pwj8SP9s1Pfz59wRzRZml\nue0z9aEwu3U9wwzgUSBiZLhh81c1j5DHvTJSvhzna8yhMSPtC4jEGVG1T8ik\nMago\r\n=z8SA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCchKUPypwH4dyIzvYx15QWIxx4w2cY6o4VlsLaUFUOqAIgeOUuAu7FHb6wbkvHufUUvMShciwHsO3pR6uv4FzojEk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.2da37bee_1551079901915_0.5787309296908483"},"_hasShrinkwrap":false},"0.18.0-alpha.069a87aa":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.069a87aa","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","tslib":"1.9.3","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.069a87aa","dist":{"shasum":"9a705dcc1afe73eb704127531e2406703bfb891e","integrity":"sha512-HpOmMNSme6/6ptEuSjN2m3SUViUcrAWjN5aBxH6aqE+z8g4jUeQnZ8SMJmkHyBydENHXdWt5Pi+osA1NZZKk9w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.069a87aa.tgz","fileCount":17,"unpackedSize":16057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcc569CRA9TVsSAnZWagAAdW8P/1XWDullWNk1WNgmtPMj\nu454aGdEO3OKPAE3n38w6/E8RAVlg9H+a8UoUrvGWqpZIa58FXlb4wDMX30M\nQPY3Rmowz9jTeBW0iJYqdZC7BK2f9eLJLf1+mSQXf8fv+LOvLmjJ7YRBhKZp\nBYgIyzbPW1WxzX5UTTUCJfBQlJnbBcBveR53IzSthdsbnD3F9pcFHTLF9X2n\nKlN+7Jhdhm6lC3oDjNxAVvNnOBuK0J9qDAjlAz7LVUBX8y0VFFq6Y53kEc3H\nFWHG4H0mejwoaosemk00pliqJ1s5YgbpkgBSTbRmOuoGFD64jBaAeLTlFIVJ\nLCJQwIIWQouF3VC/bJWL88gAsOwYLy1VFg+rSuD8SKZAET3v8y5P/HTrEIuv\nZE1zAPRXLBEOmhmlHdJA4LEI7q4Adf9FBY59yuXlJ7ZMV+pdkIHCAluKVFhV\nnqLmYbedh3ZG7/PnpNH/9ghGbYU48V/LfOiivXfCTq85vXrm1aR3v9FGZZ8Q\nWRNVT8WnvCDD3Vc7e1C0ihnvmg0Hlo0uxBwYMe+xdw5x2d78GL1Mal6/RoFg\nVsiFCLxRcQQo74ONWXp/vkr6+FA6J9kyKp1ksrWRROZUVKk6p33AXqz+DfcO\nFrXN0OTsaFEjrhsYBp4AhVrNhq7WLpDC4v7BCnm/rqOyXKA2go/2gK+8rLm2\n5e4M\r\n=HAVo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICkw2AjUeZPSdOFG4uEbupyei0fhZh5QuYB6kb3Zu+BmAiB/B/5BUjRFaWHCfNPgn+wrEcSIJ5q4p0B4g3yKJB21lQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.069a87aa_1551081148723_0.41632809029414797"},"_hasShrinkwrap":false},"0.18.0-alpha.81383c0d":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.81383c0d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.81383c0d","dist":{"shasum":"4a3d1efe7030340eb11ad8db063d649553e98999","integrity":"sha512-wJ9peqJla8OdV/JV6Y/t1sIZ1LaFtYwxhCTYpajnZ+uVImoAJBHseqEIwUSwitRuDHNCcbWZoi1sj6KYPMt1VQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.81383c0d.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcc7JaCRA9TVsSAnZWagAAXNIP/0Pg1lpLrKoBCRNG3Ugj\nPvm3fUscgvzXZVQEcgSuUlQJh5s/wFqFHA8xLUTrjHJU74pzuUxJj4jde6kf\nyFUz/H5JVnLzvuaaEM3OArZ2WVD3LamDtzW1kd7WWDe65461lmcCm2V6uRLa\nV+lme2PZs5b7H5+Wy+srS6LK8F96I061S9BnvU+PD51xNhUS/hDkTIPJhYCY\nYuhur04EoGqaK9lxDu7T/RKNumoE28gI4SLTA3iFCwryvdFuU43Kwa+7imC9\nMGq/Uq+tHjcw+lESlbriCPbcfrso/0Hf0WNfR/8Qag70HUnHsMTjpMK7AhQs\nhvvj3k3AJgB1Mw/eRHIhLXV9dp//QS4hsH2etO85gj0Eh5Nrwd/JZPVivPgs\nJSzjJuESQU7S0lYZOvOaaoI26tMvhrk5mZbk6juFpXoG5zmrr8cB3p/On5WE\ni9e+obOjbYX9Hpr+NVFH7jjKXlYlJA+R6OM0DwvOQGSV0qAzqFppgQZ4yPi5\njaqIxbu4RYgjsy+gQQfzxtV0vgciiLlW9ihIKw6fzb2jOhyceh3Dr/3oQiIl\nYBli+aKxz8B3M4aj5mc0wpPkvDIFH4HOpRAvmyUYCh96vToeeo9+HZigtxQp\nmU2nsr+9dhT4G9tu6k5eyBlUPW707jinicE8AidIRZQN49zPmADQzcVffst9\n4E2j\r\n=jr4q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8xDwQX4Bjn4APPvrNoqsBTTKEuwHWtGoEMr9sSPmsjAIgM+zpynHpI8rUhNJJGk91KZYXJKTy9sTfwi+Wy9AIs7g="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.81383c0d_1551086169975_0.37323827442745916"},"_hasShrinkwrap":false},"0.18.0-alpha.a2757413":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.a2757413","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.a2757413","dist":{"shasum":"bfa019901ed78d58d5989a6f82db1aab5a285229","integrity":"sha512-iQWW0RRTrkyD9/G/cEUzkQMoxOnC2TUkBobdxdQg1u1iT5DWSHd9tn4TD6OMK77+Vr4THcbkvMsyKics4Z62Rg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.a2757413.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdAWBCRA9TVsSAnZWagAAEA8P/2ZQ12a5I2gtqGCBIGn9\nsoLbFvvW3u+bvsh6lHprTqj05f4n+9EhT3wDwQJ7HKl5KHtvBgynOXH9Brdc\nyfIrhdqqsI9zCdFw4e89OqwZs2WWntEHx2t7e/5xy+aKz/WXHZYLS3yAkSH4\nwxoxVViaFz4o4IKXDdoDJg5rVNzHduFyS3q49kHzmSseEJdtmcamI6lMsVdh\nX+roit0+72iusdmXtJxJdFS3gqZoSB5gmkRRpqZHLZwU1FZsvgcznqMAo5Jt\ng1YsCTFD6KE1xprLFnOqOqqid5GHXvLAxSoxxipMl9AYojP4VnbtBQXLo9Px\nFv2doFw8s8ScbjuQqJgVKykoG7HSdv+6ST92Q0KGXKlQib7paNQBu9seFYfp\nI044wgo/Xa4x9uCQomTOkmRExGVTCXssPLWFYFgpIJ/NwzQvcAf0oDIIjEcD\nsbtln1KqYh2jkmu4ZWp9pVm262gl7jTdrSyEOxFDsRNUasOo01fl/sERXca2\njk9u5iKaSogbpumCEmEle+OZ5PNDMs0k3WMLNBf9qHXzg98nvHvZXv+AtJ/I\npag+yw9HJz93kqAGJZFWrpbQQRZ5T8UzZBR/4HiZOPgkhoCKYy9PUL+qS+2f\nHYJv8DZ9sItZAmMwhuAQTeAwlkAWp+tTSaiLuPrbARIBdSx4TMgFUyJBN2ZN\nH52I\r\n=FcDn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICsnF6iohJAgp+c3KM6ntb4AOgfu65e0QzpbVmhc6xA2AiBTQvWX25yfKfvEYLrrxR4Br66KiOACTjvHvFQC/PpMjg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.a2757413_1551107457176_0.5179072431972935"},"_hasShrinkwrap":false},"0.18.0-alpha.852a57ce":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.852a57ce","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.852a57ce","dist":{"shasum":"7439c96a4f0d08628aa80506146c57568d0771f5","integrity":"sha512-nXgpf3oGYllT5XOnBpeW435ybPYoJlTwSLyE8BaTG1tlu351UIjDzOLCe66RouAlUDI2rARPwE4Xp1dzTxiIQw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.852a57ce.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdAfnCRA9TVsSAnZWagAA2V8P/0opF5bsFlt5tnHUEx0S\nZ/k3L6dw8n4MmDgEUZZRd+2O5Ioi8jNRr0G7dvAGc0fk9XsJs+CRYGRYNvJ0\nUkZwxJb5Uf+WCsNkrRSqimnM2ttc3Cmht2qyF7WatAOJxy7S+PgTVdE71X7s\n28gUfhboXcIZfGyy0KvmSH9Zfjao0JPN+E0ppcvC7Z3wSQHK9mYsdIs2qG4a\nXgYb+IK4IqmYOn2x6SVV6SsddytawLtB/VyZ2ebe4dd/KSTludkdKhiEBMk5\nOUtzvEQbzySraRdv33xiY0frBNoz9DHxI6Ul2qP6e1tVBUTHCt4MGp+NXAVG\n8snGAmOzfuiF858QnQ66TF0LEEb2ExMG8NM7QTrbinLhXzIs+PRZLRbMTcE8\nGKfI+w/Mmtf04scpOUKWaWAOxGxl7xsPQ425Louch3NHZnBAQ/iyrgQWc2Bp\nneYFQ2ejF37Qsrtj1hdtlsFpCGg6RUOnfvqLSYudB1WJyr+mTS0c4Fj3MPGo\nmLb2w5OGDrdhHFg/RyD5QqTYuh1B70GBYqTdDiPVuX7+zpE1NAM9bL71PW07\n83nVfqFrybq6kuAI/rpM6/6rHsBtBVCg0yaw8UgmzjvOU24kjU3T7U3yZwtT\n7ZuJDtiSuJVUBbovbEHyiGqv9t9oi7o2gubr0OoqT4uhxfR754wfG1nxahQw\nJig9\r\n=+Fjd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE01e6MqtIuGD+r6n6ZJvXVnvZULOFTJT59dSOrKi5P2AiBlAULXUMqwgbyokuXle2PNn7gnVq8KY8to9Hhzf33qIA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.852a57ce_1551108071019_0.301969391199884"},"_hasShrinkwrap":false},"0.18.0-alpha.dfb774b2":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.dfb774b2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","tslib":"1.9.3","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.dfb774b2","dist":{"shasum":"5eec43f2dad11b8dfa5bf0e4cd35f85c57e6ed7f","integrity":"sha512-L1h8VlqnPQoLfHMmN2YPYuDuP6jgTmP4BM7fT2/iBom6Gg3jFIQRu3NNdpQRrFOcSoBZ53JAU4PvB8HKGySanA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.dfb774b2.tgz","fileCount":17,"unpackedSize":16057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdDnjCRA9TVsSAnZWagAAwoEQAKJfxs6vyHo0cTypcH7y\n2kRVIBnQPxM/7/0yW4wKLuHaad3O8bpVgri5l85lYk/cu9HwcUUiqTvj0cIC\ncGKhitD4rJsdWginx/hnT01wJbQZDv9imHFLht3aPZyP3+f1J/UNuMZpZG2R\nuKFefoD+AFl+M0LKzu5jP5hFade530FWOMuQYsoHM63cV8c3J5+z5p5WKutQ\n8Chce6Y1scGGpk58f3762wiBU+Sk+EG8Ma6qEWrJCUCNeknUPhiU0hsU2o8K\nN3ok9jYSJ3RkrKooi8LmRFuWIgTsIZLJRN9TVwRHJmLMHr+tQ+ed087bRUB1\n+V3SbLk1zupp8k1a3IpQIpXdeNJ++BaQREeSjhMQscu+Pqz9ojb4PgZrHVrA\nk6b+SS9CD6QYPaJeDZQmLmzTDmZicrFAG72QlnQ8oMGzxlGJ+5c85uXjmWRD\nHtgoktiJHGAHACNKga9E+aRCUMlt3tfArBKA3X9SAkwvrBiLdXtBSz1yvp43\nggA9IUYlFdY9oIlb7d6E26mO9Ag/6IXoIKxjbblLmREUE8KMZmuMkDSWdVzE\nxUkTLASeG5hkr6f9u1tindebNi9GMUdxT0HJGL4tsZ1NTamMaSv6Q9y69f6v\nqQBwn1PFTDm8jpkW0Vc4MErcJIG4G8hzgf0IttuP7OixV0Xnel73NJuE8YTc\n9rlF\r\n=NPed\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICnOcYa/ZzZ+VGu6emuOcOCPIfI+KyXX6oP/gCq7iSF2AiEAm/2l6LL4C9RkUCnrDMVr3YT/u51ZQfJ7ANtpYZKU/Ww="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.dfb774b2_1551120866327_0.6323027292293766"},"_hasShrinkwrap":false},"0.18.0-alpha.9584a720":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.9584a720","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.9584a720","dist":{"shasum":"60773a992583b4b460fe56b93e17fa053be45759","integrity":"sha512-rYeG1SXrGTH8WyVL8sSRUSL2pxjm/XcyblZCRSj8Deygd+uVniX+B7B7Ugnya5c0WR5G3D2cPM1CCsu0qnobNg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.9584a720.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdD9GCRA9TVsSAnZWagAAK1AP/imha25/4kZOX5uZCNUd\n6hURRtauWtmd4JqyS3OFavcSbMmzNM1gbpnc5ZuhTSWULlr1XED2OUzPwD9h\nFBZYOqEVCRrr2uPUW/ag6R3jCv+DvXDQ5bUcOE1QXYn43hmzYEesC3+Kys/P\nEoah27AiZOZN3k3oXQ0WjlAv1JGAteajZqhDis/nifG9SIOCZrzuv47K1Te5\nC5gtuXQjbcA5si/lXd4WhjYnsiOW207VW8wSP2vzAFDkRLeVj/BlNLpekBS2\nadb+1RkwoKNgsniMqktIvIon7BqPd7RDSgsnudXeWfQcmR/cM0fpIMXs2RsP\nOSy1LYydUUsVGBEfFhvf9m7bEyFVnMBDquFpkkWki1L9rjYxKOF/lVJ/0ZSu\nXqVgN6aBmbBxMw06XczGGykhF89N/kgXccfm0u7eaBy0FFG+SokiY0/pRViM\nvpSvKOqXDo1ZdHLHEd4WgHspt3ULUsfhFMemIaFTGZtlCcn5gatBuxjt3ydz\nFyP4t6A3NXf1w2TUgPnJCLuTIAhjB35rEvsYj5tWeA1AGq52xcd9RRrFrD0c\nOG66WQFVVrM10y0Q9EpiZSx0HbQFTpHKTUIiSj1OIfxEELFYGJDm6ztbcJBs\nNtnzr7+thY8nQgDb2cXkRracA/E5vveGJxKsd/IV3ICnG21GvCLadl6YPPrR\n4K1A\r\n=bnbJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDITfS3A6NqNw2KEUF+KVkCtbJbFcvpjuKcgrFQ8I6K/wIgB5r7g/dcuNyd8e7eYf4ZLLZzNQi11OTYlYCzwQxErlk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.9584a720_1551122245794_0.08030941797434887"},"_hasShrinkwrap":false},"0.18.0-alpha.99342919":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.99342919","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.99342919","dist":{"shasum":"906c4651f42fbc69a23be133c639f9136fc01034","integrity":"sha512-Vw2hbacI0WS9z9tmSpbyLLnkL3QWg2aBUhR1g3PjbIRG3FWYtf2kG2mWK99THTiWMspe9Fz6wo1fDV1SzchSHw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.99342919.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdHK7CRA9TVsSAnZWagAADosP/imjYCjk62b0sA3B13Wb\nNdasWirbW1QQZ3WaQ0CfFkYL5ph2jxive8qvczcbEEDRaT11BCbRmdU/iWmc\nL45yvHAaiG9pCNB3ZpF3tMlK9IQRUPXFy/JpbrY1YjUyzqm5ov1PUxBpY+bk\nD8NzNC51W349PeXgJU+9NDU1qQfYbneEsaiZQ9EEqeS1VzG9UJHCVji1cbYV\nABmU3/ALyBB4ZRJb0m/glpGjnibxuIgR4YUl4ap3BoD3d85zwXqoC3iHEkoR\nun3brca+wDCBA0IlG+y17h3iBxYbv4bsVjGxfNdcCent9cOrrKiSVqU2Ykwy\niDoTSlZxgSjmhm9SdneFj0/ECxTUcuQBcsKqIKf2FLVFNuezpX66yF2xgjbi\nOez3DApynnOqXKX8YxQXWBOQLAJuNfPmHpaPRstCUbvMwWaLaMhhTn6QmmQ3\nmDPh1P5Jk/XpkqRhAImiFy0Eu+G2xuvf8edsvHwNQEQY13f60vr3l//pw1cg\nrIpWHRknR6RUKhiK0wFKmF2KkTUcmNUhhJwH/JLFHYBATOm8fbA+c8urROmj\niwT/ITmRSjtKDtX1I9wHoZcHbkGV/5QAAy0MG4GGnjS74SM6sMj0INRizPI+\nBS5OnoS+53V0/4TrypP/jxFNZ06XYFQgfOkxFhN54wKt3toVmYRL1cPXytR4\n2Gun\r\n=q2hq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBiFjGlAXHlY8s6UzLvZ2dreDYInMW5EmWoB1F7hub2gIgKFDmo92HZCqhAj0VMpL8VFM8ANkc8P5L8FVgSjB5vzQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.99342919_1551135418664_0.24332921133223917"},"_hasShrinkwrap":false},"0.18.0-alpha.a714943d":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.a714943d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.a714943d","dist":{"shasum":"52311ea3cdcc1b4cf3f79f4e18eb4a7baf8c6a3e","integrity":"sha512-aE8Dw3JvqIj5ivYkLAUge39YZRuC9jyDMtmwfx0BARQx1ONI+S4lgoNtlix3ADJoD394LzA+zwdzTf/etxL55A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.a714943d.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdIKkCRA9TVsSAnZWagAA5fAP/2ZNtmVxhMxe/qgtt/jo\npLVs7r3MOXgNd0R528705NnMPpBEZUlyRq87nydi2TKnrJBzWeIvOpIsYysw\nN8Y3U/VCMqEM6F8Gh2dihqTgEHdvqPMhm1u0a/u52RIBFw4ggL/1ZKOf2dDY\nMxtLW6+MWFj9y37EQP5jO8SdAd3EukEUZX3L+VGS/bxRiDT5FvOuym5s+n2l\n2JCE2X5EZbZovTHMFMIXqBoAAH/cKS5bJvrVKQKE1OrwA9hOVBIKlQYQ4u8/\nHZfiI0bVlH1AaK8yG6XSGm2msZqUJj85x6+fJJL0fPTNPz7mNVaJy+dnhTxb\nu+X9b2L1wghIKLvYMVkcy96vkYVRTeycU+0HhMJQqQiAIbmK0BnQT477QtI0\nmXvhkaYbmw0MY+Mi7SuRLMRZXmOKNGDfT2Gr0zwBr0lCT94cp8Jlzfq6J1Oy\nKQOsKg988Ju567Up5IckgPY/iudvD0CsMdNQljI1W1lgeJxqZCgDoBL2HXhI\nrH9bBfncjSYjUObFcClTUUJb3tSxnf6h6OpWnOhlAgzFyfLIaSA37oFKYtlt\nhjoHIrdxRNosPGfve+hguULrCDgtBN52pWDemGSVr7c5YP4cZQOWydOOhoHz\nn4SKXxFFJNFYkWnLOfAHLETKaOa3TTP6TAR5VP4ES0k6GZ/UzpC2XzOOlTo/\nTIrO\r\n=+IkH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID1fq55eWn8bDUZpiGywFEfkKDPGKZoOmIK09lDM1RVjAiEAi6QOtQFXJEBmpFLfNdV53uqlxo9YBE0SqwkiLM1ZR6M="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.a714943d_1551139492209_0.14926805153093325"},"_hasShrinkwrap":false},"0.18.0-alpha.ab8245eb":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.ab8245eb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.ab8245eb","dist":{"shasum":"4b14944c985efb7f23469dd4e04fd0e9d237d94c","integrity":"sha512-zDJj5jjDJ18DbnRdqRzpS4lqj3j6IMvade4YAFiQTev9ElEeqbOf0BLlOQGPHnwakGMJA0Xvj6zebJJ+wcL/FQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.ab8245eb.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdIuSCRA9TVsSAnZWagAA4MMP/0SoIeys35b9/xya2wOM\naS/wj8oFbWJ5WAfvXrFeNnKPt7QFasbjszOqY19DrlZj6pP1WMdbZdT8tXDI\n8gZZ65qThqk+o51f9HWAkSqErx621F8c+ORUiXwlXDp7EdHJ94AvLbZfZHEI\nxgzeeuxu46VNAa0G8Xe5vNBshnXN/I/YjJEJNOrq9ZwdQ9wwoBjMh1duoVrw\nNDeNMjDVz6sb0IVat2Hb3wp8Eucm1JGAPE8mtx9PY5at9gHoNP6kjltOCN02\nXpXjXlBz509HX+5DqtZR4GaWNfnwyRzGQ6+2BWw4UBGy1BTCcro14q9RpQwM\nok3vjJkciiwhDwgfBcUmw5H0RnC8yMg2mKI3GL438XEuncpYcfcQBh+Od5iY\n72UY/DTbkDpci7ByuSdqLujz0UwRFbT6w2SbjbNDevnWqYOugMdi3sdC1G9Q\nUaeDllIwpfkcqpsTO6QcDa+86yYeObkrCkNp0Pazffogjc+EAjIHM+E1QVVr\n1LiKmeLVbZA+8zWxfBG3NNpXg4ObpSyYDiQiDlYB0tbbzxEuPtnXeh4v2tCL\n1Fl8MKVJOqfWQJ8wVUYSEK1R07Io8NhgXU3jl4IGXUa6et4tfaOnNg14Nuu8\n/UFFD6YPDNJJarF9KMEv02VMzQP/BzCPebsJtsoOdZy1fV6ZQ2JcLw/KlYGo\n+1jU\r\n=PfrE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF/zxHuyM5EuRrR/QqyG7G6YrGMZuhYpvC+z17YWVdZUAiEA+6a1dCoNL9eN7vT4BmBnUlLkDLKI4WcKfJzh0aFsLxI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.ab8245eb_1551141777633_0.8993571020858269"},"_hasShrinkwrap":false},"0.18.0-alpha.7ca265c3":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.7ca265c3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.7ca265c3","dist":{"shasum":"9694edf0e98d0d25687288126dcf8721b08e5db4","integrity":"sha512-B02UN4YWTqKZtQrSu2IBVfZLXvRqRJOER1d/s5h3Ts8f3MVtcUBJs3hm9uHS4mo1Ao4RW+PZh4kmhN1L2Rw0YA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.7ca265c3.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdKsbCRA9TVsSAnZWagAAUlUP/RSnxR5cUiPB7iTfpNYP\n0/rEI7Fvk3DlnUn+RPiUY+IMFlZlQZqngqNeJM9xoItHLBOcoYzVLTk/moSk\ng3nculveiDN+Ze6UEdzneI7UcC/oocbXnr/nl6N00oAs56gTfFMGRFbE7Exo\n5MfKuGWCHB6DCWkXVQLjL5+J51nmENo1zRUrGoMSJMRZRYkPWAYNThQIRfL4\nqsXsoJpVrozd71nleyajRLU00LYNuItcaq5a67RYH5o1X+aMrHK8ZYtnqWCO\nBlUM0TaH75fSgkbgu6Ik0ZlVjSF5lo8IlTvPD1bMkaydarpQCnusvVoJIWk8\nSd98LG/+vFs9wjhiJQ9+k0t+QDxUcVLfUVQ/dNjtxk8CcbvXKNRN9EIZAI4+\nBATQP9boR3NdXAEdjKMHRZKzl9TpqHOa//BQtlxv3uG7155NamISuCKzPokZ\nssW9DeU55EFFCaMLCbyiypINwWGFKGMQ1uLtBuv2rpLwCqL9RBR/RNruclme\n5WDAhUBPMkwdkpRJXwEO1oI2gilpZUGyOvbcVBBv/+hliygdZcvx2Mp7o6es\n+3+fCUkaS3i+1HN8DU+a64iNxWZVEivB+MXMzN6pIs9BeQMl5ACThfiFsOjw\nswdGe+kWQaXPMeIfZqAPS0DpEV6ivIyzmGCuTld8HOFQdx7XSemn+HOXsjYc\nTI6F\r\n=RLJ9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFB0IESHOihIKjhufcw6fU8vANdrphQssb7VjgWV5xegAiEAnoLvUZYhd3zJeH6fQBuhqtJscPjodzLZu/Y/ScnKdbk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.7ca265c3_1551149850058_0.7138057898282033"},"_hasShrinkwrap":false},"0.18.0-alpha.e260974b":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.e260974b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.e260974b","dist":{"shasum":"c97851336378b8a06d6bc8f18e6303ceedf9f0da","integrity":"sha512-6hgEquVSZHkI+DvsbT2SmEOqHlF1dsxAenZuQTNJPwn1l3uUcHzxkJqfudYCg1+g/GKlZl0sBbuUmx/9OLqniQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.e260974b.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdKtSCRA9TVsSAnZWagAATAwP/RLl4S7npvXSE0OKnJC/\nZ+K79iAdcw7fUVcnf3t2jYUasMJD69qVZezgweG6x2uBafc3TFgLiSRr9LHr\nBOE1X90bpKIRu7ygr973jQiwa/XqElWDYpqfdcVJFaGqm06l67ypN2FwcduF\nTR+O+oZivOpqkQ5Blpw6j8tJCPfOyF3yXxU2dR5WpcgnhUlqOTku9+Qc5e+V\ny6viEe/0R2SWKTVtl9dWPKMMrshMtjm4Nq05tTaZJ3RKBTejob19wh+Ix5OR\n7lBjrQDZGGly7iPDrCiM3bybaWg9pMYcDTdebrlqcSzb/LLeT1e216aFGs7L\nWYqg/fvxvneQj2EJJ8AxAK/U2FdJiTkrjFYi8ZIplJCWPfCPKH7MM9aPjRYR\ndPEh53OJzf1VyDrVayRyFCZZg/GeKPRSNwmbKkjE/7o2GsXD1BsKFnSOkPRG\nikmVFMHUzw55e9OsxDv1ZPJNHugZ+3cuaVJpG5Ah6Qvai+5tliyoxVEaObC1\nphrAqDFExNaD3tbWXFg/V+aJvYN5rlb1GxQrPlCaSzP8pS8eOn7RMKhEE3sk\nGGPucRk12xckDnkgMy1B1TIgFlDS0dyP0WUbQn3FnGO4eVwJEIBTwXw2ao7W\nwEP95ufGq28LIrvxFWNTjedWYsjFPhH88IUJpA7a+Vku4H/9As6ToTI51T/E\nLsSE\r\n=6DYi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCIBpLRz2HiN3uhK7QLzXjmvPe2RWcVxRNnUSl6NoqGLBSAh8TKaSBPpKLPLpvAWYPS1wfZyB0I/gQxy76JcTrwuzj"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.e260974b_1551149906426_0.4620085939936991"},"_hasShrinkwrap":false},"0.18.0-alpha.bca7c945":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.bca7c945","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.bca7c945","dist":{"shasum":"f8ff37635339292f88f4ffb5e5b80f1a82b36f2e","integrity":"sha512-wjEiEQFOt0EsCvDlfRUwwdh3m8ysamLD9ibgrPB98baBehHE0Gs9f3h0WyTSIxkU123odlsMYaQH86J0oJ9tbg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.bca7c945.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdM+sCRA9TVsSAnZWagAAyE8P/1ClfUcHm9hOSnJ1OUvu\nXNwQIAdW2O0z5Wtppp2Fung1AR93quHYeBbt6YgUbip7zhyJEcyIvl7NDc+L\nYc3yu5d/FRgxkNEnkfHGkSi09CoyrALAqM3C+j7Hn27Glr3k28yKUvBm7d/1\n0m6Y3bvbGFBl29vEdD6AVziXjER62N6rPSJMbKi/U4Y7uoVd2JRgEbYQbeeM\na3NWVfBXBw14nAZmeXEuwjOKePV3HgDPZPQ9xvULRucKYD1Asmmy18G71Yuo\nI2MmY57qW2s0yaXphmxc93zhRl7lQn2JhyVgt9WeZV1hRrUzQlQe7VydBLcx\nAZB+uFpXaEBX7UyGaSbGKQA1S9yqD4t0m1TCj2dJkr8xTHrs/ZS+4Xq9HTKP\nIj205oi1Ooc0rGTnk4f/FQlBwoodUZUXmpcJZMiFSZ/wtmT1cvxC2kX4Uj7P\ny4rwoiO9+DKJ/sGCOY4RnvU5JjfgcODy0/q+U7iI8hTJ3MDyHmHUxFh07cs4\nn+kzKvWfuQFlQrp4Bo9fYkUXwPdqiMWkPAxaKKEoB8xPjoJ8hidtVIKxs5/A\nj/ntaA2h3/5JqCq4EBitF+Zeyuz9pVWAQ+WLBgk68D0u1b2RN+brGBeknEfB\nMgB0JTiEofEj+vSttyPHyHhWFtqHu2xpgrvTxGEXykFUTKKCtDPuBkU7uF4/\nk4+4\r\n=lXwb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGy2ExdNPBl7JeDeGcxJnQYSGh/eWJXpa21n21Xhtiu0AiAk+M790q2+W5eU0c7+x0ECpxnftdY122BiN/7yAhfHiA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.bca7c945_1551159211805_0.5757544309346385"},"_hasShrinkwrap":false},"0.18.0-alpha.ad4f7dae":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.ad4f7dae","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.ad4f7dae","dist":{"shasum":"abb00e8336abfc622fa02c0fa19679b29ef88c20","integrity":"sha512-AI/yYQejQvaFvNJ+NK4O03Slsp66BC6au7iOP6siZA39vW1rq8svxPDxVb6fzpPOFjXCHw+nz/LiY0CccOxkMw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.ad4f7dae.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdO+1CRA9TVsSAnZWagAAqdAP/3LZA7/qVWdhN2EHME4O\nZ7+jHHmcR6hUhLFJMZy86XeDKJXS4Hn+I498EJVY52OBWao56H+aY9F7YIb7\nv/zexVoLH38akigI00GhXwDgY4ovmo9AlR5bad2ZErUBGUYyA8biwc+GFFcc\nU3KpZMECIUFDpvX+A/yuhHOleDbLq6B1rlyUsHOu32iYi87tOoDZtNGPQGyK\nCMOaPb9LMEk+6Ss7WQGTWD+5BwIOofANyi1ZzUBMMn5jPQgPTBS1a9rpWBVe\nFYJbUTbO7eTCC/6xIcSY1HyyImj/eEqnh0JsjzlMeHfjnIoHSuECbdjY/Ch+\nlCMuB1qAQzK40g2ECpMGXcOLmlvbK1ty1i2gJ1Bp3Ob9KX9EO6VzjioENSOh\nHMTgkHtt7pUK5uJ4GKj5h19LdtFVq6Ej9EL/gbseRfd6UL5Kc93qUWt7ufJx\nS93y44E0K17FhBoJKpxq4qCwAJkQ1FusJvnxhXeVbdGdTJNqV04DplafHYKV\nYgO2riGEdDfLpHhMmzAMzR0MkQnlBbw9CWwMaedBlZzUvzf3C6JW1KhS6xYc\nF+lesChk3K5RA+girH+Oh15T8b/6MgE5+XlicLmnolr1eVEXSkb0RSlmi4fw\nhNnTXVP7vYPXcOxjoSFoc64bxi7Sz8ezUbOSqSeieu2BJKVvjsRq2g9fLuyr\nBxWc\r\n=Nh+G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID/HDCDvhkViOEJvnuaFLkOkhGlFSX2D94wIAnphGwc3AiBaXz0VTqvY/xD62nTE0k70rSkhwopi8d5tq39ojEHLrw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.ad4f7dae_1551167412358_0.5888510928630766"},"_hasShrinkwrap":false},"0.18.0-alpha.39bc9cd7":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.39bc9cd7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.39bc9cd7","dist":{"shasum":"998088beac7c42b3e455e38ca9190a0b5ddbfdee","integrity":"sha512-Q3rhUrLuOPuqbbXDqHpzqZiLU7LxNGrRoWaDsB9NcI3qoiKMvBnAiIuLb0vaSHPRxynqmBKs3lfVA7tkgaKrOw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.39bc9cd7.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdO/BCRA9TVsSAnZWagAAzPIQAJI7pcq7xQN7/WtkBDBN\nD+hPBshKAKFKvYb+sabuD4cLAzEhoeBNT6Y2d7zB/A2jJRRzV6lj+raq5ySS\niJkSrLG2cNPUak528XH5qH2bewOvnvACZn3uCNOrJRAuVBYfH948rBQEouMl\nnDMBejSF3pkTPAKs4oVmBwTJw/3rwpKLdpXthSX9In5aoCbsXJVx4+1qoWn7\nngnw25qcXvwPM22xZrCi84grfkReaDQe0OnwmVwnTF+AZ/2BnqG8yj8ecq/D\nGykFsljx9MvFb9En3yoKPJ1ljxhHf8MsTI6lEM0ww87J7JoX9yH92hRyqCuk\nAwyt9nmkpjf21/rJ5u/OWzE6on1OB5ddW75niB/U36tlI2ZtYYkfICT7kzU6\nXKS5zWcC9XeiVvT0ld9h9qkuxRAC840qBdmMaTOQ594YkJIN9SY3u5a+HAtY\n9smUBisSu3eRH7SBIiJkFbAzio7thdXyvLIwNX7FI/2PuuSosVYmSy8L/zyy\nrQBSW+x6oD7qUhW5GCANYhuLfth3nKwFg6e00ztqxLrLWBl63ljbsmfBmJUM\n2gh+WAHPDd9bqc31bHtslUq6kvKPQ5gs0DAVg1f45jjTZj/m1Odul6JXqR34\nXGfpRl+UAPR23PL502NL7Jmm+DdZxYhyEsoKPmzkjh1SWKW0nGzhznhDwYrS\nlGkQ\r\n=zGsT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDc/gM7JuQ2gH7GCSdi1UzIEo30TU9FLhvhXqBIZGHPFwIhAM7z2rpd4pOCeRA75uUZ4O0bapzocwRKZjeI+vzeKQDt"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.39bc9cd7_1551167424867_0.3272450384958254"},"_hasShrinkwrap":false},"0.18.0-alpha.586a9090":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.586a9090","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.586a9090","dist":{"shasum":"2abf5aaa70c8347df5f78fafe727f84b67b6c19e","integrity":"sha512-uxHVpYCesXktSYoHBMWCcRTgygjq6KETmPgYQGhTVZ8wgWyrJNEx6edezWIO6Ou7DFkn5SN2YosiTTKxl4NshA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.586a9090.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdO/hCRA9TVsSAnZWagAA4w8P/2Cf/sHScEX+LBO2bOID\nudwydnBPwG0ehsvVhVpwFn1dDOkaM2FuPNENNx00TLDA3xAhoOL+6rrAmYWu\nGYW3R+aPPGlW4aRKlr9x9jghguOHNCEy9JN6Ml2dBBRDgnPFEhDxTZB8UeD1\nGZy2BmUasj9HTwiqRGlBFJcqmgH3tatY4sNS9W+aHExIUuJUOiezCqr6ifib\n9KevmRCRUJ00lDt5dH2voHtFOc8myGVR+vYCGl4/rtH+FRjMDlMMilFskg/m\nxOzNv5Td+I+bti8xHCihsovU9C7vQFEtav0nl0NsaSf77IhuLzFyc7vz+TBk\nyH090Xxzji5ferFrOozKi00O2robKuTkt6hC+fjCFxnX5Bw3rwS5YLP0YDZK\nr0b6YKAYMIOnEoRDDFVLNuDgYVfz1K8dnjCMsCP73p3ye5S3fSJzNHOToDok\nlUHFNT0iBKluVgWbrjxyH1UBowktWOBlWRd00qFdz/Hjg16gbQZwnmprCyMa\n+r2Tve4te52rEEQEAyozk3eciQW5aG2ODIpetrBNbJIieJWUoxH8ecPMZyrF\nbyyrX7Dct8u8GWahcFCFKRAeYsnK0XQogf1xM7SEXacQcJEbdLAh6ApTEzS6\nPUkf4Xc5pGPHjTNsCm30xrUGyQ7BJjT7CmLV1DRhYZShBCmDGOVacpBc95bN\nY56n\r\n=1Cas\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtFO5Iy4uAAOPLJrZ55iNy16O8PT93Z4TBIZQ6gwAZ6QIhAJUUui66j7Ln+zdhDhUom9Mh+QAAyRLTQE4aZAy62+TM"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.586a9090_1551167457036_0.8031940321693543"},"_hasShrinkwrap":false},"0.18.0-alpha.41a606c0":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.41a606c0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.41a606c0","dist":{"shasum":"6a5a41d90946fea410ffdb046374c84e825eae38","integrity":"sha512-2U++mfulvrGlc7vOgOEdsqax4/Bn5tSmvO6Yg719fF6lF8X36OUYZz2eJCWnmzi+IQmSq541NDc+DLmHRJLPIw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.41a606c0.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdO/yCRA9TVsSAnZWagAA0K8P/2y9Aiq4O3R2xPMWaBou\n7R7MdjUcI0pDpxiOo251cedFvFr9Bn3TOv5a6NjGEFEwXfC8AB8KE6kEgRO7\nCZy6ikyO5ByHVlJM9oq3UCNFXdXR5FKzSuICeUi4euQzHjm+F9GXy6pKkSm5\nBcTp/gjBR5itm1Y0cXzW13+4+qfiFIAIrAVlGCRgqiiOUe/gVQ5dTVIzNfNt\nKOPDgLsHPg6RT00Qa83rMUpkPj8dOeRhKtWtEyOcgunSBhMiL08eSLFMGpNA\n9mkmebpeEKuoU/x9SfmxRIYRF/MofZgRh9P2e9SL/bzQRfI834BtkePyDY/t\npiaJMd588BxQF6X65je8yRbaCkFd/3fQM3ba8E8Fsut5GMeQNqXn7z9xhtfQ\nXrwqK6DF6ZgABE/xLsN3kcON1IZdK2u4tqXNgVhQQk0le44r+1dL/bZkjAgK\nJ4orE3ZubsPJfx1rpIqLTy6VAwF6GitlwDXbYWFviLdJ/CGMWiuaJPRAyXCV\nSS80ORBxi2tauph5THGFOsxez89Tn7e/T4mgeJ61PjnCUdoAfS9bHsEmrSFg\n13hSz11ie44W3LxNHD4ZpHslUdYKsmdHPZRQD4nPfdaIumVPiTA5+tTFAmP1\nClq3oQQrYxmmGz823DXTtI9ZvpU5yxq4yNG7q/GEqedm3HvyyKQ4vde4cqa5\nxJi4\r\n=zQyi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICK1tECN1C2/g77tgd62OG3pgPA5lNO5myeFbPB0tzu5AiBBY+TquZfZejryf0RKGplX/wXWZFCnQBVzQlRCgEJuhg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.41a606c0_1551167473704_0.07895653174692874"},"_hasShrinkwrap":false},"0.18.0-alpha.522e033d":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.522e033d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.522e033d","dist":{"shasum":"8c778fe4069a2ab314ab979903cc1cba85c9d5ad","integrity":"sha512-1Cug8J0Q+0J1Z0Jwg62nXD5z8twyljlsEW07sgfVtMoPCJbg5Ze6iEhpWY3iVT+6ndKQU3m/CrWxcnebV/t3LA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.522e033d.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdPEwCRA9TVsSAnZWagAA5D4P/24a3QhBR4T9zw/Onfc2\nXVlTPbZmnPFOeOqAHrQ7WqPu1Prc7lEbjlrtr56Pa03gTrrBZwE0hHxtsqaD\nHK7zcXaOXgPcI4UNO7wtghe1D0daxj1GoSPC5j+FinBmB7EZ4CUt03c9rGti\nHMtqxbhNXNVZj5tFTUr4wkJBxchl7w41ukHuWuc+CS7I95nD2NVCDyOPcqQL\nc8xcPfsf22K731ay+9Td2kQ2bsv6wltoLRxAOj9g5qm0SHaL2q1LTJOO/nFX\njMaB9l7HpnZ9nNoXh0IC3dkns/4/YFKXW/XCNTUJJaEeUdIUr6TEe3WG+Aih\nbDJUUbxQkyxYUvFUZq/aMxqSQewUQv/PQCuwTvYKziLmsV5hEOIMrjUbU6yd\nP8kqzqMrfGP3fDJaH8YryPa3w3ea1y0D3ZSjz0Ghe7OIYC83lxovcLcPG56e\nFCkr/+JNzVaIOa4H0/QVb5FrN6j4RtP9wX3uPH0VAFfsLYMT6H/AUHHVz717\nVH29kWe+XHs1Gu3LLkjlaUV7P9ywWA+gNSiL/FEm2gxF/c6ClwpGC6SwRBXB\n92nWXL7ptNeN/TctOk73R8hxOfhuq6zMabJ3Ec8X/zPP0EyjowYvLj5jH1QJ\nOr3WJnTqpFtJOmAZ3Ej8Z9PzM0aK0WbGjY78Rw161ZrPEZruT7tGNOtVWVuu\nnN9r\r\n=/APJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH7UUYNzYhjbIX7ewf8wvffVNGVuaK3nkoWzXY6xxc3lAiEAze4xM9fme6uh+YRy8llFa0Z48DpH218ICVwwYvno+OI="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.522e033d_1551167791128_0.5871291595309587"},"_hasShrinkwrap":false},"0.18.0-alpha.ab4e62bc":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.ab4e62bc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.ab4e62bc","dist":{"shasum":"7faea9b1a5e729a784400867ee04b687622d1ce0","integrity":"sha512-DbdtzSZ4RPon89BbERffL/vBm02PXo2LnOlOklJaPVBwm9hp2w8T4q4ESEkZ/5gH/uthwmsPsjkZmOf8u7IMBg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.ab4e62bc.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdRaJCRA9TVsSAnZWagAAtCsP/28Bee5lP/amA2/Weh6O\nI2s52WsSEQCYebwXuXbZXo4E+jLWio7tqdPhf0qCIM+Ac/Uhn5i1BfdgyrSh\n4Jv3tyuj4fqy+KTrejTAp6AmsbYO/YjXQG+piiJhHHDMWdqC+heaOf2hVctS\nd3bD94DZ389XW/UNxityK3fzs1PYTa7e0UUW7U8XBQ/PXpAsgOGBaUNRRy1A\nHIfGYtZ+w3y8+l2KAUDbLF1/eBjoeK43Sfts7xysM8HHLNp/tQk0BlEFwvXb\nWdvWSKDiWy9fKZj0Ptwdu4P72+4LpFldAmyxia2CA/32jP7iQcMROZQrAIcl\nCF0q4BLOtd+9XgY4tLPDFhQQ7FT/gWSYkAyIglgk3CE9wmBlP915E+LcEqOB\nTdD7N7EOVfJUEGz16KwK1SdxaGhdwAK0ia9qn1iGA1Dafbjtko82vV6Lg6FL\nhpuoISx7Ahd2saUjkeJltz2aJyE9Z4f4K68/eNazMZXRbmQch4n9YFid0pZl\nqeHZsxqtj45vRer5aTE0ER419BCaYqhN0ls9GAWksRj0NqSag7ic6911EZ3u\ndRr95Jam3zTgdzLyhPxganLehUQpRu6VoIazlh0yxkfG/iSnasQRpevMVT+M\nUNsYeq4doKs+gBrjS2s7QheolqUiR4RstAvitV5x5XRiRJiw9+L7yBA36IN2\nzfVa\r\n=eIzm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3iWucjbeR5B+pNrgHn9pE1nTIAosdd0por1MF/mz5jgIhAK/e426WHFqQDsjgDing4cEZ41r8fzvEv3JyG3gc1b2q"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.ab4e62bc_1551177353064_0.5024283227769257"},"_hasShrinkwrap":false},"0.18.0-alpha.abf3a1be":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.abf3a1be","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.abf3a1be","dist":{"shasum":"a3aae55cfbb2ee0c65847a5a03af3faae8ad662f","integrity":"sha512-5KVsuhxnisR6WnWDlUVub+5XNzGJWAVhew0agyap7hPHyJJeGAIuaalGEhOMedaHBF5od5EjItBOncuuVy8eSA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.abf3a1be.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdVADCRA9TVsSAnZWagAAV7YQAJSCNqtQ8L2Et2+Rz3/N\n50jc3Oc6FlsNgGgxIoBmHe8pa39j79NVGJgsLG51ma6GVOpPHZ7DfItcqZNW\nbveteQ3uBerb0+Oml9EG96kVC+ezGrybsEYPqXor+hB/7PjnoEicfyNC3JF3\nCE9cBs7pKjfAQU5fko1wvqfSZ+WToqgdbkOcvX+07tpndjnyaEVtVU60owlx\nJNCT6LXx1KTMwBZjle7Sg025kQxVzuJoQ1n8Rj/YKbLZ6lRgrkZ4wbz5bsuS\nxn0ZdEvrUAfRoyLogh/9+MEqqJ6NoRvx2RdU1eDSNO+Serx70hCNqiQuMySk\nbTtQqeik/MqH5FuyrEt8Aaq4RN2Xlho2BifCX9GaC9SZYub/4bkwnnq4Y6JS\n8e8gjsiGPmlHvFCNXrv7ooX+iCPaf1eLevM2LEk5eBJ4C1LWJERQeGtC6oz9\nSpeggpSQQhZ+06vaGEIoKnvfF/VfxdVaBrzD73+mNtS24MwxyTMCvXrAwnJ/\nTpJse6xA5ziGSIsj6B1Etuvjxm9CQi3sfA6ZbXEcLSuOofrPIjohjOhOxi1/\nF1JvLJTGXcFFOJheVfF8AaAWojiKWetTBclAZLl/lMHYcLKAaXY2HoRMeMR/\n5VDCXOQ/9I8t1g0Id94v/daJT5Ar4FPNvgpr+fF1SnAnjpEroG4Bdt9ul5qk\n0VeL\r\n=dt0j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDofH1UW699Fx8aHRGImosJUnH8Ubud0csNy5+qEcgVMwIgRpu1Qn9TfZsgEJxCAw4C25Fa+PUrhTa+6j+D1XKLSO0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.abf3a1be_1551192066638_0.6408010691884989"},"_hasShrinkwrap":false},"0.18.0-alpha.859de36d":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.859de36d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.859de36d","dist":{"shasum":"c4c19ad811160e4a7fce8a5e4b11e003839590e3","integrity":"sha512-G28uTPXjPdYob4V+V7LHpsULDCQI8xw928aUXVV8QJ8Dzxt5XoWpQF/iKkEIA7B3OIjCoRwls7TpQSuLJApAMA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.859de36d.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdVFeCRA9TVsSAnZWagAAShMQAJXmf/3ihzyRDnrGuhzZ\nY915qI2kDveL8ImQvZy/b9yASsh5CmVmKEULRP9TRXmtDXw8Zbja2ixZknzR\nKXYHV6NkiE2uRc2fwZVLW8VoMtik+tJUv1xGrl+OxGB24uW8FzqbcFqlrE9Z\nU6xYnTKce+9h4aEWMyRfOxFCU2mXMBYyhWOqPraTXAhSH+b9c2pDdeWmeyRx\nFYqTKIJda7bIotYzno3oiz+qTOef56BFSdoCdvyQXPBdApi+DrSiHEEEePR3\nR/bPbvh7x06PrdQ0Fhuk2bGxwSbk1Vrb8EfYmSRb4Ln5Mirgoj2gBPBM7/TY\niF21h3+GeZpqzzx1LtfpeRfKRF7go3hg2mGWmyu/VBFvAT7ZYgw1EEUik7+t\nwJ2+O7f59HhtkAXi+seEqVoTq2rM7QP+L3OcVOw2blBGPTPcGnyyToM1JQjb\n0EJF1HImXuiHlPmwj4Lp9dOCDhNGEEZ6dy5Mwg7bIvsQP7oBFrs03PZKDeLa\nyxmt6YNI4YTSTzj/fRs1oLyy/GObADAb3Lubs/zc7bGp5x4g2IygC+2Cd0Y0\nnBaQ3tzfKOaHyTJzbt+3B0CMuA7bg6zf5eaaQtm7ScDAEJpamWV7mFDWwNY9\nfJgaTEpGqa7/Ga7+cfWTfcm17cJps+unW1kbc6XmTV7vL8scXeEpLkJijBlq\nY582\r\n=3DAW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFFD3HFzQgHkFh+G2QqHLQk46Yr2ObYoYANBb8Rq8kJGAiEAkz6k8O4TOnGIr05PISFHbRW8Ois0BOUDucWSdXhtLZg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.859de36d_1551192413495_0.3864728815991616"},"_hasShrinkwrap":false},"0.18.0-alpha.b6def02f":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.b6def02f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.b6def02f","dist":{"shasum":"c09337ce953b7b65b97b03d4f5d3dd1ea7660592","integrity":"sha512-t4B8YrdEeE+wuX7D6PgSrRt/cCd15ZoLrk7Y8on2ioYMzqNZK7I6oqdmr8GpTxzhYJ7lLm6GSxMK5Zkc7cvdeg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.b6def02f.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdVmFCRA9TVsSAnZWagAACrYP/3JZFoWUZFa89UrDXRrH\nvPk72WVrLiP8s7oFIK3ex4M5SEHQjerwdVLaDhTdozh7AgWCCVxZZrdgxOQP\nJbjsrq/S8JuqcQII1txDDleucgHahsthXCgodK/b96OyYJ5itnmwWJW3DIMT\n/QjHvMH8ic6BXZzjmH/j9NAelH8m+r9i/pww8L8rfFs/hnpzd6/Dc2GuYsPE\nnxqjwqf3/rdj5xO+01FwBYsKpGuBUK8ZZ6JYQXeVqsHg+Jo0FrpAAk5d2A8O\nfxvh8E3RKVdC0MDnosu0pok1nI/Y9nyXS/Hf5NF/3dJUU2V8ewI07aVgsdHZ\nLdDIK7U4Dc/H6N0v2Nz5OjfHrSiNpEYV0Clk+YRqGLOPDvzBSJJC6Ml68YsJ\n/igHX5kxuL0kLbOneC7gI6dZ+dXjgrYHT+ym6NlkqwxJ5zIt7thTKcHiv//N\n6ez7cdWP3aFduAmT+rso6hf6WeM+vXI0NhhLkrkRkwmOAfwlEYMXOPJVFR55\ngbXf2Ppegx+6r8bHkPm/bLBhaeOeqt7kvd+Xlso+ZZGeSDx3o7bpRrdthkaG\nnWcm+bXdu65Yu9bNyBThpQDEiVh83zy2BM70Lbjo2EAelaI8CMxpROhgF1xs\nOZJBLb69bCBGG/IKY0cSEXlYdgVzYtcirnj/+sG6kUKmzD7L7gPa6xlqif+5\n4kqt\r\n=QCK5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC4DcDR+zJsvawbg56Anxz8sjqi2bfpYNUuVf2xCpIoHAiA/wEAIJteG/76GKQRbaMGlkOT9eopdhCR6AWBQjJPLYw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.b6def02f_1551194500330_0.6387444549412113"},"_hasShrinkwrap":false},"0.18.0-alpha.9ad67a0e":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.9ad67a0e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.9ad67a0e","dist":{"shasum":"835f65785a854833c39895349a8c0a2ba7c4f6f7","integrity":"sha512-R3EMSsUhrpmcfUUGsjJy91TXEsYKKnWCFQDIZ7Daf02Tsa2BRpFzms7hRTIw1aAGsWl+WOV5lk39N2IprzWscQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.9ad67a0e.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdVuhCRA9TVsSAnZWagAA9f0QAIH4JSZ/GSZZ7Apkx4bp\na/9+xreUG1fd5RWNHQkrKDiWo7s0cRmqBJaITa56LsboPM+KHqhGw85LqWvM\n0NQ5fW+xTKFAcdvwqynEr11pgHDIUvIq+DPeofUYt+dsDmxJglxgCPj94G2S\n0q6WO+QQa0+7xPIGXVT3vB5u2d4yr+L0xFjgzFWEtvHQDcNeJOEsIkVasZrY\n0L1fXh5nkReVLhXwnOp7/SFKdTyBlNMNPcgMGv/g8GX785Guk/oxdS+RlW6p\n8vju0bufiouv1tDSqpNONodhRPRsv/96NESROgdKx3b2teDvTOmUcb6j1B1n\nsQCSbMnaOW6uxJUsvRq2TdFBoi1gPo9O7sf0kCPA5DRyj1QnU0oyYTsIX/tc\no8sOp25sJLH4AsiQlfRdB+RZTwxMRQXYcg7Tv5dYzKAn5otXeeuYIhqC2w3k\nidV6EZRjRpoO8sPmgRZ7ya6TuY8VEykcckTo9oN6J4t+WeWffmzViICUTULD\nLPCZTx/3HYXIzfZPBdHQVzO80JzeaTYtksZ12FY4sOf/72Vxbmx91R/5IAr0\nDpljCUmEkhT2KKJhX10aaFdNAdf4w/u/FILqXFr5mWxkmdpGO/pCWVZVPpJu\nmVDRJ4aF3lDyKK8reyHD8yncCZmdGlV6cX+iI0A6dGuwCngtbJCGy3IcZV+h\nV7SD\r\n=CuDZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEoP2bqpVsN4/qK/b98s/WyG9aNAXdVFnsd3hwhP79h+AiEAlaXnNgnwBCqTtXkY/TZc0BsUkSXxOUy3A/r3XJbPy24="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.9ad67a0e_1551195040667_0.6577690817004902"},"_hasShrinkwrap":false},"0.18.0-alpha.aee691bb":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.aee691bb","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.aee691bb","dist":{"shasum":"8937147daf7f2a3d6a6cc7b5cc4b9615b8ecdfc9","integrity":"sha512-yAvtyGUf95Co5bdOPxzbFZChKzdkN2gjkkz8wfgiEJrQOutfDP4e2EkHp1FWSr/uSvoKvP4H0JBv0mZnZ4QISQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.aee691bb.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdWhDCRA9TVsSAnZWagAA8qQP/2t48zO8MwUWevVRlVeN\ncX9gwLshhxwi7kcVCcTHIZ5sz8KHkq2vwE/P/orW5aVCQNcNPKpqhl9NmVj1\nIxa5eftCJHXoGoAQMLNXEA8NL/BNahMMF6pnTgLZ8mmLpvutpMhWkbST8aGf\nVQ3hqAIInXZbeIf6IN/X839Y6HQ5EFoOS/TVbObVc8eDP1nJSO8RVJcQy4r/\nuFxwIZe4RdTLgRQts2ALyF9DxeWHAZB/79lR+8jgFzvmBmRBS20ahXelD6G5\ntAH9LU3+5tB4WvvSxlOReM+muofcJs+25wcr2jidgAAmHjtYUS0Pbp1W80c/\nJw+hvH6/3Uz1jaZZ2ltHJC18f2Ln4eh9/VPsaMKIQ2cFtsDLx2jZMRYJthik\nqQ+2v6xKIEopKrqsAeyYAqidYEwxd3N2dwNPodNANx01AwBvDueK9oK63Wk5\nl5d52kN9XOBR8mGmC63cDohBGE+KWElUDCWtyCCEGqz9puUTy9Fp4wjNVI3I\nsuVyg0m9Syv8O5KFUIr+u7V2RqCxpwl/ikuCeODSHl7gn9pEDoplZl9BrQXG\nLrfHotxyMNOW8Xw1rfotPMXKLr7YvaxQw4v1BChqOxSL3z1UlU/42Y8f6lQH\nwZ4z6XuLOAUbe9ydio+ADcAq2Al6ANyHEffjYxh8UnZnFf1xU7oV499m4jCt\neUSw\r\n=6YT4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCb0Du23ayDWiW4v0x3B3whuHKSfMOZ19mW9Bsrghp6UgIhAPLLhubBA+cMMborMXpqFmJZJCoeKWWkxEV/odU0sNZA"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.aee691bb_1551198275064_0.17150483645874148"},"_hasShrinkwrap":false},"0.18.0-alpha.ab3e0689":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.ab3e0689","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.ab3e0689","dist":{"shasum":"de378b60619448bce484cc281af0478aa6a31227","integrity":"sha512-8iOBfUu0cuIHxRs1zPRoI+aEEGoveFc/lhNUbDACB09IlTwCrnLth286vBb/cimkIUR/rIhG75lk/LAI2au59g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.ab3e0689.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdZGVCRA9TVsSAnZWagAA2UQP+gPl4W/M+eRKQIHsi4sx\nXiDqBTK97HGEtn8BY9yx7VFmzACwbI132FPj4SHa0mXnliJPeaDv0aQupurP\nFNbm5UKIU2c4LGDg+y9J3a9/xsJKPZ+4FrMqMknIHToA2JWcpS91f+mLb+Eb\n4997OjYdoHrZnilurfRhqHt8H0OwN2HTU8lP0j9md3CCb2geXRL1oMymsXbD\nHT8F5LVwZDq0tbSVvA2YS5tvgOlDMnA5rOtdxtNQzKbyxENFtlSCPp08w7QI\n+x9lx4OBr/7h2QiAQlJzMLn8DAnUGFmFu5lAIUca2ixfTqxDc57TvaewDiHC\nLDh31Jf6qn+UxTakNSV48IcMbFxca6dDcDAsgWsPR21OAhrPTeo0cPip9tZ6\nLxrsNB6A+2UQekwf2dqPRO9714XaZjFgMvQuygT1Q58+q8gUvc6ol9Y9iSC9\nBmGEyVJK8PFwOaruLRCjKT7uWbSjRC2XIlFPIRvlRad35a5E7fi/F+pKt7u8\n6cc126clatYx1804Dpl1T+dzxaXKC6TlT0Eg4vdMeZNdwhZaZQXYnELgOt1A\nDVFC7lmv5xMVLmR4knYoaKZtAeBevHl8aj6udnxvWEC/bb2Y5eHqz+YO+7g2\nHh80wRDkPHN2/PYsAu57rFYZgbHNIVDHEF8toeWF4HhmUBpXR1wNn44vaUea\nJg/I\r\n=2pYZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyQvsXJEKLhLWpw6RYoYuagLeF2l1nBfHJbKDUYqJsywIhAJd94NtOsT72wB64ckcPkOu6ecfDNLMyGc0iJtbfHMT+"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.ab3e0689_1551208852991_0.5456398932372297"},"_hasShrinkwrap":false},"0.18.0-alpha.2ffdf275":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.2ffdf275","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.2ffdf275","dist":{"shasum":"4fec4af1f4c8b93cfa0ab8e39eb5e745c5abedfb","integrity":"sha512-OK3wO5mY/KMB2ddj6Ffk3q6KxFzB4SrLgMEuTlRlYGNPIV4XtsYuv9LrN5fP9lPyH6SdSi6u574uYHOFtjuDBQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.2ffdf275.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdZQCCRA9TVsSAnZWagAAOKEQAJPfNjMP8wccdDWW1Zz7\n1XkqrgxyXzLpusoCoZ2aCAPL2+MQ92E1560KZ+J1gnGEcIgBCJWGnjkXfdPN\nPBZlvkyxQw+JyabTHhO1yKzLn1/WT58JNWu4xn/JNtktMUoShSFAt/AS0ot6\nB5tQhHk0Kx69Ljvy5Jkp8kALT5cjWccuS9vR+NZLjKx+o59lf8voK88vK9Ie\nbs+EJTNtQ17YmeT/MAIMXu7jBX0WNnTbYF2MjlrOEw3Jp7Fz9ayF3EPEQTn9\nVRKm4FIiB92R+2MeV7sEowApfjqtrLCUHOHkUqH917pTHFMVx1kdtLWOix4Y\nShBUlFv+Rr4ZjHo74jEWmLecQCa9l0zVrxJDNWRPMqPhrT+vm35dLvXkvWdV\nSNKa6NIAsrfyugigAKAMrPJKW4ZrH+gZSn3dYQDMwScol2zmQoduKPipDTqI\nyCzUr6O1fbyfh10G4wWehNIk8M/ZPurDyDCcUQUbsNcoqpXFcTL16Psishxk\nWw5BWtcaDdc+YHBmKarF4NxZ7+aa2dWdavMDyqub0aFLqQGCYmg3Dz1mGtrq\nz0OivyErBJL0A92FQhqyuBgv4TuNeVxCuzOyzdXnJkQA3Q1+hSKCPSVdVUj4\nfKDAvUyinBKseUoiDrma0OgeSyB00bZY3kHaED15HLCqeIXyyzvrzjDt3aN1\nQxpb\r\n=2WeR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDR1k4kmeg7w28eo+9p1riMfKaZZ3TTv1vetapi3wC13QIgSKinN078hNPFL8U+PiH7BuJYtwe8soNLGdcuKtgTYtw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.2ffdf275_1551209473506_0.8128066148016857"},"_hasShrinkwrap":false},"0.18.0-alpha.dcbf4823":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.dcbf4823","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.dcbf4823","dist":{"shasum":"c38c5d3b6a313b8fd977fa4f5b4772ebc38f308e","integrity":"sha512-0fU1coCX0t7Y5yxK9cstC5HOsDHNrVfCesAiNv5B08LDgX9lWUlQuMkzXkcJjCWJ4YPIthPT4FziG4jOs/H67g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.dcbf4823.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdfSsCRA9TVsSAnZWagAAvesP/joA1HCRPhteGFsZEOqt\nCcnCq0gHBq5bKg6xmeZwxjU+E4Ua6fCMh8glqHOzKivQhV/nx0IguHSYU8Zh\nyC1nEq+HB1leVOHeJCgEY0/D7mnUwIY72Jj78FGlbV10/RamZSk0Ac8qu4ef\nZ8tk/u/0f0UK/VHpR1a6kTf3U+KpTuQwgBxo/2nZpxpk0i4ZeB/tKk0RcARP\neITsUC9Gvs8KMugCFwKJ4tPQTwdeqm+kYR4dQ+ZN7k0RlEK51rz4lrepAtgM\nLVvFZo6506OrHjXJiO1YKix5WkU2NuuB72AZK49z/B5nFZcF5DQfVsigmwGf\nZFZRYWRDge2eTN9qB73G8iqhE/H+RMlRIQR122RyryCOjvmo8fyKzcDKZKLv\nIHeHm6lP69PqqyQsD5VoiwydKN+82LSQEAJStRb/+46egQywT8w6lpfG60ts\ni/Mb4OTTgu772EKqhr31boW/nPYGi+8e3K8THN9XmhJ1E9TSy4H3VCRK56Re\nvG9Udk7wNLiuqBsWcKEhKHaMO6EJ1qb2q0cyeEfiZe0/rxNAWB/uvAZ+e/Kl\ngb3bcP1qZZDH6G6kHm++OEiE9XKaTAZLC6wcD1q9re7eJkfpjz4GgXjbId0q\n+nsZyDZJbJ7tKmK1TSZaDil6aeoXFpXC7Uw8b4ZDr7Xp44/HIyqL0FNCGe8B\nHGIX\r\n=g2PK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCo5i1T9oS23kn9S7WXSMyosLD6ZD9/5zP6wkDTUTF7BAIhAJqqNkYFFdrge3Hk1gTpG7AoYpl0FSTdzQ5E/wQo3daG"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.dcbf4823_1551234219807_0.05266149494740313"},"_hasShrinkwrap":false},"0.18.0-alpha.b0c24eaa":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.b0c24eaa","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.b0c24eaa","dist":{"shasum":"d8ea8c729ddf30031bf39677b64cf0f043588bb7","integrity":"sha512-2UlHgLbgZLsaKXOsRvh8PoCmecXC9/ZqTc7vGY+kFppteSzTvHgeWE21KD7JlzKkxPiidZx6vMqbATnl/LSVvg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.b0c24eaa.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdjLOCRA9TVsSAnZWagAAd5EP/14EowEXVmobPQPb77UR\ntTy4cZj8v3YX25VLVipbqL+x2pi4jrLG5hk0hRpLrogrXTLvwdtQRtK1KUL6\nOhhowCchcCMpy28lwv+nkBlheSmbTFzSJFfxw0nnmsOZ6PDtSwHXx6QEhmQU\nFFnrT8XC1pIN1VysB7x/Zh+R0yrx0V/pFYhspi9fn7Q0kN/eTodvKLpV0Z5N\nWnY6KDqND0mQLLyWh+g3V5ixOH73Se7gXcwSNX8Q6J+M1fsYMOcH84bVKKYb\n23fdU8nbcU/Ox0sWYKqGbn1E6iPNZ52fC/zSAwgAmkN8EQRQgiaPc2av3Ye8\nfFSB4kV4YZw14mgxzGozT3MHs+FHeTcLW1+iE10VRTtGENYV+3+zrX2OsVkW\nfDYkw7z/vDWQLCkVvcKyf78/U0otl2R4D3hVTGU9p/k55ImWemZtqW9HxBFY\nSQnrJ+wbS3DPV1fsqzufE+K+FaY92M7gWLzf1Y+eUlyLFcB3HXTwdlw8XKDJ\nlxzdQModcHxv6Ln9fVf2yRHb+6mBb/tEJbqf6+uY3fhM1aaj4DlgJn+xF5Q2\nXYUzGg0qpneUNzJXfTU0RN7AjnPxjzz+7kI2ZjbOGOIM4oaqX6rO5WR2rWXa\nDzIv5y95ETmMOXKnQWjwlpJGCXeBy74hNFLJ2WW1QF94w6oCUTQ1wMo4C8Ea\nS4BR\r\n=8gz8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDM7Kv6h1k5gbgxTsetIzF2JPhQjXU1zPzGMX30MCkI2wIgBLrmqYAA7pQr4p2VOcIi44HVTC59HG0DEu9QjijnXmc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.b0c24eaa_1551250125410_0.6379978322450721"},"_hasShrinkwrap":false},"0.18.0-alpha.953fa078":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.953fa078","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.953fa078","dist":{"shasum":"fbf3cb3adfc0d21387e24d93309a032f96c6eb69","integrity":"sha512-+zaCaHjIMkRpnPQ/2mOtvu32Bn1811gj5VjqKYjtciO7O/Z+UKHnPdpoXyYrx5dbD264trL75K5hhtdK3qT11g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.953fa078.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdjL/CRA9TVsSAnZWagAApR0QAJNzU/9FyA6MIJtQYGoO\nlG7D+gtO7fGVN/x75cWpmHPVJQRjwzYEapRXxBRedkVFnFeg8YNMyRwvKHr3\npldOTutuZfm7gKijY5YKw/VwQjNHVkRKI17b2w0DTSLtfK5Mwnui2MMunpjc\n71xhM1IILftGA+0hrh26klJT2r6qlir9N2bCG0mZH/E85dsy9R50Y8DWhcs5\na/BnqoOQyJU+mJS05Ep2dGv9Z3y2TpG8dewIg1pEgkU7E5HSg5Sr0zmlJ4GR\nZHb9oneQjIBiud15PsSzs9WLRLMMPl/kAKJbg/HjvtVusSUmZOPwCEpnHB9m\nxrAHehqcszJjFxbjN1hWvyD8uVBIGxnlZ/Nz9pnwJUVjK2tAaPUnfvWRDu45\nUFwc7hEXsgF2F2Tzb228O1eDbWSuosDjBul1LQ0A3BN9t0P49SXnTsB8wK4X\nt4cZehKon/B4KxzahbnrXWiWFrvPsdqWr1NmgHsWtDinjg7Fex888LigGHA2\narbzlP10FdNQ3KHm0bbWRsTvvVE45ADRfzremRcASSVlqqz0dH5FYu/PCCat\nd2ugkShfHKlwwYGYcG1JdC0XUJGHQdOKahWXNKeWBaMYrwhz7ztS8Y3VEgWp\nrr9qgX8keU7s8ewj4xdp6iZhUg7dYuOP1l6K63wo8W4yN17uZ/yK3jUwlucC\njczG\r\n=DNwh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC3hSHUVt8brITTFsZfIUYmRXcnpARZxeVqi6/H2Z1uMAiEAwcPs6LZCOoU0RRByhym6q/nPzeqXdq1lyvc+FvcT8a4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.953fa078_1551250174375_0.6647547630239985"},"_hasShrinkwrap":false},"0.18.0-alpha.7e0476b1":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.7e0476b1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.7e0476b1","dist":{"shasum":"8bf6103f58bab685097081bab858edfe5bc6ee0e","integrity":"sha512-50ayEedsUvtt6MqbJOe3nHORLbSS/TDlsN1uKGVFa6pCfcfB8it/7HUkxbFdI7g5PhuCy9B8jwowMZCgYvz9lA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.7e0476b1.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdjMnCRA9TVsSAnZWagAA+woP/2J5LfkeR+FUQQPABVrr\nOWEz5WcZxzG5/Ui/CnrG4nYSF4w0MxcfiIp8d1X4G96lwdeGDbMEu1+AnI3w\ng+pmc/0X+/ZeyFH5DvbeGUUhBPQ8pT0/Fp2MUH75/kBirCMkHe9EqfnaZbWn\nwFrZCvuaUEZ1C58IxyFa7R3bZVQO3UwnYbgFjO8dlQIbv6bGQLmhlOfypzgK\nwNChBNJxrbMoqiB+Ovtvv+tQtgB6sYX23VHcO2gy4wgkpDABrku9jp8015r4\nv94rpzqURp0w6HKPh1hxuiwfAXWsP4OP1kp9vGvU6YgsIa4Inb3qUMf8B6l9\np0jMtPs+jdEigwAkkLnmoqM5BZZAHlg2yupk0NwfkAeHAhwjLqAhxk+el3UE\nDQo/edxWoPEdHpGxOWO6YgRgIVrzh4/J1iSlEXtc8hy7tUffGCgDzNeSSmQF\nY40TKdiYBxE2HUcArNqipvSs/FTo20/tTBU1nKZKJXcfY0lg0HSrGZYGIqNY\n19HLzbEFbX+LyqxeNL378Kh8wupe+Icl3vPeTx4iXz3sC+TCHvfgOMJyQMLM\nwyjsiGEbbwyb0PNGN3vZrmNIJi8c3oi5F1XHGQ0alDnPKZ1Ry7OSHl0Bf2LM\nmzZ9mdcq35fu9j/A+8ijNHHAzqWN1HO+YxihmuYrWTwiG6Va+CEgQrrvT9Cf\nJQYP\r\n=YVX0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCl8EfQPRYOYQ0ksiBEa0IvhajF4mKAcyVxIcrzHOB8/gIhAIXKoAsCOkkl5/FxlbW74WgFAmyQtSXLexhWpoqbAifQ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.7e0476b1_1551250215000_0.26108599749946637"},"_hasShrinkwrap":false},"0.18.0-alpha.ed3b0d01":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.ed3b0d01","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.ed3b0d01","dist":{"shasum":"654b4d1b18da23a738a6bf67b868b2d93309da36","integrity":"sha512-iC+zZtgcIa92CU3qYt/jIVh8BK//dsQcSGr+SEybjplETmQnt7XGPlRJmjlSQ7F4thUl7zsqHLPWGL5Z+mSETQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.ed3b0d01.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdjNKCRA9TVsSAnZWagAA1ogP/jXidsAtsNbi8AeABxId\n6q0M8i5qBA/rH6veFqmhtJ86mxGo3eNdBeB7ChkLJ7zpnwhNn28wsOEDYqVV\nJ3dofgWDKbzMqRh+vYR3zJh823N2xKzWnNtaqTVOkKEsTZSwTygkTCR81JWv\nkLfNH4BdE4SszXQ+Vq6X95WUnBSTdLFKzbDwBICynKj7GIJ8WmvCZaWue0HQ\nxbIrYRZzTj4zJiTqOmDIe6iCAfzHD4Hi9bEMlVz+aOBjyCIFEzfcBELSlpXB\nuPuqzDynPk6ZvTnZP9SqUHl50gIiV9QfSvrM2SwP+KvJH5ZB6dpEyoi7mOEK\nravjdjoXuHdV55CHnHOPtGt1pLE8Fg4cCibz/WxPpKYJAtDnKsCSoqtjaXpP\nYB+sx/ummA/PJTkQ7x8hEGZXZCF7GSHZRdMCh6WvEkD7oBDlUnF36iNIJq/8\nqrzdtZQxXrr1m+jJqLMSepkovOaPN0yRszwBKdio2V+NVrbYe3yrv/s2vId/\nmD+CIZ3l0oTzgJYcBYM/sL5s+uYICKhSzU05rK50fa8Yg9sT4nBg0xF7grgb\nS4K7k3ZZOCZvd67A9vehGtfC3Js9smK0S1cIQ+8EQJzkYXLhps2K3qGBcWr6\nn6eWbEaQtU//aDQhLZbBcKNRvjHCUA9AfDhum52q+i2nPH4NLjljH6yY5jdF\nAym0\r\n=Mpj0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHvzG/PwLJkTTMe6/FgJ+L8ENcxFRBDDLeQQBNu1Kdg6AiEAxOu3Lh5hqDNO321alVAzU20BeqSAm7gqe9DkMwSwZnw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.ed3b0d01_1551250249332_0.32902872194919697"},"_hasShrinkwrap":false},"0.18.0-alpha.b1641564":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.b1641564","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.b1641564","dist":{"shasum":"74c1a8fa6c8f1cf22d4df2c3c390d215eb860d67","integrity":"sha512-tOiwOldTvXTJ67N/PqajqAEqUXMcj1mtxoyTuMK+Md2TpYNGHv3ZrvxrCFomYW9AQwNveiLoj/dXR2H4GxejZg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.b1641564.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdj3bCRA9TVsSAnZWagAAdAkQAJyaR3y3qC8K0U5FPt4I\nwy0zbb3sPTlFee3BiOh3kJHiaTlwVIbIg9lpY8nJsin6vdSZowgS/hiG0g1f\nLr21GomJ8Siq0Nu9HhEy1kQYaCR2N4QH9CoP+1CODUvHa7ALP//2QYmy3hRl\n6PDAfHF/ulRz4JsblL1OJcKVDLgQuhhtr50RvatN2EYUNn0kxs8Cby832xtY\nPwHoOXt3P8LSIsB+dJrlRQNR5RYweE0EV1Rto3vwDhlW8/JSBZU6U37yuph3\nn+NnXbwbxMPTwBAh3jD2CPM8bfiRnTNc4T0pINoVO4m7JYImISt6Ll3SxBk6\nXSNjyLTQVkYsM+XCyxwpaQljSvJ2oxf4s3nnMkyq0bhHvBAGBOvB1TfQ/V2c\nH5foDwqNucd0/z+cUrIOf4rPb8eWvmFd12TaBFjZe5qUbkwSavUr4X9xtxyE\nU+DT/F6su/Sc7AI1D4/BXSVkwEK3DelBnz2nvcU4TV/hxLkx5M4DbD16E7vP\ne5dcWiNQ7Vyx5kxuOZaU+eWY98bZNKnrwloYmxsm1YbCigBDzSsbT5j4jKCs\nAgr9/yVVTSYsrH/eiBhYktKyul2TX/Rw8mVMZW+SfFQPO0j6uDhdjUwv2Z6j\nVlVlL3pa1ws1jB7KRPKy8loHocah/osLyS8w/+lnB1jTv4gdyuV0VjwOmnbN\nVS8x\r\n=smgy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGMRO0bi2j50Jw4hMFU/ejbn1xpSHc0gD/tH5oO+o/uQAiEAyOd/AAv8T8EERKxdvDsLyjoFUAHrmL6gFnba+AsHe2g="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.b1641564_1551252954772_0.011388483466501675"},"_hasShrinkwrap":false},"0.18.0-alpha.4e3049ec":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.4e3049ec","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.4e3049ec","dist":{"shasum":"697a0530fad5b7d11e5173bd1c36dd7d96ed6d8c","integrity":"sha512-stdvXmOuYHdUriDaEyZYGR0QkQBoX3obCDJB1is6BkRLeOxpE0vff4fQPsrCchWo9XL74jOlSjkO9IgvdVQGQQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.4e3049ec.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdmw/CRA9TVsSAnZWagAA5JUP/iEqUq5JKj8PcWbB7LVE\n79BI8gnF9JVxReREy40PE8ltxVkp2o05C22c9iHdwyqlF1ADw9mpITpiH0G3\noX1Dk1oSy2ZfqGZSKuyIchE3xkYUu9T5F1au/RWiXlYVI758RSDJuwZ8pEnv\n6x90F+guOb4ilIu5WIjUfPcd9dO9fxHGlrsTrH9qWF9LO5ZPmVITVP2HECLb\nLjPVRIOmlMeSptUwMCnXahqzIiU3AqNC1z0YL7q3ZJPGRl4NarNHSjYes2w9\nlIcsSQ+35Rfdnzz2PAbb73uB33PUt4IYHR/Z5jHpe1vz74Lyfr4ZxJ3++qZj\nKmhdbHXVsu3hk15LboQNLGDKRztQ9Fs0DuDh9J0JhMUPqa2OBcRMIn270Bsk\nVGul2sUiHo/yejlCW7FRQ3i0GzI84+J3Ut2qplMuP1Ww1RiRGyXZsxA1jx8B\nuz5MZUJGP5bUQCDfYVoK9+tdM4RmOH+uwRdsG26cGRWmdXiwi6m6XiOqkH4s\n9HVje6Y5TjNRpayAQLjvVhfqNT0sufHxeM5iK78oljgPvbDAPxFlyJ5s0n7e\n9zULzU1C5NLbroUqqEBg0KxKvrQpaFM+S/O6IPRRJwtSsQTieOQbn/zZQpXg\npJormyqYTWP2NjIDKEasEnml4uZ7Q5KuDZrm8A5PDG18fAsJrEEov5gVGpFk\nlf5T\r\n=v7re\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDFdY4Po1P3wZVKIBw++JzBSbXKvwQddk0djSOFKIXsfAiEA02wa5uWJFPOWtLV3V1TL9LSvEQNHXEaKpFdTKKrixYg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.4e3049ec_1551264830417_0.30094210286467726"},"_hasShrinkwrap":false},"0.18.0-alpha.1830d0d9":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.1830d0d9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.1830d0d9","dist":{"shasum":"7c6604c9b8f1231e6df2dd780de4844684269c6e","integrity":"sha512-i63u1b+DEAB5G2SXUvG7zcRLOBHZGqpqb1Tjf1mqsiM30llI+aVBA3BGbQ7TFGw4KNj9FbSMb+uwZXHDXKM34A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.1830d0d9.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdoNFCRA9TVsSAnZWagAAKEYQAIT3lRcT9thZ2viOUftR\nDgqAwURoW3ngeLJ0f0OUHf2OB8bcmnWVoXhNwZKjI7aitVylXWE2+/c9LUaB\n+x2S8PrMerESaKWpBh584/0sxHNWXX7kJSr26lPCKE5vUWwv8gjPgaMh9Y/i\nj7KWI5I3oWyP8JIhhAmTEdjPx7B8vR4VmCybKdyXHm47xunheQKebls/htZ6\naowbCWre0B9LNkcUEjk68aDrpAeP3lRP16i3pD8JU9MuBgKykSCr615+hnrI\nfuMHeKhHlbob1NmMDE05Ff7cJSs1imbfleLhtzXJFQMq0x0YXxfNbTbLGnwS\nmfeVhNIW/5PBZdl2357uCf5MJCX+dv8c1jQLYWEg2Bcqan1X1UqK3rYUbVia\nLghgIIP/Fnzn73HmhO6bDsibT14jVbpuY1ghyUmTvIkLNn5zztfMt6veADyK\nCCAcJyWi5g4XCWll26H66QrhmaJG728x5dORFY8nR6RJsXSpxHi2dJcjCMWh\n5VynXoq6VuCpTCtRg4iBNFXwfkXU5upJRwN88aq5zm+i9vxcooyiE4mfkVlm\nadjeLWdOanJBeJx4FcUlrFQvA87m8yOk31FSf/UcrkWAEJQmLdjzDXNtGiFh\n/0qm7BCiEedaczyFPli4u/oOhnu0Mt/GTYxeP5ooLjdbLYO60ysgP5rvICHE\n53gL\r\n=KErO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKSd7s/exa8MU6kpMFGIpTpCIYDO2nTKdMmTZkfK8n3QIhAJy8X3Q3Rg85acfxATTOqSKyzBB6mUloB5aontqP6jRx"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.1830d0d9_1551270724356_0.718873605688755"},"_hasShrinkwrap":false},"0.18.0-alpha.505c37b0":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.505c37b0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.505c37b0","dist":{"shasum":"3a270dc70726f07ba3f614c1dfadf983209987cd","integrity":"sha512-1zCW1oPIXmJwQUzbkBm8zmNwOf7Wxe8lymnKcT18zd3bmvG01ndaBYKtaZmEtXLqQ0FY0Kd8+KPNzzT/2tfnqg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.505c37b0.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdoYcCRA9TVsSAnZWagAAhAMP/RC26V9vmsO9cK5VezJ7\nDx5QnYO2jvw0T+892Gm22sUBF2YqFHEXbRiwzp+JRIQC+C0of2tvrNyb8PrE\nRqcDwYpSkwQrABjZfLLFKZPMXwYE3CUdTsbfLxm9ZLhJHjvkJc4hwjOSsGtI\n+jh7aeB2ojbOn6lCRIwu166v8ErfxXAFbWUwUe/BRPNYIppkexEq29GUtjgW\n5vHLoOgBQLJTHD8J3As30zCXUD/NWY89dWLGwI1jKcTT1GbEMCWTRmp0guRR\nu16FXprl35iIwH28O1M0JlqVAZwh1pK6hK52YyMbcacynE/3BETMzbyhAU5r\nWanfQM8gh8z3pvTFtyEHFJ2tyIJg5IpmdGskTmyhfRM331jfdYXsZRa4yQnA\nMkbbPVsiSYYx9Yo8pO/aZopVruhkY3Nf9Z0rTfs0ouMx+VFBb+mGsX0vjH1t\nwnotlOowHCQeHrfXQ7Nivzq6soo9tkp0n8Q0NsiMJzjSMl9tbOse8vcxcP4K\n0f8XQQn74AOulMznTOc7lTRKeUzdMuMuVV3S9521yeoIvkK9px8s/WKei+kr\nILW7yhLdEZII0hrKEIDYbFEmN+NQu+XDBhR64CNnzgYTO+hmA1SRal8Z1SaA\nN1gzD1DXULl3OJ01mBFoDu1YGkW89722J7OKedQB77GfLWlmR4V/fVTx3dWS\ny9ri\r\n=lpRf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDldtC5MGLDnUGiWG2uW/o5/uCENfTnP/dKu7/yPJEo9wIgAMtrXYD2MT1n/fV5BH5dcyisEGrv9/826gRU/rbKE1s="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.505c37b0_1551271451882_0.625715819343263"},"_hasShrinkwrap":false},"0.18.0-alpha.d55b18ec":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.d55b18ec","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.d55b18ec","dist":{"shasum":"1453d29c5b0642a4c3e8db5df2d7cb4d0c8ea55c","integrity":"sha512-THqyu5bVfsrt/UiomGAXexmA7t6w0C0EnIn1C4YpMyUjIya6ailD9bfNdP/2OtfGfyIix8daIbTIxH/kTrRNmw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.d55b18ec.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdpBpCRA9TVsSAnZWagAADEYP/jb0XLRw3FbmfwOtHTOY\nDn+lMJSOgMKxg1UWK98SV4QbOoMEUb56iowYd/sN+paaBLmn/IhweTsfFbfJ\nqKnh0jn6/nvn9T122xr/j/LzwVZbqPViLQLlEdCCwqoZJW20cO1UgkCIqgre\nvBlLaZzG+feyNoU0m623mgc9QmECRA0iDmLIdJRbhLAXSavUYaQk2LOD6O4b\n0PmyhQZ7fG9PKTmFu43w50RUe/hS+y+VtxdUgeZ1cBPZWaVvcfjv4Pedq3vb\nTfxMxHaU77MFlfOHhQwOP4m8PPTfmBD9GbqUM8YtdwiHYP+AUXzoyTcX65rS\nY27yK50t7Mb1jIHvh1NIC/JkVvoHAF+xzb04E3GhK6cFzymlG9y9drtQlUxX\nKsm0Nogd+ljv8RmBykQ5+MY89rvzOfD4TMaaTUB51+sM3l72qAlxQ9pQb+Nt\n9HU8mXlBERph6e4uKvO2KvwjiEdcs38TEUAIAFadCkbMaZ15SUbZnJ4kPTrT\n9qMu1lZY0k0rqALJXRt9kXeqzao1x41IjHKBFKmRUrH1IeFEML9woet+SDYr\nhGMhFciz2rRv+ZXxwSCXbBiw44xkMpTHCLQhkDXYe2x/zBCAFMLWbylKH6aB\nmy9pUs9bS8PvISklTXuwYUDa5BSVS1dxWQRp+wfEWavqPVefPkAhhl269BB4\nxFoy\r\n=Gr08\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCH2ZnoQoQ5/2UtbFYkkrQPJcc2RkpSYg9Kabkfal4LyECIQClhveCuTUZM44FhK1VL8WHUnCnrEK2gLdOPbxsnpu94Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.d55b18ec_1551274089280_0.4543947596700397"},"_hasShrinkwrap":false},"0.18.0-alpha.94d52f64":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.94d52f64","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.94d52f64","dist":{"shasum":"d335fb6b3b3c3d5017945006e492280a15223805","integrity":"sha512-5vtLI1cW0rRQ47mY9nOGkK+fxo/p7V9eOcEXGGMnwxu3Cw9POuhB8qLBOENit0S4XyVsOr81TyShTMjHYBbEiQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.94d52f64.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcduo2CRA9TVsSAnZWagAA4aYP/0zEGWKXWyDhBxh7hpBU\nqZvjKGZ9Mo7Vx9PzbUy8fB5NSmFaKs17L3D7L4kgYrnB3Yd8pXlfwgU893XQ\nZ7GE7hD3p9J2zHELUclpdrfpAnkndGwlaJQ9oPA5MTSEwVk4yHokU5XywPAG\n2A8oZnGDXEtWd7/K7hSFpBPJMzBm54y4InRERDISbGx8qUs//EcrW5Ttsy+2\nyhOWmFr29KApzLeggZiE0C3eEmB0cJXpyoxjSjCZvGZ6Q6DWL/K23EWbYUOL\nPzHmzJ8bIAE9saphzd2RjBG5zi0n97o3DxNa8SNpEkYLplOt1QgUG1gYvYsY\ny8UDaEUrJHwTRQVfQa6bPNdAOrg7jbHA3gcNNxBsyxZctC7xj09iYVDVteCb\n7XH/5EWAWhAOYBkpbR/AJeEdLkYDkTfj56jk++DjuKqsmv6ZDhgl1KmT+jUj\nw7RUuLoGvOodI7WiXiYM5OXuBVfvqy8MfMzhnJhuiJyJK2Ibyc0G5MX+jepg\n3giMmRxvkZR20nZma9TViYQ5svUlf+gAia0WmRw2Y0tgdB32Pv1PHIXawOAy\nObj8XII/ZjNT2q3wpLR5kPPd1PNlbnM8z4FXuPkMaxqYaiCKbwcs0GlysX2f\npJ8ahqMP/0ZU77QSSiVILD2skHG937dppK2fxbBMQMD88QGyS8i1efHiPe36\n7LZB\r\n=EESw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBJoQuS8m5703G1fk2Onot4U4B1l9pljAd3XN4E/z5c0AiAvTv+7LvltzLiJY76gIUnMYO/dbdBHTKdjRNiArd6zvw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.94d52f64_1551297077754_0.5083679712195537"},"_hasShrinkwrap":false},"0.18.0-alpha.06e42196":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.06e42196","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.06e42196","dist":{"shasum":"1d6338b4d9d032b3d83e263074bc3b944083b9ad","integrity":"sha512-fLtFaH9sgHyx03DxMWvNoQ1mWnm/CqfVGTCBEiZ9ZIjHRMAQ+j3+kDDq98Sz1TU8zrk/W74pECNaQpgm+GlE7Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.06e42196.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd4iuCRA9TVsSAnZWagAAMLsP/2eFswBnsxiF6wiysEWm\nqlp/hwk7F8lZ1M2AxRkhKXOZKZGAlYMZke43JHbtUmI1rD+vb0z+Fxw/Ouko\n1DpiH9C4mXAy33djZMnlWotcDa4nBT+IhbzxuMHVIZLBPo/zirk9kYa8JIvL\nvUbhabIuC9IEpKL33H8wTU24W7gObe7de081vHClY+fBzenEkAvvV7Vy+xgi\ndJ+PwXvwyNCLn37JI0Nhm0dOZnKVjuHnoBRRQLp49JQS6dH/Bzu6VXYcq9BB\nMlhqNHPI5RwQClmxrzT/QhuyLPGJpZjHfYQIkR+xn7ipP5T590j0N+BkclzX\nUpKYhcpRitEfCQCSj7q6dFR4t65zV0iAE7OEoDot2UXAXb4rrK12h5qQJtcv\nsZCrIvc0KC8uZXLKOUxQb+08CMUM8ySx+xB3mFTYwXXsanbl023PWRO1ALM5\na7jBBIz6Xxa1UHxQT7vxoQYAFQ6SlW2+0AkD9m0eViGq/LW2MCY41tAFcWSM\nMAJK3FVbF3ww9K1NVw8mkepQ8IhY/09BOzgCR5b3ubFdArslsWDhznbNpjlt\nC0EX973txMe0DdmohxSQQtbvbjvIZUOJtdQADkZPMaLYWv3PQJfG3PREAXQW\nj6yEf2aVfl49z/isLmftCp+crm4iGORyg1jGELagJXjNAkT1qoI5AGqGR+wO\nOxmQ\r\n=TDOU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFhWr6gZBv28uippSF5gH68gg+tw/HxxjTQj5tJBLsL6AiBe7yan9PmdEqrxR+xKF5OCBw5nG/ZZDN9nLnmYaZCArA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.06e42196_1551337646155_0.5306045254250307"},"_hasShrinkwrap":false},"0.18.0-alpha.87ec8610":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.87ec8610","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.87ec8610","dist":{"shasum":"ca566a8551a7e15617044b2217ba8eac6ce33f2a","integrity":"sha512-9YM7qmxFrOy/Y8Y5xYRutb7y0+6N37+9XSuH6QlV8WpwIrOsLW7a98VkkxXgJHLuj93Lep/e39Z736LVpDVigQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.87ec8610.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd4mbCRA9TVsSAnZWagAAYmcQAIA1/zKcwGnftzqJBMgs\nOxtxlknVqlMo7A62jU6GyIwFWk4EZoQH7Ank8UqARw3ZFtUHwkXXLsk52npt\nmqDrSYDHId8ljSCgApP3wMjSJcOhqoiVp+8obtIdTXh674hHmYqEmL7FQSrF\n2ZhwuNdxpJf3ZRxJYZSVfrhS6MuA3/ir1ifib/lax6ua7uqZFlBR4Sv0qX22\nKzBCKR8zE1DFBar5DbDsb+JHO1LY6ex7bIlnL82xNQVkUxjCOdvhsCmN3M6v\n0bnGmAtlTNNofRBk/UGrMXCSCTgeQlECZ7tS0TYSyCMffj01vVjIXL4cgDfG\nH7tBLYsNUMV68SfD81ZOjc2o3F9+Jfux/EDvwQiiOCK5wW5jKwG+QUOUduNk\nVyoRMXIQ37OofLnWrOW7iDlpi9ZEAEmzp2exJCXh5V7a3aTv60DI2TI5kLeA\niMuSOrxW6o3vzY6zVvZTjyZKodiuY/kpZgnsVPV1PNRXWrxx9x9mKzNMBCm+\n2t377GEWQpQzlUg0w9gAV7t74sdAXAkQCRLymwkvO9LIdBrswIragOHn+LoM\nRr1zAKUZhH8ftGF4pjZgakb9OQsXq+V/EQ55x6HkgZ0PmFxFhBrSpgeeUd6V\nFAUrqnfeRY88a5Agt2x1BtDw1Am7pOeG9kcx43dcvTLmMliBqSZRcO/2G+H4\noLZw\r\n=5DvX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB/HHfzHxgs7ate/Eq5XaNbS0wxPXsqdutH4phJBpuMmAiB/twC47hSK1DJYAvhAotSYe5vPZh5XNGAdPPagbLBAig=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.87ec8610_1551337881594_0.8762990692440957"},"_hasShrinkwrap":false},"0.18.0-alpha.80dd31b5":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.80dd31b5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.80dd31b5","dist":{"shasum":"5d1dc55e3fdd3eedf6ac3413f652797ff4812e06","integrity":"sha512-uOeOdXbHfjTMgTE3adTmfh2R3DnQIO+bS/PTWpfDTlVJ/gADx+aeDNlP0irZSsgo+GdCPaLIZK0MxsaHMrXHyg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.80dd31b5.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd4s6CRA9TVsSAnZWagAAJ7sP/3wKJDoVaq2u6Mg/i3D5\ntFOGcKX57lfz5ez4x90d6vpED8LvqRcc6gI0iO+RIEmNTllKjhICPFuGnKqV\n4NUPU/g4/+k6Z9V45Y5shXymd9bxK0jSc2KDJ+P4pXVPwrzDQmwuSgW3U/SX\n4hYKsB1Y0dq7yA+qrR7UCpDWUnJFExf3e6jsO1+/2FgIsaKHFFFBxdA1EQHK\ntRBINSs8s0Awrnopbd+YVYhMgLq5XKIPTxjww6ExVeT3w4xI15g59TC2rRWf\nKr0TS8uPFMR657VpZ3sj3jIcO5CNN/V1abxS/ESrTyURWpp2xSVBeClT+kxT\nPNqye65GKV39+VMdWar2+6TfkSXO6E+C1aHyVmagjWjsSM4+PiucfimagoLB\nA55RdlgnTmAM5D6obRplgB5sSvjAIifE99qe2UHWRCGMobPcCHBYMi6xykJi\nvuqYlmLf/e7wfx/pRZ3CAPgeRDm8tecVfFx0W1WxBZaDO9yyvLK/S7aiAuPh\n6U1ANr04+LS98YggbXBUPbUeqV2NaFMFBDrdk28XyGfjhAWvjk33HILOCzor\neOVOGPmZw7tnp7vQix8qskKXxqM4pXDhtM8msBbhFmuaE9TMh2JYI4LDrTP7\n2Tn/f6QFEugL1K1QLhM0E2w551D8zRlk8/2LUuNbshbY4LM7vtZhfKzynw7a\n8hHI\r\n=1Gxa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQBYpY++R737d3p4BRXEtXtXfnsCAze/w5wCJacU6rhQIgKBDlDsu2rMhE0+4l5jIOqzezpIj7X/so3CyAnITGrGU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.80dd31b5_1551338297839_0.433245029750537"},"_hasShrinkwrap":false},"0.18.0-alpha.588c3a12":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.588c3a12","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.588c3a12","dist":{"shasum":"5212c2611b0c7f6195239a8e1a17f6e582d6f1ee","integrity":"sha512-dasamWsEWEWdL8WiQxH+qjLYWHuf4nFKncw13HMNpT2/XGHjfS5z4LdgiooPbNc6m5cvLysqt2Vk+FR4CRPWGw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.588c3a12.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd6xPCRA9TVsSAnZWagAAkRwP/iLhupMX0Br8YyDUo85L\niBp/03IECp+0heNbxS5hxIMDfNuZGrzOK47txgyvAXlWOQkeHQm2JkjFRL+9\nfOi7UNhn5O+EJcgX0koSVdM8f7V5t6U8gjKvvCmwLmidQ0XdfizHiaaZvMfS\ntcgYvIAzoj3qDLOtfCXAEsjpZ3r4tIxUeVprCwlNZLknQsCOKgyQ+byE9CdW\nKEeYwFI7g4Ek2YDr2S6Ndg4lNnx70YE6EdcIY52kaeuR7C+oBDSjW2sT2/EL\nmd2jh3tch/nvotvfXy5DZ/Q/gAzsnvPAMkDH7BktReXIxxm779/no0l3aBEd\nR2GFV1f68FI9G530NVObjPh43UDNm2HNmEd2g36gPCQ4FPc/aM0H8T7Tv7zq\nDOqORNN9XAp2+DdKpH7WwVDk8ZRtXilt24xrNLv0V/U0y+CxocrD2yZCF9JW\npAkeOI5OiZSXODOnk3zwAaXWHSUGnHu2oG8QkW0jbTyC6GEYnbJo0fbRI3rI\n1H257tibk3xFg6wsNMtYU7fe/nUNJEGuNSIKf80sjwLzteR7uoEzwqtaHpI+\n3AltqJsEcDxPNYmhr0aHWdUqawn9OjyATV3O/GgI9KtpVwWkgkQHRM+du+ar\nOF/+gXc5nIw2YNANIY6mLJO7zABgiuc3SQIeYIZzHEly0xKItVZiaDO5azvl\nw9ow\r\n=TiFO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC73lEl0gcw2DzxbFez2qctUnygtbR83gF4D84gRKn7SAIgf2B+dMlLDQtbLihltNDg5ilnsFVhVbqH/z0LUuD7SKU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.588c3a12_1551346767022_0.8015828242508058"},"_hasShrinkwrap":false},"0.18.0-alpha.0b8bb006":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.0b8bb006","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.0b8bb006","dist":{"shasum":"fc9bcfecf384cb5fc6315005e3d68953f644d446","integrity":"sha512-d3DiH5P0QeHDVtAXQfjeQ2kcZBqgCs0KLanR/TNWRx6CJkeV9L0IRXLmqnY1tr1xsv+oC0h7aBevk1hQsgTm6A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.0b8bb006.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd6zxCRA9TVsSAnZWagAA7jIP/12Z7z6CXVuvxw8G/q7Q\nVGQ8h067LqiJBB0sIIqhx5GzM6JYM1/qfWsTg+9NwlZoyHOYiVqg6HulPiBa\nh28CXWcnCTv04HBSR5Vv3ubsQmlHoM3qp2Rn6edWCRLTbuMry29VrgardE0U\nkwTj2sg1wYKH5++ZStg9QirFNXbGd43rrdIEYAlCqRb4Vq4oCMSxI1roQwJt\ncVRrlxN8iFGXXDPcrDWx/DnVR6sxBMAN6lRYgtcpLW4h7hd5y98HMwGz7dWl\n7pQHJMxllmuVLIwi2RLGge71cDHmigZqMxUB8qcub3I1WjbF2NgXmnvycq8W\ndBsiceiqrzECCOQXWn+mDOtPTW9W2NTOUab1xJCgh2KYSN/JFh+9pJMLN0v+\nt/fV3n2Jhs4LHvtiPwDcFadlTYsXC9qC+M/cMULOmjz0agqcx0XMB/XOSNtQ\nRctxdBhOyJibkwEDp6NOa0GNYDYCu7oAZbZW81b39CbvYEg5sy5ok0M17Qfc\noC3EqIht8fT6lAHDIJa2f+wNJefDi9KGEtUBtyBe1/zahH/Z3SdFIE00Fa+2\ntnvvl4yHphXQdtKZaMgOTa2+U8e4D6Ymejk//AfW0X8I/WSwzTq2JQNJ7elO\n/kNflrauWFyXIL2FQoqK2iNN/D/RCitlNm8agd3TbKV2ECkR//TK4d7BDdN1\nvcPB\r\n=b/H6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDLimwgsY90y4u+9rUtnh42CByc+3l/ULTgLXD9ne8RQAiEA0OC+cthVDwtR8gFVwV/uaiGNUFhwO8usso2m4I82qFE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.0b8bb006_1551346928933_0.08318470383962362"},"_hasShrinkwrap":false},"0.18.0-alpha.e20def4c":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.e20def4c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.e20def4c","dist":{"shasum":"5b472dcbefe2d1e6be07f0a4a8aad3120eaff323","integrity":"sha512-aeFhTTg52EXp4O/4YLP74BKEI7uFSyabntYPt4vpFII/MwCf8COZZxMxs8F+v6TEJCbyfC4RPpFV6POc1jLtBA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.e20def4c.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd7BHCRA9TVsSAnZWagAAPM0QAKQpwwTzm8M3iiiwA4Sq\nGFD8d0qoa3X1xhjQ51J1ZrXUn3nytGmmSwMs6xnBrO/2JM1ovdsnKpbnu5xT\nuNP8gApBkpMcvofA9tfrGqd0Mit9rRrojWL0vkPLPfm3a9flmJkGtJYeOsEO\nTcdue6tQXy0b2TNUKNukRwX46zHidjQW2v6U6gX6IzJa2V7BCMzhp3nH9W+x\nFJx4bAKcho4ObovX+JXMXgRGEJjs9Cflfa0iBSBsRkwEJUuAABQn9LBaSUnw\nvxVXmbtAo8snPCgab1NRmzxKNzyrjE1G2kjhDsk3OE4s6bJPh8D/HfnyVE11\n+DxWHcjvc+cYGpogShpw3xZGIGXvHBVZl/zsDM5qaNUmKNGDe7DzetofWcdl\nnffVlmMeCCQsGu6wgp0e9CtzGl5S4Nya4NozQNBtvktuGeDfnc/xQWi/5wrx\n6ozuC5QjgPWTrAlEZPNch9dYQHkqjnDlnD409zTtJoA4eA2BhaZWsFhET9sz\nOdVR6AMnjW6YFeV5jevWXPbUMViWnlC07dISnoTj9owlAbW+5xP34kryQri5\nb/LoHLxVzO76Qs8CylJiT9OhZ8fPAVWnsMh8sdgcnTqUWsmsFJ9QVMx7NdMs\nDBo7E37D/4HgDXut1eqwMvPeY5Y8o2Wu77B73uo3WTONL5O7Ccn/g30+orYq\nuMrj\r\n=gARc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFPj4QxjqtGnNH4WTq8QWZh0dBP2xKMDmbfLSjaNS1dwIhAO95vGffadppxoKiVNdm+vMB3inUJslS9H83wmSBBjX7"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.e20def4c_1551347783098_0.48816525633397334"},"_hasShrinkwrap":false},"0.18.0-alpha.a8b25558":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.a8b25558","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.a8b25558","dist":{"shasum":"9fa38d336dd1f647e3362c7a9f26f2186d32b50b","integrity":"sha512-aJKwDIBY7GHv8cYEToK8bGFoF6hVht80zzEG7/b2P6xcmKpkeYcxTzxdIzOO2r2sb7nLZonb0gDlxBkfAHkiuQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.a8b25558.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd7IcCRA9TVsSAnZWagAAp+QP/2dx16LnKb0vAOvfP+nq\nFgjRE9241QHZdH9sAOipTx+GgPRGJWP0As9PVpkBkuMO8neayR82dY+JE2XI\nbGwi7k9x5UEDnBxvwhx6f17ukaXUksgdGbmrH7kaiaMTgdOxoW6qI2p4wIQM\nmGfM0YkcO3wv9HpLgn8BDyyGENd7eAyjTe8mHDGoNR3gX2LFhpqvllOKjwUb\nHTxEHnLhcZ7VusLKx60NZjkag3nib1su3x6mGtIorCnGflQMY+msWKvl0TUn\nEMD5g5w+DdyX1GSlWLP+nSZ4mCn9rHCZObcB2U44Y6iEtC+YPEbt4bssfEl0\nO+QkLNIfwIjgIO/ENCAd3drv1VxEeKAAmGJ6lWKMgpbbuVs2W8ARkPmakHmX\n5c76rBCAGlylwsnXL6QZlqsYi4KfYLusmOH37Y+RwhfCFbewo3pUMj0Q4J6c\nQzC+AereYYk3quITpUcfa6gDcj1WH3Jg59eunO52rHIB2YhbHB4rY1Rz4uqR\njPfsY8Rh9mBNvud1jZB6rLVPkFU1a6yzHtIdBw0OJhp0DjXQx7qQAAIzqus8\nf8Tekhg+W1cNKvphj3w5o3iA4f5NN4JxImozk3OVSmuzMIcQ8LmSaVTQoO0z\nUJbaV/0Mf2m1u7kGTgiaxn+Mk9bc1DP11ph6Sn5enTtPpGtP3jY0A0yQS/8e\nNn80\r\n=6lTq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4kkoOEx2bFupGkGf4RUfVcXEoaDr/4U61Gs5BR2hZPwIhALtQdfNfFhBMjYgZPFsTc1hwbaTVEfn3885s9XAAZuZA"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.a8b25558_1551348252085_0.5556913901426006"},"_hasShrinkwrap":false},"0.18.0-alpha.98627006":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.98627006","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.98627006","dist":{"shasum":"992dc6d7357c0df7a38e55546dfbf01d7ccadd28","integrity":"sha512-ysOJCWQZ+s3hpZZd1LdCJsvKmMvB8htbSZaqxRqX9Aq0/jAtmw83z5WjLPQ1JYIowRtCNGOFNLFDaZkYi2tK/Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.98627006.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd8XPCRA9TVsSAnZWagAAlJwP/0T0d/eyUX+zvEoJJG/v\nF1JhDKiahIfGTE56mRVUwXFXKy+5+EwMft7zRzt7X+Kf2r7mWRcJ6EwRXtuE\nOuWTPLbq5AhH7Rg1ckDITbWysWu7GCLJ5hZWpOu4YheR3Q74kQBzDGeQtX1+\nYxOucYKicnFzskDn3ODH9Bgw4g6r0xx99hvd4UaCLpivytHSiUF5siw/EV28\nQH6RuG1umWxZb/LUzRqvIsY7seLu7n56WBppLKyDLDY8hnFXCRwvqRI1ZR54\nBGf7KHKhGjC8JrUjTSFqtwRfi3bRm388oQFndoKICFQRA+TrvNZQvis3okTd\nwjYGmZDESFn1HElt0ZcNAJ+Uj0bd2tu+viRTjpoLKb9dyN6UkSOVbUjZ+Dt9\n1JMcVAXOkbcZ7STSv25tKXWLRQTw5HbXx2P7Acd14irERMqeau2XA5DA6Tfs\ni41lb9p21XPteE1Q5nknh6Qv6Fo8Q1wXX+BUT9yiCEqN6to7Jdgz6jAWGKAF\nQB/Mg0z1RTLz3ONIZu/ATYqziz8sNTm7y1z4+Bvlc1n9szWPFQvAk99xs7bd\nYajGUG0WbQUs+ZqC+bXCfm8QzdmLyM0EFag24GhLlGeN86nJWCcrjnUHz2Ym\n2D93/wI3QCSLjZ0p3+6yZl+jotQZBBqIZqRo5uvcF99TQ+zIWrNV/eOkmC7/\nHYxs\r\n=E4kg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJD3TxKG3Kctqg8YODrMjZGtOrIAHvG/IQoBx3gLw7AAIhAPhtpE4mo20iOyQALG8NTIkZtUPxWA/LrbYJuSykLKrU"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.98627006_1551353294540_0.8466356861514268"},"_hasShrinkwrap":false},"0.18.0-alpha.ccea5517":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.ccea5517","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.ccea5517","dist":{"shasum":"2b818a75de8b5c8bec24e6c7d132743dc5dd1525","integrity":"sha512-Kn0HiCoQzEnQPYZ3lxIMMhbqRPB+bOjMR1XAVAM6thGMnbeTMtGVlmgByZgaxCrBv2pdxqCh5JxVngAXfYUmsQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.ccea5517.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd8huCRA9TVsSAnZWagAA+hYP/2ZPEa9UEnfLn4rH9jTY\nsg0ls6DdnBkQxMauTdcnH5UxsbgxNqx95dhRykMs7wL/X9H4VMnKAs+BvHRl\n8XNX2pM4CnsIMd2frjsI1MM4l0llJ2z7C+bfPF3lckDrQgmXPB1fGbuRiDWk\noJ/2RwhOzNZKZytH7/8v6Y91vW+rslnRcG3S3qDJC0n2d9q3r+lC08bYI/kE\nBD578p3TOHI5Qz9aU6xNqsT6UWOx45G1BTsVCGxULGH9zVZHjweigJNT8vaC\nTrql8Ik/rUSDONCeyIDYNkxsZ8VW6gd+UHusiPy9EK/wIdHb6/PlhZn0YFXG\n0gvcgkvny5cIk0WqGgkElMfDyVmoxOWqVG7aWvMOHlwdaxFmcN7sDSURTtJn\nvepIso3TJvZ1W5OzEqLtjVTEpLWqQJbG7wJgC76qmEwXGVv2dpOFhL0tRQrL\nyV+QInHQq8eNxM367+f581NdrBihtiV1tNkXHZL/WWAFclAbv5NRKjGChTf8\nvyIb7w9BdSJh1SAs/84V7K5wqpyzjH/e+z1qfxkqmneNWbCgoOi4HonRclNA\nUxlgy4iknuo7t8kluJATGlevUbWmy880mX+KKsyhno0SYbPKkZk3F49swqRP\nEqemx1/03XcCVwDBKCoVwNjZMpPUBzdZ9rUIVa5OO5wy5vnQudo5r9TiOMr4\n1Mw9\r\n=TS9Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHf4oUN9D8neNbwyC2Axn1EQe6hwca9266sWr+xUh5BAIhAJ0EyMLTkbK7oDFE3I1Eu1oARTF50nEZUFqeqnTHUUaI"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.ccea5517_1551353964701_0.5998988086643695"},"_hasShrinkwrap":false},"0.18.0-alpha.54993417":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.54993417","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","tslib":"1.9.3","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.54993417","dist":{"shasum":"1e1a1aa6413297ce1c02eeb454d447ad5067becf","integrity":"sha512-CZ6U5keIhLhFYsBPw+WCDlVouW1r2f/2daIuvdxzYxLvpZ8EGmYKcohC73/VibbIPnF0h8jMTCD9Z90hUljXhA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.54993417.tgz","fileCount":17,"unpackedSize":16057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd8j7CRA9TVsSAnZWagAAOPQP/2wo0+IH5RX/e31AfG5/\nF8ARTwxQIxSFcgUMA+2JKmZalC4Kw3fJ7DZvawPuTBO9/MBEHK5CzUHEM6Is\nsghZcKnNcZyPZ3n02Dnv9tEDZRiCt686lrqxXmHA30f/ssWYoi5dExG3uNxQ\nLbBTgx0/WFnVyVPouDQzsQMeyL/QWAUsn3MKnqYIJo44UzjOktSZEFw0piL1\n5WrIq+q8tEZgR3jLZJfdWRpAvroeZMT7yawu06X+HU4ztF6BGtDjHUAXvFQW\ncGhiLY5mD0w3rGpErvDSuUMpCw5jMXeH6S6l4x5/y6Li9JAXxW7Pxo5nFktI\noBaIJ4A9azpVP4f/Ii6tHOCjODRhe97ISH3Zc6ugfJcS8AFyGNZrQhai23EQ\n+u5yuE6dPxjWkBjSEWU8aizrhi9rJXO+jKwB7U1k8L0RZD1tSljg+Pgu6/EA\nwskceto4yp0IYXfVjWP0LGksRNYHHt83mq0/a2dab6L87wE6FsU5zdbrGXH6\n3W7/IHQtPd7LpHmYNVOO640x9vP2mtcUG2hJc5/hBn1/mSb7hj6RlsFV4Q+L\nUTEX/RpdZHc5lE2YC9+0hSH9S9qm13LGK1+vtFgTL7rjym0qPmtOhk+fxAo3\ndPIZOYQubIlvPQxNsl2yLxPQqUXWeuvguWiVkp7B6/Po+p46XCvuzkBWCJRc\nPp6B\r\n=ugGI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKwJm6dQFODEDLggYOmvnGFSLFYN0Xz80c2w/U0mawIQIgTJaeWfv38S8Na4jAEXPbr4uZmpLHbCosNVyF5ALKbEk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.54993417_1551354106545_0.9372772989557687"},"_hasShrinkwrap":false},"0.18.0-alpha.cab8e330":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.cab8e330","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.cab8e330","dist":{"shasum":"d1da079ccb64208b8c0f49507c121d60e6cb5ffd","integrity":"sha512-6ncZY8OtM/XTQ15d017cdJIOVNs9cXr86AtjlR9rlCrORTsyK42x/g14cchdlZNExK049Nu9lArFComE73wP/Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.cab8e330.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd9C5CRA9TVsSAnZWagAANGMP/2r1/D7ZZHD4s82Z7zP7\nndgy+/ejdfOwkOXtSTKNlVe9lzZpAf9J5A8ejpA7EybClN/COHdwTK3V+q5a\n6IAcS2o1Mb0C3OMMOlOHJcjzy46A2UsRDZfjT2ka3tZy9DEu1vxyAdCmmiBp\njMaR+t9aFypb4cut9Pw1Z4mdrh9F0pyBXIoClofHuo6bcIIY+pejaxcJu1AE\npwfkK9NO0Kn3GFOQHSfhbJCvfr+QTgSlmHW8Goqu0cqfpZ83CjqM6oxcEq58\nMsqOE60Obn7KmCz6+N8jUZk2XC31IGtNlUi1FC9xL83LlY5FXjEtxrkPsyOv\nd2PcFryGNzEAC6LKo8iRP7DnUOfC4+IwnUVL6kUm0kS+ANH3fbyIQdDkJphl\nwPOzKGzr3NYDwz0i5p+YRIhZ8cBlBUxvAerAN7GCadhDjxWMTdf9jW+vSr/a\nCXwjM5uLb8q1jLKVT6jHz+woB4Nkxt7lArkMhngTvyGSDMnRro0H3RP/uqRe\ntSXEKCvwNN62t9YDOCKNqOs3QVqpSFgD7AUwOi3XLp+JDg1gf9mJQKWBlQk9\nvaiUlRnTyFfRJAGQAbyVsCkjh5eVx7qpnQGpv4oqrtMsNUWi8o3eJEBB03hP\nWcEvcvqVWizsdQn8wc3VjHhWoLS0oENsTHX4pkN3EdDJDwa83BwOs8jvfRWv\nvfvY\r\n=G/t3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBjUPaimvzk3NopMPrEt7IXeQIdkofOnn54m7iYCACvGAiBgnqU/vKsi9E6XY1qEJTiy2p4cSMX3Ug6XS3zMMnxUcg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.cab8e330_1551356088393_0.9903880941434469"},"_hasShrinkwrap":false},"0.18.0-alpha.e869ef7c":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.e869ef7c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.e869ef7c","dist":{"shasum":"4c8e8ece9c920dd8177a845e72f36f07e2bd1549","integrity":"sha512-utPUHbq43apJHQQO3QJ6JqspT/qy58PU4hGClSsGuCM/NUon1mTed+T79HQc3vNbNZN77mn0ZpzQuYCCoswSOg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.e869ef7c.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd9WZCRA9TVsSAnZWagAAbawP/3KV3G0YhEhppIqXrkSN\nNd0xvTL/IlJ+XTIOVySQSQUpTUubbbsMzgReDZ3ksSHpIb29/ngBcV8mF//5\nu5hzrcB7LpbrEVOe/2sPehSu7XTI01JmpLku1S2vqmuTu1L943xkmstUg8+A\nRAbl7/9iQ+kYjGrUVf7W9mdnktlSVi/4JaquxJvB8QBE2p7nrpF5i5SNE0Dn\n9YtDuSCg4NKaZqN5xi2VATGZ/s8hLRj+KMByZgA7yMHlVCEmM4yKfnbfES7I\nk5z9GnlLsxIGtIICoCR7sPGgSJ947uT14/Il0j3zHSX6C9Nkv4WKrEH55qEe\nrjALtO0fdSMzVhhB++QqPyGUi4mFu0ifOhWU2pNlMr8U7mCKBR9LOrBy5yrd\nE3Z/xjl8iYt2X/nBnWO+/ooVjvEPslH8d7+YLFTwTBtwgkFSTjNz05Q8Cvgt\nWVHFRUB9rYpO0Yxf7SPBuDAbizGg2qmLy3an+Srsz6KkEYpekQRvF3sRTOKG\nWVj7D3RDk8VNPYyNPv8qBiOivjziSkz6fl6zQ3knnibtff6AG5r18PaCbCa5\nzM/OaFxXrCv6KIjUGthpnRD96rheSMz7oBAYEaVxcQjmXsSc42QXrq/K326T\n/0lvfWHaAdH8lnUKrD72t4RaXt4YhTQWLrhet66tK7oIMIFJXtzeCihMf2hV\nbmpB\r\n=pNSG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBOQni1baPQze05PqpwWYDYroL4O7Acksl5sVnLwLI2WAiEAitFdo0OgmGxIp2dF9MWfRUyRUFrnfDUSJfzpcm792Ks="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.e869ef7c_1551357336488_0.5835448593358694"},"_hasShrinkwrap":false},"0.18.0-alpha.9c27381f":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.9c27381f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.9c27381f","dist":{"shasum":"60747208db8256b88c0a19a254c3b170aa02d953","integrity":"sha512-5RxgIHmgaFQkF+WYbRpz5l+UlbiKNDrjTyli15gQoyouYMlnwXnkRy3mCn6qEsf2jYzlTnJIDozVmWoikKkKDQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.9c27381f.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd9tQCRA9TVsSAnZWagAAer4QAIIXuk56YJs4MJ7L/o6i\nxmDvhc4qfaKFs4nDTN0fDEz9IKWUm3OsR2BnGM+tWx4h+IZGbhsCiVbMV35H\n0xNEvbQ1OGt3gpJOwg8NZPCMOm4z9yaUg3Jq63JiQrdzk4FII/LvZH1AnyGb\n3l2kKjljzuAiV6Fw7ChAdlvyEE3H18N74HZbNhfsl5Cr5lvieI3Tx0L0AKqm\nrr5+qrkb7a8EcuIOR94H4YW6LqJ+IiUSrfrkUxg2UjgOs/RKL4MgZ5MoPujP\n3EZxTyIq2PYlzBnkSbZeh9MBQHGebxhFkkwka3dX7N6tg+2gBbisaj8Bwwoj\nA0Bab3Qrs0pfZilkG6PTtF+dmD0niVOzDRBpDfCPzz/iI/jws8YQYyMRWCuT\nyAlojFWi4Bg73sFDQzROmqNM+l87o7QWfkr5hrqGbYhBJWEuabgcFvFcT9bo\nz3VaANvS0AE6jxPJG/1y60K5tW+d3gu28eDBf9G6D5Z8O1TVpwNh76ZQxiGb\nfOQsLwAYKKrLfQbvAEKXJP7kaMLtM4wl1ahVxe3a6pzwec06G0p9ame+4vRT\nRD+AVg74KTpj5RDi5czsD58jF3O8XPYtfljHRfLb/q+I86mVbmpdZzUDheT3\nTfTtqOh0aPbTjhDs6wfss/0DiASvHv6wPajMBNifDZxXkUURikYjWPdd9yUD\nkN5g\r\n=odhi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5Qr7Qqj/hQlUMIHiXAcxruV3xccR1dMkOOMzWEPaDEAIhAI2fggzzAfLHzRgibpXvDROsN8lwEty3TawoTr7SC+Gm"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.9c27381f_1551358800103_0.624470069140878"},"_hasShrinkwrap":false},"0.18.0-alpha.b3e9061d":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.b3e9061d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.b3e9061d","dist":{"shasum":"788839fc256e0d2c5b6bfc1b1def55b249738935","integrity":"sha512-+7XuM3s9/kWeSq5qEfg2CBthBf+Zhqi7CSOyoTNvQcV6nteRYXH1SkesD/ES8B/FKn2C+66MqNKSLAYv6IhqBQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.b3e9061d.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd+DPCRA9TVsSAnZWagAAZjEP/0E4NXWaRWRYCrdiI8y+\nM36HbgnZjitcpwp+XfnQSMDjVpS3OJGiohl9ffzYdzD9n/OG7USx4NE/dwDo\n1lh9GBSY0F821md01QjVUYfV3YuaXH0L+9iCqf7/qo1cQGaMI5TcC5yhB8CZ\n5cXmZZ5eAim+9hpy+VDS80V98pSkUG2XI7uI8ByZhlXqogEtUF7FutppvFo6\necZn/PMzfwOV0k37xVO2IMitWlS2fWQQMxVEaYiVp2wffaD0iZ7nt82OCGF4\nvTebJq7U9I4Pa2w45r5yNfI0gNbkuccLj19cJggWtym3a04sCFkfftXR3aIF\niBXsVsKJbbjx8curLoO/Cv71JC+S0NhyRU7UODoxQQnFeBGkxNv2TqYJvZiQ\nBDFs0lcXvT3hGoumu0SH+MHlQ4EqFbvkCWL6ulPEhy46ZqeZxkw0bqLxySz/\nBASwPy88sIOzyx45w1lQ05m9FzAmcu0bjlHHBpSIPJ+DEUJx5r1/bDVWqAv6\nnfLMrhj4lZQM1eVxEPZBn8Fv528fjfK3Nb+FxFIYEUXjMPHdGgTUiEa6QD5g\n24EIJOV4px11ejuoDdzg56r3VacVPX4BNRk8hjSSflwvFrjRsxWglm+Ivw1c\nRIEBU3z7x6KduXbWSWBowhHofIkJBQBdufGMy0FEMiTYgx4LuoZxjGAgzQc7\nw2Wi\r\n=bQTw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDE56nxPF7CWxuWha2nOxT1fAeNTO0Vht8QU8WcUVI1UwIgI9wE0VWCXS4jurqD9FHJx8fPrZWUZvA8Cq0tCq86cO4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.b3e9061d_1551360206407_0.9086498385402966"},"_hasShrinkwrap":false},"0.18.0-alpha.e2406c52":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.e2406c52","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.e2406c52","dist":{"shasum":"e3a83164e1e925bed1f74955da2d623082cbf52e","integrity":"sha512-TzcazDiYDy4HWdWtKPhKZTD+GaqKIrF3HbDMwZyw/OKc3tMQSBYp12hFoo3HGLpl5TUHzsF0h4QW+fVDKyKN/A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.e2406c52.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceAR5CRA9TVsSAnZWagAAn18QAJ0br6ce1fg0kwNTYOht\nuw2bW/S1DR/VZ4ZpQoZZp5GJtooNUeLfdZZeITQkAQfB0+zPk5iXdSUQ4KX2\njPALR6JcW9RBaOjWFVoIfetuHlm/34dseTmSLglbyfqfEGVreRoXAlxr1Qyz\nu2VCfhmTHlB4k005hS4IaBQlFE4o4n/3HgxWUk/Ylw5So8uBpd/SBZjm8mZ8\ncuqhSZB6G+73n4AhLnv8KioMb4661EdNaFNEUOKa8Kisn+lfpovQN9qR92Ey\ngnf6NSfpdxJ1oW2wOR4yMYNbBTG8xIrKXrvP2f0PA61Y3L/dNKtZmPU9e2FK\nkma2JkckqjHtCE4zz9z1h+/VblDSHh60hdjDGqUcR8OUr1VowUTVhYJLIwoA\nEOzKh9Vw3A664+pARtUz1vCh8wBPwu6u8WmnHCn7Gr6h5MNwwu+t7oUN+dRL\nea+fJFRN+S13vI3cOq+jCWzbAY+9ul+O9AFR6mHtb0viw4YbwpntTJJTIdL4\n7Ss7vUSf81QvfkK0tBH7m5w5jB4622MkhUk2uD+s9cbyT35KHncGhFnYDMy6\newyK7R+APGg3dldju1S6fajIlFBDW5Y14/xA3OJEr6efgW2ox3ErsW1EP6rM\nVlyb6nxNBIoM0FTACQqiiflBsKbQtrfvKOXxI9WEUyEW8EGQX+iwa/KSZhVS\nXCAb\r\n=y7on\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGSwKCc5QJ0SnbYFvdER/Bn1USaLVajj8g9pqFpmdMZSAiEAr8ScCjtC16WAoTNO+K6nEqudx7b4p5fkHpedGJppV1s="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.e2406c52_1551369336811_0.9556145088098318"},"_hasShrinkwrap":false},"0.18.0-alpha.b9c2f9ce":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.b9c2f9ce","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.b9c2f9ce","dist":{"shasum":"ef4db1c11e621a36ac6ad32a714edd1a692e1d39","integrity":"sha512-mOZOWGMA9Yc/2lmMkPfvEXZ/QJvYS0NkKBvr6GRaBz3rsVUDSxGdL5OS6f+M7VS9SA+vYdJ8wyuo9+c3pB8U4g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.b9c2f9ce.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceAiZCRA9TVsSAnZWagAAxWwP/A4YigkaKDlJpy5lzGNV\notTQYUVfuQsLN5LAdM7oGgMBbFFiGhkkokNwTf2U9r780S8UtoBCZp8H1h+Q\nh2VabWaRcRTt2E2Hu+8Zhk3z3CJGn9W5OlHSa1A/VxOxzB4kRJq2yq375YbO\nRDeMNhzBgi7ubqNU0Weqar4/o50K7OQLnm6cMRezMHZvZdHH0p0CFGb3ISU4\nr6eUVdbk8YyIjPjNeO42zfraqlZrU53Itn76/U1Kw2D9XxjXKcpeMLhkz68n\nL8FAlqe39CJI5Ha9cFh5re8Q35pJ5bP0LdTvuC6OMKlIefeW9FmEt+wspPTq\n4gJStct6n/dzfzypudiNyFwc6Fyd7e5pjy2U+nOF1xB3p0d9TlS5HRGEXDfZ\n+D2lEloJ8OU+4P8TcSTSO+NfQi5iZ0bu+bj6jAaVbqptI3ZqvVN9H6NIIiPr\n/jGsVzHWLCT0nfGeFD1NcEzF01M3y7g86k8qkpfsf6kvTT2pMDdbSDsfi1EX\nUCXxBOkYjY9/aMh7BWaHkE2U67nQKu9elYJY0hCMsL8OcwYQJzQddZvGBVMk\nAIeAPoCpc/CQdZ5cY+mY7YQX54gOHv0x5IHasmrlGk5qsx/HsvjK6Z33toa5\n1xPAMah3QXlJTpvPEhD4RK3lrWYcln7zFxbm+yVigMYpIESTlZjejg+ZUNE+\nIZPx\r\n=UkSF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfE8+QcoMPlrV22FmuQXZxiSJU9P4amjKdj7uKHJswpAIhAPmRXJ+numTri7EujVB+GBXV1Nyoa/F+gbDHnKa9lVF/"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.b9c2f9ce_1551370392806_0.5566315257736323"},"_hasShrinkwrap":false},"0.18.0-alpha.d4458128":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.d4458128","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.d4458128","dist":{"shasum":"bce91d98c02223a795d6a7e6ab62e57399bdf620","integrity":"sha512-/AIkOz9OAnzmr0jKixdd8WNHQMPareRMjGYokMTKRoWPRx+bKzvXdJRPf0foU2CHClZlyh5ZGktriVjR/3x7Vw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.d4458128.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceBVVCRA9TVsSAnZWagAAHloP/3cphzdcTpVFMKmqaihG\npTs8jrwoZQKKkhqISA7yfsF+jiQCZVbzONmVTG5fjmBI9wG7k8wpAG7o7U7d\nQAjB77996iJi0p1vZHI8JOFqfxJVjobpyQIzT56YdCH9Tg4raWfrkyWGeNhi\nby2pB8xvNG7qFdoznUVbBbqPe33LctCvK+g+KV4e2m/bmeokyXya4QsJB2Og\n9GsHz87s6+97g8HxeEY+PIqYmP0Zb1GfVGZBvBCOSvN72vmQ+1gIrDiUtHoX\nK66yRiVLp7Oh1XD4Lza2g1VIKDVZ6r6zpSNoambczLk5nWyIUO8uf+JROMov\nF2tZ2uIbOHJSEmMu602Le89ybs9fgnAHBRNHzFkMpcVGekE4fWil6laU1TPs\nliOdKt53DL3qyvMVg+NShc3wfLAj4TQA+mqCZOaFigaYWspNsdfTtHgcUVJM\n/SV179uwtHKQ3Ci24MwjcowHvoBjPPCJOyVFgUOQLWltBftGn4MohdfW9EKD\nfoDEenx5E+cJJZRJ1aXarYtupcEX5tzLDz18hxoaPqDhg5Uzrv4sT5q0aiad\nLr3TS4EBL27v1gArtFoBCyM31mdZiWthnoAmqVsq4Wcs2rRcc8bMh0wU5BQo\n/GZm4x/Ozo7kRcPI8wltGv2KjYZ+jmnrzEyIp4NCfXYaO6t/qazSseMwCclb\nA5Sy\r\n=q+o8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFRh2rImX8K/MbEq9rLGwFsVaJdEcjU+cqgbgLdGSctIAiB/pURKH1bFl7Kaoj+RMmMb/8KT1e8yAqmalG0soIDQJw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.d4458128_1551373653044_0.8463427050441936"},"_hasShrinkwrap":false},"0.18.0-alpha.e560e7bd":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.e560e7bd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.e560e7bd","dist":{"shasum":"4bea9aa1b6984ca5a87de33ce6cb82739de59ff7","integrity":"sha512-ujcLaGQKVD/njvSs9s/C5Qgv92kbLJbe1hw0Qm75unTXUySSFev6Jrvyxtt+LGFTqcB/zfF3pNhUBzzMn+LUxQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.e560e7bd.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceBsxCRA9TVsSAnZWagAAhBcP/0cCgAPrlx5rc0TBzNVL\nRbHj+U3CCZWDRMI8vXNEJUoWtzZt/e2RyljVvvFsiPz16h+DjHHTvlD6hqtS\nhfLy5DN12GBl91jKH0f2vDYOwQ0zz3Jqr7fK8ERdVbaKujEiOEYf6xYbFDjU\n1Yo4r1mXDmGUVHZn9zBZiAuuIKVg5IVDEVbIaNOSTOcRm/jP+hZ4OPypA+EP\nWL2+dDS2xgXf2InJKZWI8UZz3XtO3MkH7R5QBZRaNox5zVPgr5M5qh109Hkz\ntHQZZWHC9afcERhBQd9teEMrAvKpIPRn/QIHRBSj2Zr0CRz88tiyhAJ+Xuzd\njh18MPC3Kk5zecXLIVH7+SlCVY0uIAaE5+9fZpLozJqOF5j5Iqg3XIOQcGCo\nBB6bcADrWH199tuOrFmPWErLVLu8g0o7nqTzR+RhgF9SvpSFxXeofrqoDy2P\ng/wqgusQP0+mfIFzOtsYuLB5s6Sjrw1bft2fPGoBA4PUMNQAuKr9bmIe6PiY\nmZlT3Q4W4T/HdNFtkK353OLCjyPSIH6ADmRg9eYskCrZ2GIflSurjd01jXR/\nD48Y9ZLDfBOcAAFoUgYuUI3tkfBnO8V7LgUZ+nIL37GvtTGuK0KH8GDdDUZa\n+FD48rx7L8LWrkn36uYqMDFxG9NgLFbxFx7Q89XZ5pJKhzuFENq5YklefdEr\n5tXI\r\n=PLkE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyW8iRyilSA5S7tf5to6eMUx/bQZuZYKsuz/FVcOs0fwIhALbc16J0EHY8qDT5YiplqlG0aYvUZRXPDOcbsdvYW+xR"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.e560e7bd_1551375153158_0.30404488551245246"},"_hasShrinkwrap":false},"0.18.0-alpha.b1d88ce9":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.b1d88ce9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.b1d88ce9","dist":{"shasum":"83a250a5c94a7c4c624425616c4072f308b32020","integrity":"sha512-X10Cr7/gQG4xt/UshWvBZNFcKwNOcG+LWdDNDWs0OIOlUl0TziZMETXhf3hIHcKc3r39FJ89UIHUsSaxtWINRg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.b1d88ce9.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceDnWCRA9TVsSAnZWagAA9TYQAI49S79mGkxSuRN257Px\nBCOoUZOYqOLh2CqgQ0kDipT2lUnPo4fu6BDPZDsNCDhntM7YDM2pLMLCYqwQ\nzYxVezEQmXlGiGZj3eRaaiOet1dNMhY/PqYwi20SuA5sC0k0c2eTjJ0aF2tS\n708yzClgmukv1nvLXhw8/6Fb8IkGdGU1e1K96JD3icfB8OzWtLrVNfT7HCLW\nc0eIs9q4NA4fkMgOcrcjQmGKzU9k6CVCHnTj39p9ApEbf9isQy5O+MGKnhaz\n1tP1RjU2rNv4rwFEVRL+/+4vKhpLCuqbG9A1Jxvjior92jyZjtdZ7rjbbMW9\n48aed7bDp+NdfOw5Y0T68BXXNAZ6WHWt203fdJ4VCE0YR1OSXlz1S5aGNDbe\nFZqOE3Tfq8wYCivkIdCF2P5kzM4SjQjbbHfhSe72npfYdN9TM2N6Uv+rir8V\nFeU9dLlOIELHbeQHtZVk2F1BJiAB+VrM0sAt0+oNmwlpJ5cT/eiqY0zvq7UC\n7CJXWqUFTidQEEdomqDrmtPGOeCdthVwVi65IE6GC76xOpdsI6n48TVyrIwJ\nvgaWQcRwCFUCojYpjXMLsBfwOHhRcfueGMsitlC4pr3UWntPh25OwpewcuLh\n7Q3H50rQmeodbmo0VGiI5keSaB95fWmTdRgXf5+GsbcriWxpaMuW6sc3TrQj\nP+To\r\n=hand\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBrkDTO+Ugts4iUJezLU2jZnueJgsZhVVY5hX6Ypm4KkAiBpj47lgktum4zr0O6JTmWgAeekv8nfJCDTx0BjTKRZCw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.b1d88ce9_1551382998032_0.5044215772475675"},"_hasShrinkwrap":false},"0.18.0-alpha.d365409c":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.d365409c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.d365409c","dist":{"shasum":"9231dfaedcca694464c0f5e952b97800c39e7f33","integrity":"sha512-/WEo/0Z/1h0+/K+hGtVqHZMfjcA1mZyTCeF6A7Xk/utkG6ws1Uz0Y6d2JKMzfmyKbwjZj4IG8Qua3j7kP/ePrA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.d365409c.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceDoXCRA9TVsSAnZWagAAkb8P/2viPi28weIq+FhJHntm\nFJ7F309kvvg0yq4W4dgFzqhbs9SD6QvLvoDykrWwrcCmEoGYAyuxLljcU69S\nrFKIEjEjTAEDewms3ycDlGiUx7+5ncUt6bcIeB/Mm++6u16G3tQB6jZA2VLi\nzrguZTZ4ZcDV8B4BBkBtm7KoaU7wuCTGZXF5NTyOhPn0dTa3t36vlQWWoBIW\nhmVSiVtMB/92xwxT55yDZ/bhRCJLteq/pgyUc9QbvTou0IbhWvhwm3TQLAGb\n9G2BEB3RxIveKUPfcnYKoalgbvXAerAdKSint1ABgfq0/op8z0bhoCh1s3oL\nVVn7mk85kq6eTi0C1LwVgni/j+3gafiPTLzKoxQT3C/3mpfXbFs/Rlpa325x\nVIWjj0fLwKfj7S85DELpivrLAOv9cwK0hVaHytCgHalUNQhBk5Yib5Tl+V/o\n3nR546BtVG46BF6jj2vJLiV9nAs8dbKsa6+uMLQ8GLkBBmTHc8bB0F3xTccs\nI1PsbunCYa3fXaOQdrLphAfhNzUUCGXTnKc5fboT9JobXfQi/+cWsNNe34KG\nPBC1eYSEm+OD9gI2G7rUvocvdfSe0bs1/dJT6QTU3O7V84KX+IaFXwjVHnBY\nfBv8NzW+w5wntxjNO7rnvvJil0+ArGCaz7ifOj8p6tpKLDqxPUxd0WXsDtUd\nIEMb\r\n=cGO1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvcM2gqpGadrwUcuICZSzEodZiScKFhCLzcZiwG9z4pQIhAKBrgfGAwarA6tQht/RKa/1aVtfm4dXtzSg04UTj/TUK"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.d365409c_1551383063143_0.7306331654263418"},"_hasShrinkwrap":false},"0.18.0-alpha.ed01de77":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.ed01de77","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.ed01de77","dist":{"shasum":"1c4cc7616eb1f40454fe1de0448ca8acc64945e9","integrity":"sha512-rQdLuQ+6/ZmKee0a6Ly4rGyxtDcy8QpPyqCIovu30Srmd1qWUgWboovHTkexdcfW6bHPcKi3njQLBiP0tXghzg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.ed01de77.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceD2/CRA9TVsSAnZWagAAmFYP/2Pn/qXMCFQ7ePge+2K2\nnLQeKRqfnfT1zdRKvBQTcgUwIcZ2LZQtGcwGO4ycCc0mpc5XXmb6pJd3YZb2\nd+Tp6c614KuwSbbYRmLO/T1wGUefvgGErViqULtYdaWTU9kfuLxWGoDK1OGr\nWnIIezJM+qMB9Pdwv+fUHlJjQNhnbVHN5K7H+RGwNWali+bDBYTizUXO9ftX\nvhpsg6Gkln2k98kphZNq1hien9tqaU6QCZX6l4dScfY7EuWmFbjF8EKPaxNr\np3finlMoMWpIxgYuiI5sI0Slj1TJa/4jA4fhqF7QjQlbssWh1WlUAjWGt41w\n9n/Mnl84TANVKVwf7e66XAVGaOlTAxg8gu76CYZZDM50hS/LgnUZ1HhNZXnE\n6X9OyoTURXGs1dhp64AgTeC4We53vt8BowrujmHKGJcJFrvyi7cebKn2DxqQ\nTqWtdWhRAc3qaOikvvhAuVYitOsLpEPpii3BRIZnHxlh1Jv0gQ1Bn6R3Vxt9\n9BT1p9TpkT6GR/bdW5MpDpuHdbzyoQ1ykVqBbZyofcnMzmBe3w8cbO90rOMU\nD9BBD03XCYPxggs0Rp4EdSvFfhDBDy1L/E8J73LXYrijrMvvmcOO8sBaHG6U\nIZumsGryfeUOkjpG8b1IwfG2tzRvCiowI5dr40B+XDQzgPN1Pmk38jomAaax\nEpRO\r\n=OwDS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDN52p6fRCu61dl06uFcTABJFxD6Ib3NHZulRICw8FAbQIhAJhflJjxTJh8XpqFEEw4GUAGzku17DHVoUapr0an5QIa"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.ed01de77_1551383999061_0.2916302249855274"},"_hasShrinkwrap":false},"0.18.0-alpha.c1b52df0":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.c1b52df0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.c1b52df0","dist":{"shasum":"75f9b9d3b68ca9770e0a05d412e2284e39955dbf","integrity":"sha512-0l/+dYK5wZtLqbOlFXYdfZBH2nRvU3lGW/Km2rFePvMt6Ov86dSZUGA+0FUXLZ5mxdkbakIZT/+DX+rgIqL7Zw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.c1b52df0.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceEQbCRA9TVsSAnZWagAA/RkP/3pM+QD0jccxj+AV6rVc\nZ2wZUnxQfIHRmk6b/vY/i4I42t3SMfedKvUhB9ZmH6PMRuGTMv3qgW9reFcL\nEAD0/7vNXdtnUvOvZofN3UHP8lR5mK8vCL+q0qVXfbnJboi50uFsUbTmAWJ8\numVJCoVVuIsHIYeKW01/S6pKFidMJeiaOFGFDuBpR/IfRkX1hO7562aZOIlZ\n+qKABm8Lq46dzHWCDpUQXaFIb7Oqu6sxpXZmNTB19Y0yzbtYcLCegbIjXkbN\n2cAb9dcRAa2yhFCRshBimOEJHYPjIF6MzRrHi2gLEZNwM+r5iw3T/QpxcZlu\nnVWdxAq5VhxdvfjAYv1RJ2MBTqTJQmXkAK/VkOlOs/kDiyGXt05PlNU4yY2n\nha4VfhzqYWc7HQthcLFgnvtSMxWSjhvP4zNP4Y2EKMp08QN6hg+84IUz/ULM\nTuhaUEXZoh/Av6r0d8AxwBqVtPx0snGc+GtC6xlii9VoG8NG1OHRQ0gAWBnh\ntoMkA7yL/kCFALtmPqiTf66ITugj2TKwWHetbZmDRjIlEDEQhPasuHbfeqWC\nl7Jxi7VtO7m4SWf9JIkZ82zkjhY0xqlAdrT/1Abuimvamejoqj4YkD738oO1\nGQIpGs1eAmHlDlWBYQsJSh8YGypsvJ4LCnmwRAh+b6t5H53IC61mzO1Qz3xF\nMAhH\r\n=RoIg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGPBhJ2+eP1GZq6XwjNkDLRt19T7EgO7xHKD+3WYPqvYAiBUO6RzoRmODBlOn23wJpovxDcDnzTnYPKl5NESCGzsKQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.c1b52df0_1551385626537_0.3840953250367287"},"_hasShrinkwrap":false},"0.18.0-alpha.684d4512":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.684d4512","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.684d4512","dist":{"shasum":"1a4c622abf45d66bf402c246c439ed248a632883","integrity":"sha512-uvms7MxZrAEL3sTYn/Rb21rA52oslh+j3nAa2c45pIsPchuYC9nnFpyHzEJDXm3OsFKscNsRvCb60kDZK38qUQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.684d4512.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceIOhCRA9TVsSAnZWagAA/x0P/ivURfeqJl002JpcX2Sy\nX7GJE3vxXVPQul+/jLp29Z5vr2uyCRC5P5EwfUytM1jAzYOue0h08HzptpWt\n84PoVvJe1bQb03dMe3eSHFzV9+KcZYvdXpLDjt6k/g1gUFehZUhm8mXiltrC\nsfSKU7pozyszhg3X4OK/NwBDl5erjIZtBfWHbTBmV3n54luNLwymqzJeB3Uc\n5TJw4WWpEQS8fVfko+ffrI/0MIYm+fO9nmPVF6nHMHOLcRo0DeO8R3mw+xx5\n6qD431VawUWZR0d87v1BW4p/vzephGifYC+843qHqWejBVOjl+bfxwntQvF9\nDygjVeAkBoWyfrnX5F40IXdHwmJmJ7k4HCc5PfRuPI8O7XWsH5Zh81KT3Q+p\n4h/Wg1t7bqv1OITotH6M4NOZDpSHCWRIMYTi+tXj1ci7gXFNhaEJEyeer4k0\nwoqGWkpxnKnBXLrQrurgHUnkB4RFOmXXXjlBNLEPBmCG51uKVguSMi262hf8\n8QTQXZar8XU9Ttrp/pzM5PW+DME2q3TE3pAj/l6vaGDRwVLkConhnBdnxZVE\neqIbbcHUbwgTUpFUr7TuNgakvD6b8zAPHVF3RqPsbuQJ9E3oiD46/iCc02XV\nAT0XVfwJVndTUHIEcW1r21wYdi6W1dq6gHxLiqcXOkf53IY5CroMuGztaDxG\nWgp7\r\n=unDr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDq/mImwFougHFAQ1F37GcU3U5xWOfKZq4bJNM8qikUDgIgTFYF9iDTx8jS1lijSupZXrSEaImiAoUgM0D3Dubqy2U="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.684d4512_1551401888147_0.5303133826210109"},"_hasShrinkwrap":false},"0.18.0-alpha.2ae25559":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.2ae25559","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.2ae25559","dist":{"shasum":"b3b87c47077a0104806c30125e416b916f0e85ca","integrity":"sha512-1STAWDVsMfErY8EOJHYVJ6YGURXunpAOqVYn7p4GMlUb+PYoNwc2DZIXOvwKZKgVrcfLt9rCzPnIoFhujs3nbQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.2ae25559.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceIOxCRA9TVsSAnZWagAASVUQAJA6NGfAQrqoc0Zse/wB\nVEHAmwJNC3x026nn+HTx3mALrvBmEVM/c9ax6i7atOm0AdRiJZSe/VuC+Zs6\nAZPULps0nFaBOR+EmqEVHIC8qjiXb4+jt8wvRiTN/ytY8bdEcPRu64WD5xN2\nZMAyjXLPLFybd4+uWHfpPASBI6Gdnd8e4ImQYj4NC9brcl/yo7ZwL2HG2foe\nTQx7B9iWZemixtm9PYuc3M08kOszB3hM9tEE7jMUN0lrqXfRUr++qWoL7XGo\nqw/RB3xlVofchaMKMsLBsEU8zP7IugTm5SDAAfIe5ajccpcAJD1pcJLlCMNv\n8zeLHJMDIvUMg6pk/wAHcnPp22C/un1YyQ2isZ8w1YOYgndQLiisk8VbkY+Q\nJiWkb6RPAtbm8g7969cVOoF+AMAe4gi/K8eO8lwb/3wrLro+kj8nXApfCbu9\nPq1y8kZrzf6Fr7HbSFJWfutzTy5Li6WYjcdAyl7+ba+ZR2XMUAmy+HbdHxvM\ndx6C8U9juNP6iyeoDfsHEXmmgNIE0b0J1P3n202Pwt1dHeT24W0xus1Yw5j2\nfbpaaZ3Lxs24yfD5FZqHk1ErhyHmzHM2jVsUjVFr4bhKJaZA4V6LHdaQ+J28\nh05/OKBNnexD+HCrSo4oAGQc9n9WrSZXLBkdJpKpzvtl5jlQ/LtSYeg1LAWh\nuwVa\r\n=4Sld\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID4uBsf2dD3Ktom8eyWX3mcNQS+jDhUHfgNQbhJgE1sBAiBdBjuPYKlJzkvkPGZG3gGDEMxBqLwYpFZ86aE+uEXrOA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.2ae25559_1551401905040_0.3209902766316701"},"_hasShrinkwrap":false},"0.18.0-alpha.4989b6c8":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.4989b6c8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.4989b6c8","dist":{"shasum":"c808d438fa8d9503d81571f08ad51f9388ed37cb","integrity":"sha512-f/3SLlPLWFUuCb0t5bmULIpzUXf8UyGxs+YRouU4SfgkBkh9K2LxLcvxBqfycSHQ3o/H3krciDpKoVmIEVwf1g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.4989b6c8.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceJuHCRA9TVsSAnZWagAAD8QP/jWMUK2kKhGWBJ5jOR7C\nv+K7lpQIzD1glnL0j05P0gzF/+RG6nRoilA72HMx5AUUaZtqhDefhHWqewqS\nWAVik9JTVzWC5On6kE5TLEM9Itt0ffTpv1EbVfNfG27daeDwVOvLSBdm9gf1\nscinLcyKxVSCoJWRm++eqShbU5hN6ME5pFzWCIfjPnBC4fohcBQH2MLjgY8i\nxAeDcv1zavo036TdMSjC3EsTq1cZuZmr7wjzyg8BkzCvyZheim8AoiA0CWqa\nHbxxRMRxiaqXucTOIZAQO95by4a8BZJ0/Lv5qZvC/Xf7DRQQ6EJPZgThWInk\nO/Ue35YLI2OnmkRVb2JEQPby/OvkZ2+NTbMuJxCIYdxtCBUVScx+JX5dUQT+\nFKtfiPeVXj7TxGr762uydpKJ+AKkN/9HZcrMNrKG9A7oP/z4gq0xBbD8twSe\nHb3L1kSMNzPty3UY+PC/5VJW3uVaXGG054rpOd1Vrz+qt1wg3SOgZJD36ttn\n115bmR3JiinCRfckIEqUXoh6DrVpeKyc6Ha9I6fNxgTlBCjuRM8ba48oYB6h\nmz3u7cXdnienEyeVsgpXKKBHm5IOdyxSK1DxFQHYEUtUhVYvuhCvu/r8hwhb\nfiRZNAY96tnWhmw74aAeFQYERi0Xhqw9CLy87XFA3i9GsPwX4QtZGCMGp/W3\ndVzm\r\n=qgrT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCaUxPg454gNJOuUXG8X9cd4sPx3BYoVja8m15gPXfJyQIhAKSqEMcnvBbPqp3nbJHGIT93kbzdhG74p5nEkDC+OjAy"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.4989b6c8_1551408006504_0.18270412470873687"},"_hasShrinkwrap":false},"0.18.0-alpha.3b7978b7":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.3b7978b7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.3b7978b7","dist":{"shasum":"6158d5912aac834221a9cf66929b1b8e8c8c9da3","integrity":"sha512-eJTn9LVD95BCgHEx6szpn8Khuo7mPaTKWn61+W73YJYgujSd//OUeK7db7Wz4CKkhX/xQHb98S0EfmnKUJQY3A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.3b7978b7.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceKRuCRA9TVsSAnZWagAAXKMP/i7cZ9wLdHKO7+Fpr65P\nB29PD1yxQ3GOynZMEbS7OhGR/OtstNQg7QxFB3FpCcsj/yZo6PvFrO6nGSMt\nn9mD2D8vIgfIGggDTO7gV5km/f0qlq0ZkYohioG2+kX3sDXAp/OtZK3NOtoc\nSNIL4CEWUn7WLWQ6kyZLTAB+b9R0InlsYmIVpBYNqf5I9MRpaXAbXmT1Zndk\nnI4jjvx6ywkTiQg36SeHK6/xqcib1nWSh7xfvGhYRudi5n3bhj2uIuKIqb7u\nOywSGP5Mm8+zaNvczej/XbnSs8H9W2MfcPKRNVdPYH9uO6DS/KOqmHpyMSwk\nkS7tr7eyU4Hzuv0fcT/7m/v/rqLkMg5dt4/dKEbJjYCnQavLn2pyUfLRCjqq\nJw/vx3VUiRQp50Kt41ZuCt/+7MYH+mPZZpqcYJOUQyjgdyUZry9URVfXTfM9\ny0cZq68ER7jVc8Ux4dSO/Alrjemur4SyNqlkPU27aNovxIOX9xcWJC0UjKZ8\nHxIlXLI19KKK21cCAvWlngJ8J1JYRpJOl5UHdtnfwmeMn/mQlajeN2NoXQpl\nyqq5bglBHrXGxkRjtw25Q7EHWdo/zJJf42w+Wb4aCsE9aUJNmBpJ/gG0GEuk\ndXQVgkjpRsmsm41hsTSqgkia8jVfEZrGMnvWPePd6SisEPOAfkHH/yALYFuY\nbgR+\r\n=WnRr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBJTIprXrKCCR4cPU0DxhoI1OhGZ6wLeNC/Mlk6Pu2mtAiEAwJgJ5l+fbhnihy/adIDBnJDScSmO64zhquWPrOGSfZ0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.3b7978b7_1551410285568_0.5830540342671153"},"_hasShrinkwrap":false},"0.18.0-alpha.97c04650":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.97c04650","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.97c04650","dist":{"shasum":"0b1d02e659f9eebf5a87c60c6c8a7480d3c16d78","integrity":"sha512-As4Ax00EaL63ZbBqr8PkybM/PDnYr2Hi7ToDJb6mvZj+hNihRhTOa/jWwlozm3NJpO6WQX773SJbwlz0Ay84zQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.97c04650.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcePH9CRA9TVsSAnZWagAAZ94P/3/U9GVv9ZeHZsOveYxV\nlizEKMk6sqO1H5eYjW6wuT6iYlbbF7ov0bFCG0o0ox1Y582eTVPltREI0fQn\n0UN4oMEvOyR+h+3E6e4Bx9ZADWlfQUfOPviPwGwo3rp1gv5xNFeG/f26qzIj\nqzy0g+uSxAlnEpc9aeVp5QYfgIbbnR+vjePQbDki296v8fCxtGdOp5+fNmfT\n+BdLn7qgC3oGma1cr9pgNE0F96tWwcWV3nU1Moty09WsGRJ3M6NhpGpSGiRR\ngPV0Z/C3rHmDOprK4navSzPEUVzGBps1tQrA8bmxuasGseA2ExHcVLUnigCB\nYVALwHGYyg6a+LlMeqwoUuCgC9GjwGsSFT4QN3qWgi0XsOro+uxtpQhKeZN7\n1oNQ957uxN9ep/yMyIt1dVQDpYg8m96Jfe1EeUc7OIij/KpsoqJJl7sOP1dX\nHzo1LQ/I8Yn6OVoq3AKILn9eKuHWDNIzgFUmjGt7mSO6/VM4VMYhVgvll9qS\nESYGxGygNEt3mTScWzdsUZ5rLHAgd6lfOsgUwXM6JrZQICjGs0/I4Aucbv7z\nIr1U153oKmA1IcHJt6384RFXbJ1qswSqF715xRSO90mujQfYrXVXPiSfJcHJ\ng75JiDGkgApXGfn8I98S2/1rZtskD6BTMX/b7IJHpz3gphTmKYbdBqhzsMti\nNKtu\r\n=ejES\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGGK2DAB0v2Y8W9GrOjUSx7eh5xY4U6zXVav3hrWZg73AiAnv17gBDQ0sU1ZXwEo4W1QkgUI9ejgphOsRclePH1SWQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.97c04650_1551430140852_0.1553448817716454"},"_hasShrinkwrap":false},"0.18.0-alpha.9f09e048":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.9f09e048","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.9f09e048","dist":{"shasum":"6418080e726b4a4ce394f5b0305b53749f4e72cb","integrity":"sha512-zFvl0ARyRPxcrtaXKitRiUgL0RGga38TNarElLynIk15hzBVvG/aHmMuEImROm6HPXHYfemjIlPAGB7DZrw3sA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.9f09e048.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcePI1CRA9TVsSAnZWagAALvMP/jnLAUPTaftiKUKkgQWO\nR1m/AXgC2/I36exJE++6DcuNcLa+Qfpg9UG8ub3ofyy+pLZW4qkIFpZ9TVs8\nX+HfZqtbM3U3u5O9pR3JVoCYQu8wAxVJIY5QdwZ+fPXStvv7FyV2JD3Sy9ky\ncMsLHWCYuRYIyA/akXBYCk3EteAT3FlweWdc0tObl0yf2+v9NBGfWhEBLBJq\nvloG433ELRAGL7/CqsN3Oam43vt0Sb6fvO7N49LzQ9Wiy+DToiJp6pQ2mvXy\nXkJJ1KQ+VPevvaRyRSwcuVRRHUGPEHR+PlCbR9dETVdC8pKwQy5Z7gVUqF6w\nLjwc7Z6JusUZo4+qGrIH5bjMWrPykFNKZ/kSk2QhMaKNyUljbFyybOpRmVhL\nQKQ1TPnc8qIOW4hg5evh5e9QYGeZrR6omZncJVnbkP8xMPW9oSxCOKZNAH4i\ntZw4rD9fffUL0uOG/APzYYvZeFPXvaoLohmjQeBlXb4YlPhzTIwfrAV/Nn9D\nY2NQgA8nrQx5AfIiKvyd6Z+FWJbZIqV6XtUwullc0InIw3hGd/VtejrieaKh\ntXdkU9qa84Q74Jhujn6ds3nrfqAx74qJ+S1D2PY0aizAJS0QA8EYApzE0E6W\n3SNTdusQTHacnIw6TeG5575EMfjJ1i/L6OUnOk63n6OsGpjRlsJJvGMnpMuA\n3422\r\n=maZd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCsUYUEmlbij+xx65dTJpp3onZn9QBVIIOqOJsTgVnUQIhAI5jdsZQcf6GvIq3erCB0bBg3XYspU/y3SQVxn8Z7bps"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.9f09e048_1551430196231_0.844709374181341"},"_hasShrinkwrap":false},"0.18.0-alpha.46d48b11":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.46d48b11","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.46d48b11","dist":{"shasum":"409e5d71f19ecd4a8a6eeb41f0860db8c9824bc6","integrity":"sha512-NYL8HLdHwVGmr2VetqrhtEory4M0eG/9pALIRBSLAq35XrNhms1YTOLhUg9NZWB22pKaaJSpYP6dMT4hQd6ksw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.46d48b11.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcePJGCRA9TVsSAnZWagAA8PUP/A2012JHJvyCksrUvD+G\n5lroUujsuBXaXNnt2qfm/a8uJFCmOT0NlOX/WHUjs0ImtDVACqjmCVhEnmcc\nIKzS70D8hNubHB+gAYGgrKcx/XNWQtrcCkFSY0dQBq+7Aqmj5kaenUWVLfPW\nw0CMTXRcDfltmZLy0oZCivNTZ666Iz0CiA/mBfY/AsDLMaIildjHtPNCH3jG\n+V1+1wc7U2KGMXEe5UsY2PI8IhhFlxHp1L1uIW9zD5OCmgj0qJ4hBNWto0wA\n/qC2tg++Nfy4mKMnylcpTjTfx6SElaY77Kn7MUhe+TpcqoMy2NNRQuVmqmtY\n63jsjdwh8dSVWceSI/m5A8B8oxTUhiUOqSGtn2jkOQkgYS4fkxtB7oGdoewR\n1gaWet1gDvUK/UPogLIZp9BaWxQP6fy/lB3MmvLuVHzFq74rHu7JZaVzebtO\neUf66oi1UGxmhn2k+CoeFlctgUGtm6Q7bMEizH6lelGOLNCmKoEWOGx9lKI5\nML+/t26kfbL1rTZK8g9PR1y9Iu900DSb5EuRIWw4/C0DEc9sTx3/ZO6Lbkqc\n+AozwpGTeDUxnw8/k1Q1zRwxR78MIXWeYTFkViWMtm7c5p7K7DnzPCFvOYKb\npYjlD1f02VloEYcytFqxzcZVuBgseHK5uhG7qpIQP/toPSu62/pe40Ykgv/e\nfSFE\r\n=vaRf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDnIbCVwu20SJnhIBpl62NCSxkk3gBOOuI+khsIz96utAiEAtY3QmsmedIEnCEmhE2t7j8/Bepj9Ti28c+ktrXWxePY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.46d48b11_1551430213396_0.5963035200737812"},"_hasShrinkwrap":false},"0.18.0-alpha.c8fe1b4e":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.c8fe1b4e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.c8fe1b4e","dist":{"shasum":"061389db16f9a6343370400e61a7abac32a886b3","integrity":"sha512-13QuEDBhBPr+S3R2Yu6nMZfjRPzeFCgmD0fhGEruyjvRyLEM2sOwfcctWH4WHqbL5piP7dZKgCwunHznYi7ycA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.c8fe1b4e.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcePLXCRA9TVsSAnZWagAA3lEP/1xQSSSFlgY3fKVPLZeF\nqaIna0BgxWhJrrlGHyJmj2RJ/ukeNmOQArqq2D/SKGm3cqgqZjQy3erKNRtA\noGguZQSXIDo2bDlbuKIoHUqQG18B3qXbeX1eM2FfxlaC6RzwG51uA2/UMO3h\nkzf6y1ZTXFt3Ctnz6ggFFwfua3hMRatstW/d78/+ScnfhEuX1sKwLWIICi+L\nkZuWtceHasi2wb4VNoVVZt7j8znt1IC1wzI/gse1VJE1vsI/dFWVV+ni78K9\n2uBPiJXRvjuXf+KSvB1jIAv6C/pQpTUZ8uilGQjzrUF6VBYh7DNPaWvb3+GO\nlw4yTwisi2+ULTBAsHUqxFfqvwQzqAdtUZs/5Y+B5XdFeV8YIitnnXUgi7xu\n4hrOwL5WZbF7drvM/A3ruwA63oN6sXQ0TehwlIRnCtzK/Iv/TwaKeFq6kVP1\nCAwdfQVNOFTSN/yZk1pR/vJh9FYIFyMoHpjkknPeZw0SwlPEQ09B1TxGy7rf\nQqn7fKVmEexGhapZV6Z5P2uscJWMvRWLrO7ovwn0JjAys8gTfXYqgT3seM2I\niFMApYx3yFz4eHpThdOT/wk4CyMathSBDJn7AsELahSXQNdmZFqB4h94hM4C\nZSqDR6gwrdCa3FXBRk5MAKUnO79QbeyPOUlo8AVIeMKqiSWwVhHzooChJkWD\n7Uph\r\n=MH80\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1ifeBuLRc18F52Qt/+hA8z8TSuZypNECUYl6qrnfLQwIhAPeSJD1ISi1ecq1xazehdZxqYS/ZZDs3xVKK3ji525Cj"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.c8fe1b4e_1551430358262_0.03616519858560374"},"_hasShrinkwrap":false},"0.18.0-alpha.3626921c":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.3626921c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.3626921c","dist":{"shasum":"919f4389eb08ae85b990b0175e7acaf491d000fd","integrity":"sha512-z+ClVp2nynmys7wTz0XMbnXWWTN5RjzSXz8iPasHoAHj30geBdqxag/6X2FtITYdYYtaHlHn6NGhoOs9rcZbZA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.3626921c.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceQHuCRA9TVsSAnZWagAAJpYP/3Omwpn/qf8Bk7jX2hdj\nCFvfsb+FIsgpDFM9cK0gVefkq29LA8X4eNz5rx0dNzv479Td4O7S0RmR/tcn\nJprcDmiphouN88kRcdisGghrlcwrXOsPplAFpGD3GjUnapVwbfIo/57t/sd7\ng+9K+79mg586UqmjlOjFCUA2rgGp7cquTVXbYSfmqsvfvB0B7B6zFGl0qNOX\nVcOIWE2LKj8aSOlJPrw8eaimdVZvkkOo2KkSz5zDiCgKCM83pHMnWz3IYTS2\nsXmoNU6D0VFw+FSgTnYz3LyBMTBJMvOnqrEk2Yyd/6XhpyL19SG+YG9ODaft\n8YJimFCKjFtiCPvyuJOa6B5eqLHTi5jMNzwgT02Z/uS3vYgsiAA53SioKJj2\ncWbq6W+hiJ3/napWBLVpuoeCC8J2B8P2dl3mdBf3jXlZeEC8OYAljp6QYIqv\ntscZw3Ufni4lVQajc+pnEmGT8rF0hqPotitXJfWYLPo0mBuFYWiKiMlSgxFG\nhtz615l//syp+dDmkuhQNrNAwrjb6ojGu3WSAhLMWvagNs9czEHwZv1EgRJF\nHoSUxn0wK2THbJifv+rLVWU/C6hdgkfOLikmJzdD9njpTHR8DxgyOSAk1bN8\nI1tQP4S56muIWeSBDTMcPDl64kx+NCCQuEWhTEkphY+A24xryDIJPx8IoNFR\nL9iZ\r\n=95wT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHnfODA1AZVoZf2ln1vraWyLsn6a/JwGyvIKtxvdINvHAiEAiCMKHhU3e9i7drZ5cuMOs6tafAxtxkBkVIAmA8VBwOo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.3626921c_1551434222097_0.5933314511350374"},"_hasShrinkwrap":false},"0.18.0-alpha.0a2f5006":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.0a2f5006","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.0a2f5006","dist":{"shasum":"ad8c32c074a8327cee62a655d4bb3a2e9d23ba3f","integrity":"sha512-mZoq/BDM7+aBgQr+5RgpZwJwRSNQ88itpe9x6GdkEcgrI1NtYTQiAbWyxLaPvwQO30G7LTDCsCJn7qlVHoBJ8w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.0a2f5006.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceQH/CRA9TVsSAnZWagAA/VsP/RCIw1anlR8gMCOxfYeZ\nh4+8kpwd4SMA1Bl3c3Ox8nUNA33Jtrq4ee9hynZ9ULOvzKqW+FEE51VSJjts\nYN1HlffGW2iwheGSaXXmk/jv/iphxcvfjVSY3drS7AFDb1ePVIbOu24HghKI\n98TucBbEOExvsJ/BeyX/NG/7BlOgudB4gjD8cLwu+OKegjFkDhz+zS0hfnlQ\nsRhKcAQG37vHvzWOR0xE3nOzuqHPCrdcoK8+yVtmZA1Sja1JyIr0/0q222ZC\njNbXwUoc/rjdFsOLvPgdTmpgMVyPABgvPO6jMLQK+d5bSs6e3zcjPjshfIf6\nguNh95dIOFnoRtNMGxRTuH3KQzqFUy5Ai2IYa9UeObKCFRofRS41cFhPdsgE\naaCdDFCf2KUFiE38kUy1XDDMvwt3j3W6A2ezyb/DY3q2ZByI7RG6VfyBKA/e\naPT7TNE+9nRwnDQNvLOMUI3pVoeMb99UAPJehH1Vw4RSqehUj79sw7SKiz4N\nDynV756u3+FCGPH9vazKjy19syMs8Wc2XGbUC9/dguKjHJDEbE4k0jBx0/5F\nj4RR3b5OOKIEJRoUnyaeYBzagIFbOsUqb+gTp1kxvVn8F8mDr94zpMMo1kfW\n8NUTbRFePC0FDBTeFEiykXY3TjdRNvv+mxYjTZvurwRGpRnHrLHo7O4XvQtV\nL70g\r\n=z5Xz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCH3RXMrIJ7Mm01HfUwCzdMh2uLBSc50BG/IqzuhCaTZICIQC1adHj9kdLNmwj7DLcz9mUbd3pk6o/0N6F5DtnRJXXww=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.0a2f5006_1551434239337_0.901711469486481"},"_hasShrinkwrap":false},"0.18.0-alpha.03e18d38":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.03e18d38","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.03e18d38","dist":{"shasum":"c386fb125d8a64e54103492ee96e7dd40b297e69","integrity":"sha512-DsRBoSPvT+VB2/tFPDlSx2k8KlTCEe6y5YX4QQ5HkGU4UVduPpUIsA6sJEjsQxKBMdzXbx5UbiTZSMWMu8p4Ug==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.03e18d38.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceQIPCRA9TVsSAnZWagAAK+sQAIDU5CiBdmY20oqIxqiw\nYXlpykCw8XKCKRLiChtQC7SfIQBVu/eUXWKnf+r5tthsRyQ0sd4fsayRaCQ4\nnXdy9NLUybAvtXo9lkJ/aghrro4jGz2uIHwR9D9j4Vr8uUb13xWrZ97hF+fg\n9tHwggGCNsUYDbsZX4bOPCGxEQF1lOTZ8UHwh12aknp0n7FytblZKbi52sR7\nNKCKAAdGF2NVXl8ZZABWrZZC5ZWpZBmKXdY77Q2S2lNz9Ik1OmxYa6YZqtSx\nrFnuTKI9n62o1JQdvOvagTtrm6S4qzKp4K0dQ61xL+q0RzR4aJMskmdd73wO\nsNXuESsb2C9TsojBv9ciLHwotBN/Hn6uv2JdBTMyOZThjysFNvyZFfMYbFDR\n2CvfkFRZDiAf0F7/Aiw08f6fSwQVOK7ib7UT7agtULqa11CWnJVqbIn039CJ\n5fLVWOIOJvzPrp/MX9vV3AaoME7zYpeptcT6FgtR/b8qELypz9wFJ3NOpsm6\nCxFHe07xRgAY9OZomgAbqu1xPHiH45kUQB8o1gAuLj6y8i4/WU5T8LqBXS23\naOqAibar4ZhHNOE9YsGBSSWvTheIymjzBXxUEL/t+1sWZGrihVId2PCf4xHy\nwk/02vPn/aViX8mD3BM/a108gz2iXhdmvnAWu+N9xzKpY2SdpjiZfJaTES5J\n7cS7\r\n=eRdX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDX1Sg9JtXJiVSlkixTh5mqLh049dPyQbWUVNKwTUktRAiBRx79qPBsGTLNUPZ3HMDXLgLqwX3D0iENlo1yzC/pIOg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.03e18d38_1551434254336_0.3723630932140387"},"_hasShrinkwrap":false},"0.18.0-alpha.a6c71b8d":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.a6c71b8d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.a6c71b8d","dist":{"shasum":"da9f851592e36a45d5775a105ccdbc712899aba5","integrity":"sha512-9lyVwCqvA447P6q+p/TG4tMWCn3EI9FEDbidGNbmDsxdQdtXI+UZzUdkoi+5Umys2R+50B5d3DKvlkO3M/89Lw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.a6c71b8d.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceQJzCRA9TVsSAnZWagAA/7cP/3S+CHH4xN+Ucm09/Ntm\n2cyjEk9NRCBFptqkbnY/H5p/rCdM9+GqGHKQo3fcx2i8b7oJ5JFIVD1azzvv\nzgL0pzNFupU20qI2aVkfpBr5n4h0kZonzmTYkhYbvktyaLISmf47wJuEW9GN\ncSY8TURLF0ch/dqQ8MX/aWxu7mTk6vf/Y5zCaavP8I8y0J7+SnV978Bf83dr\nlj8S99YxcgzZAWSKoGbnuDThFNEejwkJR9XJ+1o2Ef83X2kJvLHCMhtk7Fbz\nPkCap7H6dq0LCK8zYmgVmbQ8dZFZEua/HDiNT+ABrpmiMo10PtooYCgpaM4f\nwMZl7ix/8ANVEZSx9AsrP+/wtSlJPceGBzQXoWYG5LBF6p3SELbQWvY1vS8k\ncxdRb7FH3q0G1ql3RvW49axUlHF+JP16uykR9ju7FhTH/obOpkv2LVCPQPsG\nXKbOuqc0ihhoNG2uBV8Ip22jbpo0olaJqZBnkDeSEUoDFcDq5ElzUzA0xZWy\nuOQ+CCZuo6OLwGreA5XH6b4f1a1f8vTocpL/GEX5kPP5i4U2NENEVHCKCrad\nFQK1R/DYZ4K5pSDPs+niFh9RKryvtoGbl5ND5RnXNc0zxybQU5Vgrx1NsAQI\ncizQYYP5Jpl/pXld7EN4AmkdYoRvSHm4mLH/txwGLPU0p+P0RdaBVmUhOxZi\n786g\r\n=JnoQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIADb5QRpyeO+1Ivo8IL+ZIqCu+gsS93+frXKN9MO1Kc0AiEA1NDYO3TvKR+0ObnTMjog1G7jg6TAci6YCpzsoL/fTy4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.a6c71b8d_1551434354700_0.09453105224199532"},"_hasShrinkwrap":false},"0.18.0-alpha.40c38b21":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.40c38b21","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.40c38b21","dist":{"shasum":"45e52fb0dc7d41a2af14e2475442ad9390f2f6a5","integrity":"sha512-z4RNEEZRmR4fhKMsEeYUCiQ/qoyvnoX/lmKSRP4nM928Jxh0ybKNPanfm133CzKBQS2z9c/GMhDiHDeJMRGuXw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.40c38b21.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceQNfCRA9TVsSAnZWagAAVmUP/AzZ5Zm8ceOsrmATV/rc\nZpe4WhwaATjLeKygUnlr64VFIhiTzuIAJN7lVF2eRbGekb3bVpRA/oRrJV8g\n+x/Tgur2iuZanp8XiOZn4u1xjXle8trOBuLZP2LB+VtrWWMygKhPzjOStKft\nuBQF+VIdGdV6NU0wFAHaaMLOr4Yj3yJFmuQVx4i9nAvP6SkavuyWESGuP0SC\n82iFRETw6nfbWtbWxgPMOxl9QJcD6k+L8fm/DLd0nKdiMZrB2Cu9e0LP3NDp\ncRqXWNo5+1uVzzws4uc2rxxIfFodcwViRNsG8Z1X+sE0bI6nVY1a+fPpe+fZ\nIzK9p7tevE9tfF9qXdWnnIcwJi4Imi3iWTwAPPj+pHjep33vrdGvVuxC2zDk\nrKrbd+hHJ5rsPM2L1Y2a5S7WI9vVc3xcfos9LydDSf1sTYZnlK+j3ELC6Gkk\nHL1INTT0gpdiK+ycCccOsCdffJDKAmdWSnUIdmxW8Q75YkaB/hsOzStTcGGF\nvNv2yc0wG8sYHntr39FGG8vv0vOCNi4B+tAeB6ckvIsn0DVjyg51gB/RSrf1\nuf5yMSZfZq0ArxtfnbliXjuNTfAG1Q8/lKO4GDWXHSIF7nIZuvGht3f9Kucb\nTEkm2VNnXA0gBGCaoTYJfuXEmOJaLkZPlrxUI5KQx7+pKFPYf/BFiKgXPeRZ\nzabk\r\n=yiDd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD79+gbG++kfSWh9z3rJ+ZjMrvHCV0YmwGp3mRllmJhnAIhAOtGMHPqZfb5K7pju3cKdox3dZnf9sfh9QspCsk2+UAS"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.40c38b21_1551434590580_0.13020985194733248"},"_hasShrinkwrap":false},"0.18.0-alpha.31aed16b":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.31aed16b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.31aed16b","dist":{"shasum":"3cccc50085a2c171db9701b61f61dba55802c36a","integrity":"sha512-AjoZ68xDbH1of7Lm/OYNHHjiVN2NTVSc6cG364G9b8JOhzRiefzYjtJYWcnCyIU8xp3x3G98LCY/LXIjq7yPAw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.31aed16b.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceQTjCRA9TVsSAnZWagAA0UwP/im+GPU75IYZNbxpBhOT\niWIQzMpiTN2+QwBC39PNb0xAFfF7P2CY94eoixxX1bm60jadE8zUV6Toq64n\n3zSwdirBvfatwmmVIb12OenbJpXlnmPavScKsGsI8e7/T7xkg/FNqzzptd+4\nlapuHJA2Li0Rf6KSsurZASXCeEDHoR1+HsEcCxRCnno/Ol9rayzz/ShmmMZy\nR5t39V/Q10giPd2aOBJPA4krp5xDRoGL4bTFjjHG572MTJtu6Gub/zWzQ0GN\ndaqfnyL7V8ndhCZWdsIA0CY2gCyW6Sk5do6sOGQUgSEKAcu2ExWESPXdwcMV\n4mIKPuB6+x5an3ykwWRjhTifDhTsNgmPW8kLoG/buA1TMRYatpHwZwbZvRtt\n+Asfaf9m1+Szo7xT9ytFN9vs/B/EskCLguwvofRf9e32cjYaiR1qsqBAC4I8\nS3gystd+1ZbJztwq9JE9559UEPC3tec0KCdehGKsPbQJD182cTKP6bNgG6i/\nE1QIky+VT6E4+i68jlUijJUj2df+r5begl9LmMPCEum3LiNZjXxtQF4IDR3q\nzRE/bSvVzuzhEjn+hkb0s1ZXtdU/Pxzl+GUj0AmDJ4o+ousQoncdofDhNTwt\nO9yxjaV1MBujGzsfTtDe4ZgpdPt3CGXBxLU8+OMn/sl4st2MLRwhPCpn1wR2\n/9qA\r\n=xgkj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFyvzMiHS1L7vohFkB34+jxgBX5fwfdgcT3fPOduZ5lwIgEuc2GucaKzSixlnSUWFIZE/EAwFj3FJFRUJaHeR+Rsk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.31aed16b_1551434978507_0.5252831447220436"},"_hasShrinkwrap":false},"0.18.0":{"name":"codegen-templates-scripts","version":"0.18.0","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0","dist":{"shasum":"508be7635352be6dea16e82ed2950ce737da73ca","integrity":"sha512-K5FFvPqhtbGS9aOueKSTEAB6Q2zfXl1aqh0zLjiKCLuIX0yMRGifE2kTSYM5uHShzYfZE/nMQ+Sdiv12a0kPaQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0.tgz","fileCount":17,"unpackedSize":15987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceQeyCRA9TVsSAnZWagAADNsP/3D0cuvwnMptB1bLZA+r\nf7EwfP7S4MDWVDHnA9asbsyUlYJ6nG2QO6LcxPLRRTinZE7BJ/U31RR03Rmw\nLUisDLu/NASxS1kK0XpV7wBYF3Zb1h5x206hKt+Jx4Jm/s7RbkzDuniEpV6d\nVa89OR8cC0FqY+BVmapB49mGDkSPwtPsPPfkGaYunds/aFDH9x8MkvMI9Jet\nDzktnkr7LjAPIKH0X4RSA6DEhP+jd8kO5/h+IZXTjjW85ciVgRVaLGYU3pci\nLwBOniY4gG8zawIXs3bHe9qHygINx41A+cxBWQn1ulAaMeMjwd4livg0CDPr\nSbLFr/mhIiz6iww/02vL05iBYHOZ1dUv+qRZuETWwKhofFMI049J8yuZBlCR\nu84Dl1lP4RKztUS8bL4IZGDksVBC1O4teNX4OW5ttfHFnXmWhrvSxDwD3zpV\niJTaTTwVNpWIKkYOLEmrhCMPfmmMj0WZy+w8SGuyA4eNBsS4ps+UznsPvP1I\n2n1hYQS3tqbCVvwB/kwtR5W0/jqI4DqzwrLj/sTXcXDSwXwMS9GbpvIapjz2\nOcMxUfDiKGY9edrB5bNosygFzP1m+TX+luzhupgrncC/IfEKHvPNMmGsIO2Y\nghMKx9jq/ZcnbS2WGAy7KpLQi6l12MXK+/DcWcqIj26hSsh4gCbWmC6wx93L\n9nH6\r\n=e++k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFffgLMtFvbxIRoVCPhCywLBQuqsvRsyn1jpM2DE73+TAiAy1uZR0kUJLiLbzR/kJrcKpYpFJlmnCxIMqFvDlRAtVw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0_1551435698122_0.7230223363186716"},"_hasShrinkwrap":false},"0.19.0-alpha.71e6396c":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.71e6396c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.71e6396c","dist":{"shasum":"b1b38dbc949c5c2bc4f1fb9a4c997f27706fb808","integrity":"sha512-7ckQmyzXjXeLTumNb1NFRb5KyvEWdIXkods6PMv+WFotdlR1o1hzJFVLKno8Of4Zp9AKKZwuprwNZZDao43aOQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.71e6396c.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceQldCRA9TVsSAnZWagAAbCkP/3gJR+UFsV33XCkUG5Sr\nVw9q1JsyAlXwwsQ8Tvlc8EKa3kJdtKuG/hOP/6n95nTx31P2fUB+u6t1mBnV\nAjUHAx72chaXQwRhzA8WWEZPY6idFJ7Uy9+BZeGXMUZFrqni/S5RDWmBjN2D\n4u5v8ZdTK/LpvLUDSM79frYFmxyf/FpFD/wj1BfHs/bxM0iwlAVQGHig+Q2c\nI/ls+Qoxra1QOtsR0x+rTdunYinhFNn2pVG0HAz0yaYmjW3ZnpnkQ6GsM7L5\nTyeVNHKLPM5ywuPILIjwYUcZNRqpXz2YKmUmByOSE61du1yBQ9yysSR2o71N\n+KbScMmbF7gDurTxY9MTGy1xSqXZeYs55WIknLtn/+GXOKLbJujpB6GRzU+J\ntF16tmzP6RUvCv1OG6Tmp/2OTU1yFi8MlxN0Eq5sPWaCAjeeE5N2banhLQ7h\nye2Q64aPGOgCMDxjx7qoNE6UcpGlqEZ9ExPq4iUtdqByD/V3PFWxKjLIMYj4\nB8cnGkWOSYxnio0yjyfvPN6AprIoBjQ8tgbgOy5nLAlDbwyUooJF1U5KVzMn\nvo6G3DlKnGX8Mfr9HwMUbC4rSuTXJKZc879pblnK4EAxVZG8l0KrlgST7Vvf\nXGxuJKRRzFDgb6r3X6JMji+rilgVHe9b8SgV7VuQgVZv0P/IGGXuP//msY1I\npEao\r\n=HKF4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAPf4MJ48Xy97NClkpWeScqGoftb+q6xqjvpQ4aFpbFiAiEA54tJRgNq0GaUYiHkON5aj3zCqH6TAnMQuA1JejDuxic="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.71e6396c_1551436125208_0.5323052720499835"},"_hasShrinkwrap":false},"0.19.0-alpha.2249ff45":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.2249ff45","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.2249ff45","dist":{"shasum":"21ae4630d25e0d5cd8d42b1f6b7222b5fa9382af","integrity":"sha512-20HWpuakOq4Uq5w+pZPqkz3/AY/9EPF0TxehTVVPewXcYJ88gTbYdxhd44dzRiFj1wCxM4Tnz2VtZ86ZZmw8qw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.2249ff45.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceQ5pCRA9TVsSAnZWagAAUA8P/Rmy/+SQUKvWXVvGK4jz\nBNAx1ShGZvkAPOQCypSxjluIqzodM4/xgzNnJjvxxTpGOUYfshPCiCwDDi1S\nFiEr8GooqrZ8XnlteZaFPWPa1tcOJFPByNc3MxX1zBC8GzXgm2Lin6Jo4vdl\nQZNAyuEyvx4szIZQAsrjTOj1F6qyCYAFbQCTHn6o638Jd2G9/479AjNQzwfi\nZtTfJR59ddsfmbt+1IrmQAZFIf8Nn6G0ECpRiFxab+CjQFVw3MySLySvxu5O\nNFakLScFF64xkJ+DEOHPLpsssEeSXx6HrHA7fXJZ2LygYqEEjHmBjOnsND9D\nErd83uWw57U1WyNkmdUYBLL+MyfMXwuBmkupXgHIyeRh74isSNdVRY/SwoSD\nEb05xgJej20kilTn4sR6UgOnPOlTzBYaz/ubQyd1Vi1dLIwU1ergCcaHsF4G\nNwaozhhx3/GBF+h4SUquZ5wwLHw58QD9BkWz5zeNJf8whbo8HF/rhvrGs8Dp\nttZ39/zLOz0Vz+C8HADVnWm+0dGs5rpuFLHnTZqefidzWR73uSJx/XD5bF1d\nHpighLU6L9GsgRsI0i7jzgL/z9yPNPgqINnSREOJB3OZsOBxEocXxb3OjaMM\nB+SU9ZfKtu4lwit4EYL7wjeskdsUisdgcBpoOvlFUEapXrJoHw7a1DqaStyg\nqvKw\r\n=S5pS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXnnkyQzcCW91Kb7U5GWdQzjcLtJ4MaEVXuWjXv5BRdwIhAL9heMRsXYjf7GqVvWgmT2xaUSP6htNz90Ufl2CJSzzZ"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.2249ff45_1551437417230_0.6644367799383035"},"_hasShrinkwrap":false},"0.19.0-alpha.35980e3e":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.35980e3e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.35980e3e","dist":{"shasum":"cbc375ba26f5d3f9fa391c68096f535299eaeb2a","integrity":"sha512-ydi17d/gSxGP+PvWlc1fEYzQNui358NlP0sbT3JrnAah9IRwPfQDtPxXK/V3WMBqlIULx60lSrAtIGJ7T6W0Og==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.35980e3e.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceRNRCRA9TVsSAnZWagAAnbsP/invZea1lmAHFIJPcahu\n2aujGvkjPkOcCgnEtkZjYSoiS4U6zVl+TViZ8Vz8cS+66sBJBdfPEh09bs+4\nrU6ds0nB954IwXqM7JNpK9GWWsJvZe8qxsRBd3m1rj8RoVqpvnamJE+kFQ3W\nYzq6DOAF/os1DRD3s/i07A07ZVonpBWQvddr4ZIuNAqx1tx6JMIzhn4ct6lL\nliZaEZ6xPRjl64xQEhh9VPmvSsEgSBmBJypkf19cZLF8Xno3R2kVkygF3Y8m\n7+oI31GddmOvoJCh8DdxuukWS72vJIHEMU52qftLqfLtgH4xAvVBaSmW41N5\npFZXNQWM5ar3PjBEYMNcMrdi3kgq+ViEZNik5FyTTbx9p5H4QBTSwWxGsByX\nJa4UCqP0M03L5FXaGkHQunQ/PXwz2EcgKeGoPVT5XZWc/xtqoKYXlrfiOeYg\nEn+Xy27TuhPsSjjWuyYIoqxTXcIt1cLIYnarkxe63UdYJGRDI3b0UzYGZ116\nbU+v80GYlK29VyElseWz5gn9Vvuc5vJbFiXQMIboctkZA7pHfnbYWllJRQHf\nUQz+dEGkWdURCMxPmJZGdel5xcX1l+0qFsfzEb5OTSDLtE7IiXKftAiGwv49\nF5OgZq3lkYMZPJ4p2EVL7K7BbN9/5z2k6Tki3o1KhYi+o32NdDRc/p+WnWDD\nrjUi\r\n=PB/0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUfXo0H+Nk/PG88yTDtP6ONRhwN9LHFrpHYSjj6xvMagIhAKIQ8tMn1D6evONNjRbjv0b/AaW0GEti8XkcVD/+ErCd"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.35980e3e_1551438672482_0.8954285580957815"},"_hasShrinkwrap":false},"0.19.0-alpha.89ed12b6":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.89ed12b6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.89ed12b6","dist":{"shasum":"831eb196e025c28486ac883cd76b75aa47972941","integrity":"sha512-Fl/Za7d98zty9LSRv0V7sKnspBxoPFPVIzoRir2eviX18CUxi0Q9MxZ4mf7BJEEAYdFfSsDJHimSRXBo6bPFOg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.89ed12b6.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceTYTCRA9TVsSAnZWagAAlQkP/jwcvadq0qM9/TgiPBJD\nxtE1TZ7mak9OvoofgaBIFKGB/C3CDEWYqfX+VA02ft0/LOxhiY9W3Lbp4bK+\nHB13ImzFOKJfE5zwpy85EkpFbNX+5Wu6IeasmlC2je+XQgiU6SDAJMQ5SfqW\n9o1DcOO62fVUX0TN7YAxLDFcAK/DxGahVnRNTjPAsCbW31Aj5Jyj99s3EYvT\nXbzBDE562vwip4CHgF9aKWKjn5xn0OKI/OsOAPawiYrfTuaFpviKEq1CGAN0\n0c8g22PqP9oVN/zL3nzx9AiIMlZWYT3MS3sEuO94VwpvQWtkwaiOeNbQ19lK\n9uie4qBDwuiUigkExJAOZmsxJJvfrTyUPk2/mbvjzfqNl3ENN/eJ/E3S3brg\nKmJhF4uFmyOhmDUXxq7RU3zPA0FFv7hGDBq9An+an6a307wcGr0EVBxhceGh\nZPc+tgpslb6XCn3TCweSiHjdTLGn8zNLSl3E6PvZGpRoHsSK/kHzLkXqUJGN\nz/PtToYuqqS0PiU94BAPj32CKqrIsZlRtErhzHmyLeqX/+1GH1LT48bSuzxG\nw/oiVbhaGAFeLqN04BYtW0vQq6xe2K2h3kA9CbRl6WV9xPmT2Ay66aCqoG7f\npkjD+4bznmB6tDgP3+RPrfBWDo+LwBvqfRZCsBTvMg3UYlDhPVtLdGkW+uzA\ngraq\r\n=tcQS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDhzXL8ezSXJmFxbUrU5CEaVJ2d1yU2NDOZgmWrgWgYbAiBopTR7RX9adhV7eH4REXH+3U2s6nTkWOlYHcxWV0ebDA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.89ed12b6_1551447570481_0.36247039281745685"},"_hasShrinkwrap":false},"0.19.0-alpha.2f2a3a34":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.2f2a3a34","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.2f2a3a34","dist":{"shasum":"be3f14fb3d11246f884715be6401a687c1fa7e69","integrity":"sha512-c0/PWP286+3mrD0jq2VVOIZPAfCGA23rU1cl0zchje5NuQ4EPioVABrG2nJEos9Fb6Mt86kZkZdmORtAXD7blw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.2f2a3a34.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceTebCRA9TVsSAnZWagAAF84QAIp3nJezXUXXaBzsptX0\n6FFCVIEEqoOx5h4YgtrHo60KiDyHvec5saA3AApGkE7L9xUSFmlXnOqDAohJ\nRTF5FFcSqogHzqmDNmp6OXF2Itr8BCOec0+si1WH6V/TPLCzCy1PH/xpWylu\nqK1R6+Z3knIfvosrQGAaUBhPbwwvEYCNjobsnBtEDTvRO4JufnNsRtzDb74d\nubnlrnhUKUOGKbjuuyMXwL79/m4UHKmE76oS3qYoLBUGUpO9ScNPiGdjM66P\nWaiE8QloqBE/TaLfddSeDQ+Wr5VYAgPCnQ3OOGW6dc02JR+/3pwz4SNaUU6a\nYo/O4/q3e5IyE42JmVO+FcTvhLt3npB79jVomIlLBN/bSGKMxd5+eesN/9Td\nIFKW52dfd21D7tGTk9vtneSeZAOfa5eiOp82X4bRCz1tH9TiEKDKMQZ5axUX\nvBWVo4Gv0ufKlVZ7WcrNYJNIR4eyybupPYv55TzgRRxRhQ+pq9GPpkyMkiM0\nYoD9Kx6hzXheWUdCpGrsykYTSxUOBMBdFBhGij9JtQzjZbND9pWUO8sSDlYX\nBeI93Pf6CVtGLDhCzDmNwd41lnE/QiF+2JacjeW6Mld7oHzdIABKUOFidRM0\nWo8O36OZSYHtEm2naNjalPc6AMO37wYwrx/fd4SBoAQQCKGZ+72fLVfzJYjD\nz+cQ\r\n=7g48\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBEAgFbMA60vPhwU6Z75muSOevRpFjZepY/6mU9nDlnnAiB7b5nuCzrjrsRLzBOAprgkudVUOVGLM5geZTrzk/anDw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.2f2a3a34_1551447962783_0.2751390217806977"},"_hasShrinkwrap":false},"0.19.0-alpha.eb96a664":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.eb96a664","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.eb96a664","dist":{"shasum":"ed6c0642e4b657cc365e7879174740fd6d5b8bed","integrity":"sha512-ymYkWzTWcL303sKmjfK6XkBz0YdfLhgDw60OF9UuBT0XAlDd2Xw2pYSN6SJIb+Sxl2EVOcdPkYYGFXdYpf3LEw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.eb96a664.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceV7kCRA9TVsSAnZWagAA7awQAJw6ILNifengTQL8C4Kh\nz5pCSvksF2UB3g63dykTaBfnEqVF8L2ZgYvVcg0zdFFRPMvg9aWXDzS7S7yF\nH/PlB8VQBWjF77lA7gaNEOfHTQW2Lq4XENDxs46dMhut2U0M7FD5PAs+WKbY\nkm2NCgoiLp6Pah3ZnHrefFEj11iwL9Oeo1aZ7ClOsq2blmaTLyBswGpvAMOS\nv5oW0C9BeV7PVbHzkkibX3uX5W4KzYLCpKkvEm6c01m5g55PZBo/GOiEhGI2\nMNGkCsXKhD/omxX8s+XTsRJzu8GrUDVcN01cnIahM1TeCUWkid+Cx4Spc3vt\nxwmRis4A3xWXb/wFEklZq/XZGJtbFsKyieSx3Hvb/PPih7y9PZWfWYcqDg+A\ngHpwNGAy3NGnClFIGmv+Hx/XKuGKwHqg9k1G1MZBmPUUo30JHWnaKcvA0aoX\nx8y9VGfnb/Din5sIejUYqqAbHYd7Qd9KDb+V7uhKoM6GlCxEtLDFVHxEFcym\nTw88onkJgJPRMha6vlIbrWYsNuYHThopjChw2CniX162BCexzAWI8bN9L2RH\n5cmDuix/qcojCHIo5YXRgIfR7Rexi0Vb0PAgFC5OKtd1EDQviITOHNx3IhB5\ni40n5eeQQsIJat1Snx8bOPBc0My8dfk6idKjKKC8Q2sympxUcvmlGlI83o7Z\nXd6H\r\n=0LrX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQPHucSuWeaTd0jmrfspjRBNTKGB6GUIPqE2rrxAMhagIge9mmwS1unum2mrVnKhFYY0FBPrVTKiLvvs5vfZbkBJY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.eb96a664_1551458019941_0.30381626338190126"},"_hasShrinkwrap":false},"0.19.0-alpha.f6c5f227":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.f6c5f227","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.f6c5f227","dist":{"shasum":"8764b3fb6a40a912ea411f14480016cb94037207","integrity":"sha512-0/Llp/jR6iKjA/551/ZRUPbgngq0gPHmGLYHImRdWUOdreHkPBt454unal/QXRU1p0p0719s03IeFbDdqr6KsQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.f6c5f227.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceV8BCRA9TVsSAnZWagAAgvcP+gNxgaN5g5TZQ25s/96Z\n/6+k1hB9hWy/NtYV/5JkMZju38RtjRR5psZLhdhm5El1+1TXuFjvkWe9T1K+\naQo/S0mbqsDgb3QvWfwQm/0d5W+7QdAah+6Tmwu8cSooD5x0OLckjHyevZvX\nFmpX5c7TYKUBEVlxRuBOE1Oy19Hu6DQzcRg6JAhEpv8GOT/hTpe9ipdz+Jsj\nXPPtvbLUMUxWx/a5Mqr2+TkPlh8UpYchl6gEXG+Yd/eBae5+dnZ4G6lHL85c\nWqHQ6LvlmI4mbvHjSS6WEe1uQT4OoXEDPpkbkHAy7/qmHPDRNIxODRb0jmIc\n56ChKZsHLTacQojxl0P8lCxd522FUOlOr/czEeW2Xjn+n5feNeOatAvAkuIF\nTX3ExVvgCmEwgooIjN8a6Yi7MKVi9eENaM9dp1WLPf9fvd91+WFcPF0hZx+m\n2nvN8p8AqRXk7rLOLwkXWdXfIXieAh7v0lw1gx+bb1eXRyceesoDaU14yKfy\nbopqynX6fyST5PtZYyq5ZVELRhKxs6ISZWSifEPTMhS8564rDqEgeHJw3MAX\n7+p3XU4Rw0rx6jr3STtF0J01QWWCFxg+qL1dftvGDkYACeHeFwK8G3tKnhwf\n7O1ydvm6Yh5T1W9o/EN4CoJAJmu22UMdtUfhd/o+W1Zsj8z4w0ntC7pdOAGU\nR+Eb\r\n=AWlY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDl/eISWOv6VXLrvhLhbVIhXCaLnyS26L8Cz2UBE021vQIhAKmzqP1uBT/0lVrAXPunIzNe/Iv8T1Jk4rjHQjQQy4Ap"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.f6c5f227_1551458048475_0.7937778988447424"},"_hasShrinkwrap":false},"0.19.0-alpha.522954d6":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.522954d6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.522954d6","dist":{"shasum":"749a1f60eed11af309363bb1a7cf107dafde4966","integrity":"sha512-+AMmtBbJmAtUZZRb8hcuB5JP26/2yJOg4GRrYYE97x3FaW2qXtxXGXHz18b4aZeFtI0wlZ+FW3neMmh0ACbR0Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.522954d6.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceV93CRA9TVsSAnZWagAA74MP/R7qXTu5/jJyIu2I6T1Y\nrW6LQaWlPjPa8AeYX9BWanpRpc63SuAjcwUzP5sh4+rTGjezTO8XMXmvxNGJ\n82nGAi768S/lCvZSNtlfN1+Tel3hpXOwAQ708Zmvp9qFJKslHAj2dRNG4XnK\nIn8AUSJkNnyUHskxyQnKtqf7JoEQ5sYUBp5Cvyv9fGtJsvy0NNg/TReTemP5\nwClKJfRE0gR4U2TBPnhD0jB9/3F0eMFtKCZIm/XFphE3cKKAGFzhidRWK8sj\nuRsjXuisJz2F9QeaY4RhOmaUYJLDlqE/HrU/oClFHephoxmcUrujUtAxUpPa\nouNBpICMtyPLi1jpmxdTJVq4lgbYGb5wEiCOIxZFS4ViN87jqeHVKvfubtSl\n3FLgNY4KixYVd/sg8P17UciBm3NH9AOQsuM5DRZVj2XSTGGSbi56jQTg4qs5\n55aQxkFIkbY0VLSUrDycNQ9jfzbqQ+HBg/O+WEtzXVkwCwdzOjF3jiIou7zd\n/vrofs4g2oyE4OCivblvnmNXjsLlX0c+Ohu1X7v/DjARFN74+d/nWYjTmim2\nfbNw9w1W7TaXRrtIrXhxFoMdLbM+A3XqX1pWzfPpj2tq8oW2vdBADAibPtOv\ndmdo0kj0E8H4u7oNsTzLY60h0n55L/ZV66oBOmMDmuE6HNI7MN3wU0BMrUHW\ng9jt\r\n=F8hF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEZ4TXkxn0XPVaUyN8VTcACd52RLTZGTepFIdSReatdQIgB7cGbmGlmbGrkKOHCNnNZVWheynxRfW18ckyB2nuS9Y="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.522954d6_1551458167054_0.1414060112209643"},"_hasShrinkwrap":false},"0.19.0-alpha.a6afb569":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.a6afb569","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.a6afb569","dist":{"shasum":"9ef02a2bb806eb1055f7d0b1545fef5320548ba1","integrity":"sha512-1xdId+ErhrnhzUF4KIrxKdTAtkZ//7Wflq6Ud91jAErrhX49S0DpMHB+oLR9nC1wfUtWfufEHYS8z5g43l1gSA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.a6afb569.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceZMwCRA9TVsSAnZWagAA6GUQAIOqXZ95WHcQ7aorPXVf\npDj8J+DQv9yH7OYoJuEHtWtp1ebqfITU0Hws5u5lZWB7v3aJE1mErx6k+81X\nsQyO8SoWqYT3lzn/T7k7jPrcYXjtXvlJtksyi+4+FO5lZl/EW4vLYLniB0pd\nv6ltwXrF4sj88t8EjmX2AkC9pB4de2/uZ14g0YVI07sbuVuptE9t36B1LKW6\nBFtv5lclgOhSfKFemEa9Tfv9nR/OJMP4Vg+S51atG9FC932s6a1TkCOyDaQf\nINDYtAxZaIFxKyZLS34cVgyvgUdhg89rUv/JtT3yxxpyoHq3WVqPg+73WWbn\nbXSoJzskXuvw6kEJG3LcvpzleRTYbwiEh0zU4sSa2ERdLMDGHWihcZ7aLX40\n0aDcNw2w6o8VJYxnmzVNEoqPsDSN5Jm41ccu2H75CpN6pKWMXBoio1S1S75t\n+vRGOC15m6+VYIsXXiJinrYemqukBM7wV0zzfgSGhV4z0FK2HSSeRwhQvS09\n6Q0S5sHHFzZBiARvBww6NzzjP8yj+9M+lQTct/EjgdycgKh18Ru4SiWoiLGG\nZ86+KllnWcan1ZlOg+2iXSHzbEOcB0ExvRtK0+BiLIFakbVimwL8c46GQym6\nIcXwxKXf8kALIAOoVp4VNZhXxgryp6Q9Cp/kh5qQUmnODqOuf07q+Pir+cVS\nXoGm\r\n=cROZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGADq93+Dk9FsoY6dCUwWdAwQP4f0aLYzAM2nUYU1w6IAiA1t3tOGUxcUrYCPJur/FvBwXE+ku8ZzJ8RVXkG3KVO4Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.a6afb569_1551471407632_0.8121431190469499"},"_hasShrinkwrap":false},"0.19.0-alpha.e7317ed2":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.e7317ed2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.e7317ed2","dist":{"shasum":"52368e64f7516f05c2f56e52e6d0a382acbd03f8","integrity":"sha512-ghCOnFL4sAbr1s3QkeCAq334cGrioRJj5Bm42sJTnZl1QnvBOcwk/8RKeQ4zet8XnKuN5ILKAHPRVtXZPZ750w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.e7317ed2.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceeCYCRA9TVsSAnZWagAAIBoP/3zc9g1Rmae4gAycQ+qn\n57w49pXsK21WsrxbNlsbuzU7Qhk7YxQRDPVSpYxjIcJOsCiiwXVRJ8+nXW9s\nlOp9MiyUexeRq+IpfkoyIJ3BDsl8elUT85RuASIKmNdpXNFlsBSLR0zCiM1E\nOqANAMFQgy18cLg7Iday7Z3wnUVa49NKA0dtA5ayD1rUuN2NWFLeY9CbKLGO\nb25jGYaOliRG1czye42fts7itGwKX6HlOyslk2ZZ/qU19gI2BlLygRjugK3F\nlq4up6LU15vntj90lGV3nTd9ZfPP0zyqxNFLBhtDvAj6zc0Bx4C4SCVzBcaG\nizWHxDrsN1nUB8nZZeH7E8g7xax44lLlCNXwnuYu7pV52MbmGXZAx+aHZKI5\nFDZQoLgPMFQTrS18c2xB3b63LImGBd1YCCTBDvTszOCqESOQjJN2n2rXDHEG\nDNEQjhArX4OexgYR7gf5EPqx2c1qWiBXJjzsJjbtmTb0XzQOIM4ntD6JEAFn\nh5e/IxgAXtIF94NcVX0HM4emYwRbgDinIHJz2PMwzMEyDlNP40emdj79Vwhp\nmzAzwMTCUySeVEOmTeUBR7OZqVxnNbiSjbVj1lWfiezjR+w6EnTdmQpxFC0p\nsyr5aPKoh0iVMyUPEUj67ccsSEIqKik6M9+lZKDqJBsot5/sG1fKro1IcYqB\nw2Lb\r\n=VRUF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC5DqFzvNhsufUh4cWQIu/FNVbbSALzS6uUTN0RetPo3AiEA7Wf3tn5/e/Gd5Fqfne95PIrKKnn0y/mXa/REK/yVLpU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.e7317ed2_1551491223480_0.5704153848738933"},"_hasShrinkwrap":false},"0.19.0-alpha.01ec7a55":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.01ec7a55","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.01ec7a55","dist":{"shasum":"18344540fe277d4e56915e1adc74894867e4aea7","integrity":"sha512-8UsiaXQgq0XhGfEX7f2vhwIW//j3jmznPqY309zlmYCsbZuTDuPxNorMJsrKBzm+U1mh3QCaEbt6kB5XbIZs4Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.01ec7a55.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceeeHCRA9TVsSAnZWagAA9KUQAIM3fCb5XZF7XYz4qzVQ\nCEJ02Bg+OQoBuvEcW0C+ZAvnKDzKDtX5kN8nGQaywOQfbv9xc16wAY6QpZSL\ne/kch0PXmt/dB0O/AnhHXY/otFPq6Sykp/72Pfrfc29/U3nK4+4GRP7461AH\nPX1Wj1x8yOLEFoHa/xH2aIqHoHez2nmEnh+Q55v4jJ5FdfV7PzH7mHLqkTab\nlKbCkSxR3HOKo/vXsk7ZWnaaZ5aq+DhZ1pn4YMs8sEopvQXqpPLF9Sa4Yvl6\nFYiAUjaI/Fed8gsafTmXz+Wpx6SAhzzTef2o59rvMwiW/OJPO5HnydVCfFNk\nGKinB4MfOaVuaqazWctIaYJD4u43Ct87L6iSwQYzRFb1OjH++BmQbddqGyWn\nQKE27ImYZUamVmuXuVvgkOUWZeNybchKyuGkA6Um3fnZmsqG7ds3dP+x3Zdo\ntGZU2a1sG445Srh/xP+xrOly1YiFS2QC9iVi5NcsXG9isqKBJMtJ1LLx+hJr\nXhp7/IkuwhL76IOKLwjbxScsJ3HWowJ2BvfOPi/rSqaqJ+3I9nSd5A3EO75d\nobq/aJfwfAmkxXbyCW/1D7UbL+oCtFgu2ZpIs8emYQoqjYcTa+DgH5KVARmE\nu1QwM0fd4zh/4wNPlztYaE2HI3AIwfa0VPyAj6+TG38GY1Hr7+GZDJ1fno1L\n6a8j\r\n=j11n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDk6rHvkiGCQgRa+z4Hudrj4we2U6iigZEsLoDPw6jgoAiEAj8Zk7zenqqNR5G63xwj9q1HxJLujNPeF9/fndPl2WjU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.01ec7a55_1551492999018_0.21190588866100657"},"_hasShrinkwrap":false},"0.19.0-alpha.f3b9e563":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.f3b9e563","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.f3b9e563","dist":{"shasum":"da9028c48f9691adf8424740f03f344453236c4f","integrity":"sha512-kc6eCSYbzMR4NJsoJGs9x0seSOh/wh4MB6ZLVzLxE0P1jb4MNus8qMKlp37ZgBgcdQYKLNtHcyKNpVi8yHWFnA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.f3b9e563.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJce3lKCRA9TVsSAnZWagAA3M8P/0gJLXIaViaBS3sxV/dg\nXKoW6XQ3IzrL3Wel4hx44bqY9GPQGyEs/r8nEHWoKtvPHB7YEHcyhlB+ZD8M\nG9Y/zMR/JyZedj5zRS6xh5MoF2SpZTBZXenwzIH5XtUfzjwUE83VAuDGnb+7\nnwL9zoAK5B9O/GphFGvnsmvfTR8Funp5oF6b8PQBXgGf834+iqwagZy1e35o\nIYsolOYFMDGK7XwOcRii41trDCBj/n6U8pVc5EyRONyWwdz4dh/aX0NyIvci\nnoo4lIO4RAXIlVlKga/ZqS7Glc67mlNwMJzRrgzC6y5AVXRNRE46GGB5gW20\nHLl67Hq0g8SVN3JFIE9Ffdkwiw/cCudhQdk/QMhdjPqgYIBJ6ss2XlzU9Wr9\nFCUL+Rpy2mGp0+KPzJfxYUkOTtVaNIohKJ5+5+LKmrOT0OXKyRuYqYIvB9ax\nq02eSihNPySyYZE2F50+JHeQHBYEq46eXsrJq5DOXCmNE1LOXRmy0tbtXJJm\nfF4MvrAg6UBmTj4TmV65n3e9lOJRezYuAb7/Xlbpb6sIkQejGYh+RC/KO/Si\nvSRVZXpm37X7h9qt0nYm0pMxf1uj6CY1sk8O//FcW6lUb3y4/8UUMKFA3xwd\nQvaqUBj/rDGzS1OvjON54oFciXXf4ZtWgKZJO4uCPKk13pq/Z9nVDQv2ssuK\n/Olt\r\n=Tdu3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDLh8KNonLh8Bagk0hPkWr9/bhFPC0FYImbe7Bcz+qCWAiB/gtCZaO2HC7spNZ/E/Y7uJmijKbrz/P4S9LTHL09XTA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.f3b9e563_1551595849501_0.5174093465766485"},"_hasShrinkwrap":false},"0.19.0-alpha.a36cdd19":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.a36cdd19","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.a36cdd19","dist":{"shasum":"79e852c68b24ac791202e1c36e08df3b60e98426","integrity":"sha512-L/Z/GOdHOdBdwgUNd/5CHEgNblvvdJ+znnP3zhEzSZyCVEhMoeUPx7p5gzxgMqy3e0paCywo/iDs/hYf6ejleQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.a36cdd19.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJce+XpCRA9TVsSAnZWagAAqTAP/1wmirSDBCUzyX3cncM4\nk0ztC/QH/ZYZ2DT8q/+FWuuTyaFf3x91jQurpMHRHWJAcFmfJsWGxFuUN49Z\nUMuFPEeLtuMt/jhycwa2Nx9j4YQPGMzIOc+LWMm08E3dFZtsR/D5HIKQvuV0\nAQDQ7x7PsJCAclhSqcFoxudWRdtNyB1RGeTe54cQ6r5/eX5Mj01LfXFFI6O0\n5Mb1lWRyjEWto8LNnq2QlyHALWPG2CRF/arGmYmwCRKk5N23oOlHtzMf6zAC\nDfLf997QdAxaqqidPBIhzBJ0/xFajMDKllZbAvmxR2Wvu2oYT8ub19plVIi0\ngjxJTE5SZX69fXbGeTxIqrazYkV644nTyxi7qF3/ZlU+ibxnavigWZiecNZk\nx+oYsiT3SELbViDaHwHDaTQk6lQwmlVcwektNslw/Hw2Dt/Z65ysyAqFBG85\nGXiw/Ns+1xjHnnUhVpBdqPunOtSs6PjjermISNexgP50kIYqG18bobSzb3Ve\nMScAvoIe6qXaqx6uOEtGZqWGJWMxvXWxqyygqKUCbB/B0efvba3eHLsXSpJ8\nFX22Ua5oEMNR4ZI3P8pJkr4EoUXzHher9lgBe/PVbICKN8a0JlmquDeP4Ksh\nwLak4JXPTwyMzypeW70fbHVtlPUSu3eUbWK07iWmsJtJVv6a7/H9/2oen0G4\nBVYe\r\n=mGZo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHyUsa41ZKtX0THMD+h7wJWVXD8mlvP5xzg73RXGrH3BAiBcohnUa9ZC9MzfAWXn0bhJ/toPvXnbvMsmlcycmDrk6A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.a36cdd19_1551623656501_0.8564996660280992"},"_hasShrinkwrap":false},"0.19.0-alpha.92a159e7":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.92a159e7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.92a159e7","dist":{"shasum":"9d2fc1bb1a9f96fcba17abf7e601709c61fdc115","integrity":"sha512-26gmiMxhJeRfRvFKljeyqUVQZtg+t7uhm6GNmHcJRJ+MFoE2X26ErESuxP9HCX15ZI+rai7Hp37FG8JHm48aAw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.92a159e7.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJce+X1CRA9TVsSAnZWagAAUMkP/0XXTsxbntLx/+SrDSwa\nXAnOUsPup4Kasshxwzh4C7BOPeB7KseqpKx6PYpMQ8ooeKf4agCo7s3YG9hJ\nT3MP5FzdMbO4ohgElvS5Ce5+/MAi09tPKyB9BG42KOs6T0hbZHHdjyUmSVz/\n7NITBSHIpTwT5B2JvBlLbfknwkA0lorvR+abB0rEjW4wz4a3khacLD21WEFg\nuE3fyTTVqlCUa4iuZ789VQQIxMYqM61D0zugirAZO9melPmpjAcVh/L1SF9A\nXmsxmEjKhC+Qg3OxiQJOKJMGNLFxTj8W60LfOSWA8BMkVbWKRLUvFTzVAcys\n8MzT/bKv40u4dBgJGVzLFhESnoAUbFA7A603JyRqlWeku7MLg5uum9O9iMpD\nT5puNuaUdK/Z1F/Pa761zEEBpef8PHKaH54iGJf/NsBwNSRVmQN9X4MDnUDf\nct0G69bI/6M1b4rkDHzTx8Hn0cc468DUI15ylXUw5qK7oWEgN1j4apk7KfPE\nZhDlaShCRXfiOqntR2D5UjGF1vJr+ikbMfMNBgYuuyRGXLSbwiMUUBq+AaPl\nX9rB3+A/h8IX3t96LWFtSA5Kal2nabOKISBt7aD7gkZCHv1EXXkPKguHevYo\nKaShZh2LTR+Ge/GVEWozLLa8Z13s78ZlJTHaiZIHzDyWV4TV6JVTWLN6Cv34\niwKn\r\n=zDMT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAjp833wpJyjbxMHFQ/Ed3oUMG86F7LQchYjvw93vnwKAiEAnceB4nZ++Z5jtRjnE/kZSwU1s1V4UjO+eIMbEkClSBs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.92a159e7_1551623668660_0.002230157040881142"},"_hasShrinkwrap":false},"0.19.0-alpha.762626dd":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.762626dd","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.762626dd","dist":{"shasum":"0341de89de515c8f425c3c592b8cd71cc1d38be1","integrity":"sha512-i1O3270BouMW2XnKpML2ePpe1BJw1PJg8SUwl2OG/BO2xHKhZGnOqHUUEJK9P0rDmEvpGY0Uy44boNA69RwbjA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.762626dd.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJce+YCCRA9TVsSAnZWagAAnnIP/1uAbDuBMunM+KCH4yiQ\nQUZWKJLdFKGvjqHSHhZrGK1JglRvu3sALz0gRwEeVrZcf+FpVI9E7Av4KodX\nwVPyUuf+QUzmWrSZFwy/O3AV3Sv7o9deu2TLLeRwTYT+OC1fOI+TUcbDnT6N\nE0RGFY8k7VRg6QjHU+64H3HOSwq8qqT0gvkdJlpDTnOYqOl3GkTNBxQiutoT\nliAjFaq/CGNmgDYbfUW+HlWJPVIfNynQcVKc5FQNCSdmjer59/U/HUOV8KXL\njwaG5YVfL3gfabVkXaniNqlZQteQ05KNc/+CF4YuD7NuFOHzRR1q7RmEazzy\n3IVqm1YsBo4KfB+WBaeJt9b915cErW0v3P/y/UOIW7fUHR9VPMPdWhtRxNQc\nyewFmVjyNX3KNkJbpOeYFrTHSwo9HWHLMYrpeqbnY+CSjtkornEGSJRd7e8T\n8f1NSU5cJbXk21DwJZBR9/G1Ljqg+Vm0lDe6D4W9Vn/ibSOjrmoMcCjsC0Sz\nTpr7SQP3vBoOvfQH7UP6hR7DPqCoC1kr+TYCycpCN6xIXYd7CWzU3Wwkd+US\n+7UhCebRvwMAPP1TBkr/vGOSbVMagD0Y/XS08RXZth1Vp8AJZWi1PYHROnoQ\nZEo/haZl2kvkM7u9Qa7OnsN+6bdqQ7MIJftXNv2VPuSKSlZsyPKeTHezTClH\n99Pm\r\n=54mC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHjhR9ZEGBeP0NMVbrHd1Qri95vM5mKZfHb1xg/Lfxz6AiBBKsOcLegrTIuS+qUw7+T1rLmPOtChwGoLH6m8vuiiiw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.762626dd_1551623681721_0.8143088435231898"},"_hasShrinkwrap":false},"0.19.0-alpha.79228234":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.79228234","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.79228234","dist":{"shasum":"3ec0757decada3bd574bbefbf430e75e3ab8827e","integrity":"sha512-kX+9wCaOArU8IVuWg2dZpNq4MVmh3cpzYc7LOTdNe33pwXXiwXc0U2oeYUvLJJ2x+7XsZpzsYvD/T2Kj/CFBNQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.79228234.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJce+ZWCRA9TVsSAnZWagAAKmgP+wY+I8IXF2xNzxkx1hnd\n/mxnPBZ3G4YOic2iz7qY7Mk7slkPoWHGbbkWu2Z4MlQv60D4b5VSoLqvPtVh\nxSty+ayund9Q+M7TCQW4naEQqq15IXm1/cEt1ySWynPwXWHrdrCpG9tmruDf\n4MCnUBxfNcmKzfOM9mfoZ7qjvtCmDZ8tYEwkAfcjstHDZXIOaarSXt91+dzP\nCMeGB143YcQ9Mo1Udr5jbT7slgjUpJoySdCi1m2ywNsskDYsBTWLtJXoZnI6\nkJ2kURahjvyeltPoG3pdbP8+XtLg+A6PFEw9feknLR7k1KzreuWKtU1dY8gE\nHRyerrz03+sjJjIYvF1yiTjIcuehiiEcRebaEvg0Nj67PdTV7cVVB/VqpN7A\nJdIwRN6bBSs9qw6qMLYVAYTy4VonZS26gll3VyWlPwSTAGtDhFzkL4rRbQcR\n3kNArtnlOGaSYS92ghXUxrqLa/sbWG/8kDP7B1s/pAaGHlGIolv7a4ffpTPP\nBjlNXz2xv0A+YUkIVYAq7PiRJPaBLRsuf7jpohvGnqCyKpIOEqfECfiksWSd\nMki4ZGuhmVvYLKmQHLgeqBXt4A6E3SJsLsq2GNK6uodAhZyPveSH5cLTCpF6\n70xkIYFw7YdJ1VCwAiam4+oCQ8Oraj8fDV7ATcv8hNy0GPj1S6FOcS4OavUc\nDFWq\r\n=iRlv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD14mjYX8SYLBYKPi4CCKFaafO3bT0/k3K6S71xTqnEdwIgOK7M8+OTqWuu1DnXureBw5FG5ueDq+CstxbPqaZEm80="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.79228234_1551623766143_0.39579819605392363"},"_hasShrinkwrap":false},"0.18.0-alpha.23aeeb74":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.23aeeb74","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.5","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.23aeeb74","dist":{"shasum":"48c07965f31862c11ce8e53793e4fa66c52f066c","integrity":"sha512-Gep5w31sTuzkO6rIRXKUpbP5LCiB69/OrYZ3usymhhIkBdcyMVGBq6kePjE5lEGbOYdKf3u5ry5q6gX0pAFHFg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.23aeeb74.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfKioCRA9TVsSAnZWagAA+f8QAJz+WZwyohUMlJWSlps9\nW8NEw6F94uc6nUTO/VOlPplYNOrz24Lih6NJBndDwVRvOhNd/UaHoZ5yUiXH\nm4b0d1RqjCcSF08ZV1KIOFoLQwrFx3Y7HTjDdZSrLyx/5D4G1YsqPqCPCvoT\nQkLZVSYu7hJTPT3ysldZV5MCHVDQYongowNjDhIulDEnfLqr/B+x5nyqWVhw\noydYAkYowb3glPeqK2F4hVP1R4gfCh50KU6fjcKwHSW/aJbpaf23UCNke4A2\nCFRDwoJaiHeOdaddyIZat4DOQPWG17BUHtBVZLxRQWFPVkeJLFvHzS654Dcf\nMuErbAsvrPTqZXp/5+ti0kjHKEVjNjqaCBiah79FEZxT3Xo/nS7xvW4OdyqX\nRHx8QDB0wWf5IzJ2mCjJmzfcFFBMA0WrhdTiJMpdGe4czWUUpdbApowKQk7l\ni9WSouvc/viDj751iNYo90MX2X5vPru9YZ2LO7Tzw8XOdFFEMWGqBdmJewMm\nNf/G1xZ4soJcFxnUtEKiDJYmCzd5HCEQDyszydXUWH+y4IenWeF+HbLlh+EJ\nLD7JIlyPEO3OchsuAExHFga5XPpPo8xLX4/0+45x8WOYO+Pjqc6Xu3qxCUpF\nabAAjEyKlVfqJRnNAkQEuOdyGjLhkbYlJB9NP8XRBglQItKKzLwvk/+UM5Nz\nH4u9\r\n=V2vw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWXlVPeZyscUZEbpPvQErLPWK144E7v1xrQVsermZjJAIgTFxzHQaRupI35l/aVxX53wSyDG2DDC4IhbUdhOjcywE="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.23aeeb74_1551673511688_0.12813481384646108"},"_hasShrinkwrap":false},"0.18.1-alpha.6":{"name":"codegen-templates-scripts","version":"0.18.1-alpha.6","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"gitHead":"c0c195b17c3acda322e8addd21fcb9771c6c49ae","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","readmeFilename":"README.md","description":"Create GraphQL Codegen templates easily with this Handlebars.","bugs":{"url":"https://github.com/dotansimha/graphql-code-generator/issues"},"homepage":"https://github.com/dotansimha/graphql-code-generator#readme","_id":"codegen-templates-scripts@0.18.1-alpha.6","_nodeVersion":"10.15.2","_npmVersion":"lerna/3.13.1/node@v10.15.2+x64 (linux)","dist":{"integrity":"sha512-dCJG78AYffFU+YTpWsjlmDQ2nBswauhmY2qRnONiRJfNqpeQW6UW3lfE0nWGAiinfJVn6jZd1kJfWJNy5sTzOg==","shasum":"0ada5f4c46f15c1d3dddd0ae265e538085ec8287","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.1-alpha.6.tgz","fileCount":11,"unpackedSize":15980,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfKppCRA9TVsSAnZWagAAP1EP/iUU+/7vnTRzMQZY+fu4\ne9sy66VJLosIuJLOtqx2jyFHfoO9Kfm86b+l50nOPAJzY9IIEGhwmYmk5Kg5\n3MWKbPdJyH9FI765ADU51VezuS3x1pr8xKRDNfN+uUwIK1AcOEe65RS7I5mH\nq1FI5IqgzCP3hKpKGLdcBxn0Xvx5zf0VkkgSB7qx89d7Ha6SdWmTQh3m0j42\nhepx2rWyXxKblGGxak9D7w42tKzoEGwGAZItbPPSU/2ckVSf7xBPE5ZLBtrA\n2h+mbES9E4iaBLcWteS3t5yJy1Ip3fs8DjLt7Tg+e7sJuJoRV0gYstKEohzJ\nx9IcwrRf8Z3ZI2Fi7w5wo4MbKZ/+pNSa8VtjORcTq8Yb3lBuOeP5NtpnzEIJ\n+F5p5cco5q1tBCh79Tbz5BamanTEzy78RuPj2HHY8yMPfuM55rzdPAhbXlQI\nBMAgS2xia+/diOcurEZ/v3Dm5v96xnj7GPKTXBawA/M2W0RmVhJmZXCMp3W0\nz7Bj5X0bKl6SAI4smRjM3ZxOk1j0MY3+Xznzp+JnJsqaHImKTQLFmTs++45R\nPWfWnOlOyWLyq1JwlA6gzQVZ/6Ymnwui1f5uQNdm8yDYSOipMlGdSDEZO4yI\nYJao+sRgczKrS/khKsku1Aq2tCp1jI3c708dfKLbSnPhQH9tPIf0qjbN0V3d\nyV6s\r\n=0e0B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFZeHDK3SS5gPRxHhlealgPn0Hd7yl61ilZZLqmpFx6JAiAFBjHwLGTPXm9Fk6MNmryYmk0Z2BU9tgXUnBusJmOktw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.1-alpha.6_1551673960354_0.6339638128733256"},"_hasShrinkwrap":false},"0.19.0-alpha.edb3d7fa":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.edb3d7fa","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.edb3d7fa","dist":{"shasum":"fc47a53ed960f5378287f064355b2c9fe48b2506","integrity":"sha512-R/p5lcw8Be7reR07U0bAon8REYtdQKZT6TeL8uWoDu3lSIV4XF2cdLupUiA0G+NzJ/fELTDlqE2SI/WEP8ZjLA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.edb3d7fa.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfNjACRA9TVsSAnZWagAAHcsP/RFPbSTzbPVeD/ih+dXV\niNBnUx5uqtN7GKBwVzReOc9K2tfW05NotNGr7kFHkdBDFy9LlbrP7fR2qWOj\nUc5Vd99uOtnyL+Lnclq104vvVtWxlPUaMKGrpcTtNBvTtyhxh9ybUIgsXS7m\nnv/RExYBIp3icM6N1DaCexbth9dk/P7S8S0vaoLC/p3yiCjVW54oklwusgxx\nJWmfkDRqpkNaNU+7SXUTYTQ7cccdTzlToW31FqKbVPSJHtA6rVRjQ45NJfZ/\ndHsRWZqLhYYYUGNZ95D1w/tCzJTliA1vjT1zBjJ310hbAS0eygNr//xaX32A\nKpcOkj436OHFIUO5SZpNmskthGxW5ixe1bfMdOIsbQoWKfF0s7NfninFsL7S\n6+7V5VqQjkh2SWfXQVXukq+0oCys+Hgkw1nTIR6PFLFhZN66j5aAS+Yj1eWi\nmbThZagAIL7VAxFNKTZ6HU7F7KcpjIrhm3gSJRHcnwW9/RIAFU9vFkVycE0L\nv8fMQD54FnfeUHTQlXonc2o8PRnxFacdG6Cbs+Yg01NHfVbA34k96K79P8h1\noOoHqpuGWTcrAqt0SE4KkLeNTg/a+InrO04LmPdSX9SinAYg7nmDLTvZbttz\nfsT5B/58Rfm70uUkUU8tJCsR/dlvGvXvX361Bp0NZzfKnmT4WqjkL5OG0oF7\nVNLF\r\n=3dQD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKOFka424HuCXIt5krIxr2ufMpGe1jFLG0Zh+1T81wJQIhAMWmYT5KiNBHjsggTVMpr6+EaYD2ha2aI0FwaqWHbjC/"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.edb3d7fa_1551685824004_0.332965203128609"},"_hasShrinkwrap":false},"0.18.0-alpha.ad875484":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.ad875484","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.ad875484","dist":{"shasum":"d9f5c51f0945fe2237dba1ff6f9faf0b89812f9e","integrity":"sha512-w3ZrermIp/SLzSBJXueXMvhruLCoG4Nqkl58r9Sxb9pud3MIhTimHC7yF2sya3pSPn4GtF6qyp6TPQa/yjknVg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.ad875484.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfR1jCRA9TVsSAnZWagAAhsMQAKEhk0DK88hdX+GHXLFp\n3cWKIh7NbgUb5r4UFtKhEVki+SH6KkZ5eW+6ZuZzPHnRY7rr6tN8EvSft7Jr\nAJRr7NZciD8v0CeWvVGUUXD3Kq7tXXQZDrfVdnWYz0bMn6xq8A9BKDGi8pQK\nMdq6n8qgqzO7186U4Q6/BUWN8IMjiPeLsc8XLdTYcDOAPFa/D9DVsOl5uHwE\n+RJMIsLHzcgV+Fvi3uBDNbW8pu5bWZ3VKz+pn+PFtyYVEYJMZTDF/VnKpNFB\nsCGprbWiZXiaeOy0wZU1ce1X9iRgUQDAve7/AHeBdxFY9lJiH9kS84Dn/42v\nXihKJCJuhN4wiZXBRS1eHL9EjmLbyIwOy8AEDvxCMVCR0v7Gh4vWz/qPwkkR\n4X3En1qtv2E7IzZa2ev3Uoym/wGHHxOI/7fGAKe0E0oqEtp+WKLJOC3LsM8y\nucfVAL+3SqB3Uo6RIKXIgkjTvsELJyh+CSU/Wqfooe9YJZ+yCB4g3Zmlcd95\nzyfX73E3bbxlTMlGvI8HqDRFteR0CP9P67DZgydcBCppvh43xN11owl+bwFe\nzQrjGbIoPAHmIPSJRO+8sw581Yx0r9mqV4Rr77FhS0vdseY8mJLu+gvisKNM\nONVodq1jUL8Fw1nKmxIdYFruR+nn7ZipnUQYjiL2f2nt/TD0j7Wn3Ct0kP+j\nl02s\r\n=sc98\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBSQ02QZUzA8b4+7TXu8pyE27WyMJU6BAWJkaJQb2upIAiEArWPNxnR8Jxtd7foHssXHABHIAQc7WIHdxTZulQ9C/mc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.ad875484_1551703394283_0.11320723823232726"},"_hasShrinkwrap":false},"0.18.0-alpha.69f43292":{"name":"codegen-templates-scripts","version":"0.18.0-alpha.69f43292","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.0-alpha.69f43292","dist":{"shasum":"ca172dc1422255d37e8b47d7bda8b948b6b9c427","integrity":"sha512-8Apa03IvoRqkzd5zjWHTPQ3uRZ0fH6wf56Cdp7rEm2qg2CBVaEc8+iBq2JkbXruLAxXBWY/lDRnEuyyn6YGrmQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.0-alpha.69f43292.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfSQQCRA9TVsSAnZWagAA3qYQAJEZnPF4zFauzc+FcyD4\ndfktBhCGiFmcNo4vVF5/L5iaa6no3sdgqzk4ou5m13QuHDjzO2rQCfavUgFO\nj2U/A+RWpqZJdbabJB/hYPfciZxx5GwBxlf+8RPnwJE6QrPLWjC3zg71k5y5\nfzs0dN5WVqc8CRLUuj6wV9Kahi9FL9fp6LbgCsVpf6cZfReyitDRblavrAAd\nCE2k9KOSFVhpUw6NgH/xhCZYO50XNqUo5/uZH8/c2PJlb8lqOJ0eoe05Yt6s\ndHcQiLBQmJ6XcaI4djsOnNWhiL/Hd7cyW+YPKW0rp5WzdQuXAS/DQJ97xA8W\nnnjq/9yupyT0shnOALuda1mgY+jloADL1znYC2eQ6QqZEasD1N109JheT0Px\n4VA9f5TM5zPwMQQtuTwHcsQ1W+xuH9wRMLhX4y+LlB8XP/2Wk2U1nzKIa0tT\nXgGKLhyWr2b4RnJmOBijq++PsYg0RMw4wi4k53O4mDOtofsaOZy+4dlDlqrE\nT2SkunC9kALmmd+3Zzxee0CEQiYAgCShqAKUxWxTafGYI85eepeHc/ib3j5L\nZW0l1jqZ3XMGc0BxGEoT1cmocgFoxDtE3HdTaJ5eZwevWKerkaNHW+ZJLPoz\nY5E6QSlGlAsMQKQgLKXzKZklyr9tjINQWlcpjoUBIJbavWqXXdGZDxWPB32G\n5Caj\r\n=dSWz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHqySzFxtgEyQo6JQ4lhY6TEUxfcK31Q5/q6c8EYFKAPAiEA8CKMaLkJnnw5Wwnw2xFZx8uYrI76Xxr2gMdox0VR/v0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.0-alpha.69f43292_1551705103941_0.040965230184958124"},"_hasShrinkwrap":false},"0.19.0-alpha.31f290ea":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.31f290ea","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.31f290ea","dist":{"shasum":"771e6ddbca242fe6ce2fb9d47c1c6b7c57270a72","integrity":"sha512-YLokM0cV5WvES3eY0GWQ1C2zwWrLMBprIw0XLuzQxLIaxWlm/sw5j1vYGuC73ukgcMq9YmQVIjGneV4X/8xrIw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.31f290ea.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfTS0CRA9TVsSAnZWagAABsUQAJkN83dltsmWgPeo1j0E\nvntlZiFnfc+dx3obXL7ECuc9w0JBC1fyANlTHKW/uCFLbYhXqz595k/hubmu\nIW2Dwt6UPW8swQFjDaaLx8/MSZ1QOGoaIABOgeqjc+6NmZ6law3Q9jHNJ+Sl\n7xf4PAhjJGZ1WiwYoY884gWmc5L7v8WC1UjfPjGLGLPC6FZHvQx49cxLykA8\nYAho4ZlYYbpiOVYQujA55O6mXrkGwVkVGyJhU3GGS24lirMiIyfrHNmSZW75\nPas/W0Xm5LR7WO+A0kU3L1fVLEov2A1X5pDWN+E+DfRCUrei4Bczb/a358oV\n5mkd5+CSpyK0tWR0gS0ZngW49X0QhHGimrNgSnBRsNrqTcojYNeXW6tXW5Vx\ngGy6TlkQ61SBAEa5p6vrNUpAbvlLurKwebKTc0oKfz2ZJkso6C5whZemDNZV\nIiHlTPYMw2ZnjrciijzwLW6aF7ddvltkPLGjO6iOj55IdgL0CLCA9Kv8zwRi\nBXxoi/CIzCZ6/sh+EKvkZHeg9VT31JTZNuaNX3BL3WiRelSYfD770OgkPuhe\ndImk2rutArJaegknjPMn88QHhnrOgVENAL4KKNTYa3KuL6Ffp0nNM01zv3ua\nBdzpsBXloP5YKWimlWUAWgfTpUBBiMXi8lHjoTyRQk2Uw6FI6Sza1wYi50xC\nLJkG\r\n=Zwbb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFkWPjIvrkmk6mCIrvEw7p9rmcN3nyJRWLOLwKGmDapvAiEApq30qJpAor/PC/5hyzTCE9sEYUOr+JaRHE7DQdE5B7k="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.31f290ea_1551709364164_0.6233348874023159"},"_hasShrinkwrap":false},"0.19.0-alpha.ca269f7e":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.ca269f7e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.ca269f7e","dist":{"shasum":"747dd87a1c7fcb3d98537f00a5f6c942adab16bd","integrity":"sha512-mtf1LEqk1M91R6OWcTqYBk3Mpjt3ivY47eKIc6VXUMQpVHdxkxiHQoWprYDjdVKnhzbIsN3SYhYsk5RciA6A+g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.ca269f7e.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfTYoCRA9TVsSAnZWagAAHPsP/2j2DQ93I1bbKTKpFVb2\nlgJcX56sKwh0KSW2lqyi3oYaRhENbksb0LOHvB79sdSiaVgJDoONYvkDiwv4\nJH1CdGNaeLDpUMoEp5sxM5dBao9LNRy01RetQfdJmwcvs2naLsPjBMdg/1k2\nknMC4+upFYeAzKgsC4davZMUZQ4x97Uvhq/0uE4be1pIkbF/fHsNFTd9ikcW\nda+CzKIvFfyUmALUBByM0zI62l5tmT6W+BDEjT2ihYBr2YH9f/DtYSgX5QMo\nDNHHJzyQBMdd85QeVCfbZRFxm9DQgyvLLiN29gr9KFYik9PYZlq5epKPNhk4\nL6jQ/fNHOiVhBeC7eCJK25i88ehniwvbxJrRxav4/I5fWA0NPpVwmrwUf+4b\n73qhaKtF/E11dbu9LyIshKVMeq88q5KvB938Ty1P7nu4lIYVx/7zBpeGUfw+\nVvnAeGo2t5yEhCDdmb96AITnhxp554f5TM0KcTyOl4VV6FcBfMrAxfL2aaEN\nfTPvdTAgJLAgfVBjwMJSjCq2a8YsXJVuI6VDAkcKpkpH9KHAPEaUEkM24Hkk\nmmwJU60UIgo8dj4d0Y38jVQtZpp8GCfuAMv63t76Hfw2ZIjVmTTdbsW36X2R\nJ7FuK1gZcR2xbHPy00vw+IyCb4NKI+wpkIvOAcNAiBpDiAXMmdft36zvDtvy\nngxj\r\n=nVWe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCccDAl1KEt3h1GczCeNYZesTXtoV2HylSbVq9EQkUY6QIgJ8jfzqaLUd1/N8/mKJiNpfHvunOWPEhLdau21hmuNVo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.ca269f7e_1551709735334_0.5631653184280527"},"_hasShrinkwrap":false},"0.19.0-alpha.842ab491":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.842ab491","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.842ab491","dist":{"shasum":"7d8746ed8b42d1f9355c494bf785f2471049e751","integrity":"sha512-ZLGqFPyyiuS+rIbLpT8VffP+8se3Wga74b8Js9P//CsnWDXAXbHgLuhmYvw8rjFxGAHKxwXpiynze9HavCJirQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.842ab491.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfTZaCRA9TVsSAnZWagAARDoP/2pIgHstBId3eqfaymJC\nR2ll3tipxl7rlAkozt0FIHycgbE+6tyCMicTAif9xnnqxuwNBKxxo/EXQHVT\nHt5SZ+H35jn/ZtEB6j75FTYCfaD57k434T259VGNLbPa8Ag86oB7DBN+332g\nixKRxLUPdVyo4jEJwM0LZpUVR/hy2NBVed461yYBMV1iq3buWidf3ziC8Nq/\n9PtzEHps+FUHW2S0TZW1BXnlkdzhHe6yQ2xfQ1iwgoShCY+BirdbxJJKkcGD\nNfg5IoZ+7/SnLx4eBJdaXWbPV5m9XNDQLYgoudV4cG1tY69oND/IboDHpwan\n7h30wf0gR8qneBlJE6D7qmVDmy2DHp4nlh8FsWXSMFCC/Byc5WdvidWGz8Lq\nJvRULKEqPVPHdltcXFQmHPMnWR2hI+qu8YT9CY5p9SKrVsL37TtHzkeWjEfz\nghKZah3DtMaalm+2Xme6hl50BDvmfE7nq1XfjVTqnC3Y8ds6n6k1KhJllzbe\nvA+LAS4gdiW6oOfplc1MCrHV7GgUwRdEWNbkNId3Ok5YsFm3c0CngYGB6fd9\nex7YFIM9NAnATrF4I9PL/D/xHtBXlL5f0JK9GUpAZ3bQOzpeoMlDttvgjE9C\nEKA5WRQcuLo7B6EQ9lmMNQGOYqx4DFgKxvBNXyRTQjKoBAKV98JAvp/A7sRt\nWpOZ\r\n=coQc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHlzZZQZGfG/TqhrJn0WvNrRJfAdAMbFcgjc3odZH0HXAiAzqUE7OekQ9DNRaYM0akLkwa0OvWG4JiSWIGSlO6HDhw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.842ab491_1551709785448_0.05872652496346342"},"_hasShrinkwrap":false},"0.19.0-alpha.30ffec87":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.30ffec87","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.30ffec87","dist":{"shasum":"f730a818c708fb3bab7dd93ffe50812df4f0094b","integrity":"sha512-VJYlCrvhEdzJd7Vy7RrdOp5H6lVzL4i/QCQH3+v5MaY86FJPIY3dBPKhoVBeotoeaGtcYBudctamd8wQH5Zm5g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.30ffec87.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfYvuCRA9TVsSAnZWagAAeYAP/1nDuekvF45xeBdHAR57\nC/EqruXPqqw1qWR8g9cUFcwVIm7UU3e0jn25I9z/wvxsMFECU8Kaqsq8Cru+\nvIIDRVv/1+PDdz8dri9lRVJb5t4LnERNzR6KzhjRvLweDr5O3xqFGaSlJl2N\nM5oB2KiX8AUUOOxSv7hApcAXOhUkz3NJwUQy4pWSbUT8brFn4jfkpDtaEIev\nEHHp9SfzzDnZWt1PuHKuy46PvzGEXYhoYoONffpxOw/bNaeSiWQrL74TM1hQ\ng/d2JIHBiBgCpUhgV0N94mtBADrYbnOB/SJ0c3dN57+2RLjrBLWDcyEuy4x2\n+q8EItUJV221Cwg8IIE05N+Kq+7AJ+3TimNbZfrXUri0IIsJ5VwuUF1AY00D\no31Hzrkrj5y9csahLE6p2IKRlED8r12ww/2EvQMR0YWQY0vgPkdf9ethpVK/\n5H7QqJwz2sLr6Z2/ZSjXPgjr4nWfte/cwNMQ8qM6CCOzQ383Vp4MpzpxQMET\n0ecNEnAqnRxwDKCYYKb5G25h/269gtz1r3ldZ3GZtFqe0YSurSuU883LL4lg\nzdfdVol3TxhWzegyzTi+U3lPVJQLnz7lJdcTzVkJyKVuR7caY6WP3+BSqBIJ\nceBYflF1V3eRRF6A3jYkrBAuxq+RqwyQ9Z/+lYs+8oBvcGrGGRSFlSMRZgo9\nza2b\r\n=alvY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGlclDW4y6kGI9T8kkJgd3xRFFt8BhdGzA7107BSZdY4AiB6njf0LCZxaisPY4h6bGV7Ycu/E9Ul5knN8zIoN6iT0w=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.30ffec87_1551731693642_0.1703857178059469"},"_hasShrinkwrap":false},"0.19.0-alpha.b6975f17":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.b6975f17","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.b6975f17","dist":{"shasum":"a70cbf6096931ee06e5421079b99bff2e0d9d758","integrity":"sha512-8Og16Fk7Dr7AjQ83H1PJ3b+Un8ao5HVCurrG0XkjpeUXIXvKtALPtcAB94pNP87IEaEnIL/+tzxiQKgUWQ6VQQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.b6975f17.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfjb2CRA9TVsSAnZWagAAOUYP/0b6OkT3feAZ6I9rVDTR\nxlqFllvOHZ93NqW/91nlcCYTZpgLhgr39mI+eaVQnKGrEFWsh4T8KWLEHG3C\nIEFRcsTmGZgoXArmkcylDthWyCvF+XGRKksyg8ESi6QfvnzqTvyo8s06L8v8\nPMCBE8bK1cIZPyk+Ksj6UnzMBDKrPM26W6GHw8aV1D6bfH3x4tkAPOX8D3E/\nNznxXXcCGpe8c8mpiSnS7390TiC8VpUGf4jv/ldDyXGeUL2yzE4v4Hokjj5z\nEXBjRFtw3BC7Z7L34MfBX5Qv4rXc0NyP0LBJnDchBkb5psOsKNWQrrWKDZ1s\nWUntJqhdHvfh54ZjyxDv6mXDhlAURHH+NbVXhn3by8V6oOtljqibBBlKryHQ\nfavTqRK1Prgb7bVpShuJBa5U5Hzp2PKiXtU7zBDYUeIN/aDkZhlOHMMmrmrV\nnE++JUe0aXg91/9sujPDea1W73wt5HnlfGOKev9a+Qnre6RxVRAmvjN0WiEf\n74fQWqSXYAn3/1s3V6CvzFtNuyY4YW+nzZxgUvsDjY8MR9pQ6pfUGYPmHsZi\nJMQsjwI9FRWtLOdepbqayXz5uyIfo3k6sRb/hRRfJyi23cKR53Y4Ilwnn3sP\n52SKV/2WN+wKq7uTa6gWiCBZE4j89hnaoxKChkElho6OCIcj9JEuCtiM3z9V\nSsLM\r\n=Mk4j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCC38QrJP/Vne6A/Momj9YLx6PE9xoCjOyEV1axCedmogIgXjEoHAFCeZETra0Gl9VwxcI982QeXTZ2R8JgqImYfUw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.b6975f17_1551775477640_0.7008425770973785"},"_hasShrinkwrap":false},"0.19.0-alpha.658f2fa9":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.658f2fa9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.658f2fa9","dist":{"shasum":"370d60ed71a551327e1ece0e8aab2e060959d90f","integrity":"sha512-QcIOfrq/DdnOr6z1h+1h4qFkfuWhRFbLEX6V7pHbp0DB2LHxF6sRwbdGlPlZ5TnbUrtx11cMGO4pMocWXLkqTQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.658f2fa9.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfpb6CRA9TVsSAnZWagAAFzwQAKCGbiA42StQ2kmbRbPp\nBZ4q3ey+32UzlvUKGQPCUXlpCAEx96uHPMwrlVPouYxnHEg9uCh7us15jgrZ\ngv2YrU2wuwLw9AVKwEgTa00DjtowWAngapo6BCvhd91MhKKbHkwijWiIw3vE\nUJHaM2vw4ZaVFLJmO6s3c6/lmI7IZFswaszMjfhJoSztBf0eYTjRZnx3XAMX\n7qXu38rFKw/dixq6rYNDb1zgscSoDrt88ZiF/h7OC0HW2u6oSIPF4xoz24q1\noXuJxQnekKzdJzzJM3fK/iQghNQYX/W27UcSR2QCXOOAZ23aFdDD39SXQiBI\nubc95X1yifLuugbLRZcG9OGAVguo2QLtsibXz+Smx3PEdZODU7HwHrmfeioK\nsYG3CbfclL8FZg8QcLp8S5rJzsNfOdN9fL0HZxsTekJbONdH99n7b9sQFzIq\nvrDN1Sw/P5BmaOxat7ip34Qekj5RwwsNkB+RqccHXGras2nst5f+l2dLvMDN\nac8fq8rTAs5JqQp6bMcHjMKUTDN1KW58MNMpUASRneabPtB6zImcXYBLdIlR\ngEbGhBbfp9G5sHmohHXAObDGXpCXU20XE3zQyG1mmsYte32k+C/hnPHrWlcv\nspKFFvC2wDNuZ7WUKyWitBm3hjJAq+64HeK3flb8NBZtNiAhR/pNnkWw18rP\nn9Wn\r\n=BWwR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXH7idqCu9X8BbtjxE7WffYAoNvvL8bFYNczqeinN2DgIgXS967DCE0w/5SpHbvzH/AcYp5DaOid0Facf3LyyXhI8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.658f2fa9_1551800058174_0.03747098323035858"},"_hasShrinkwrap":false},"0.19.0-alpha.6a3f1430":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.6a3f1430","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.6a3f1430","dist":{"shasum":"3aa47c46b15d53d7a9c0ecb1d29489292eee8746","integrity":"sha512-7haykzT8bciNT+9kLQPR+7d+L04f8XWzhzaYyVZsNKMwUd7dsh4hZr4D/V71q1SHtML8ekmOzK2uLrgPuqdCkw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.6a3f1430.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfqJoCRA9TVsSAnZWagAAqJ0P/1WWvqqNdj0JFnkvCTKq\nCVpBBkdPP3WSaUerYpn0+PRNKOiIlEgp65EtVbQOd8R7MLjJi/vWgFy9h7d7\nOpZYXqAtuEdQIqkmk2YmM+ZU7ZQkfomJ2lhWjQ1F+bSr0KzPXW+wqvYK2kF7\n98UKJyjJF0lEoMAZ+QHxfONCnMWvHn/CC26lU+Bs3TSmZQjtoqQHBKnlyR9I\nb8NpnzjV8qvPUrDw8YxnsTgxzev1oXeQFUsvpLjvXMigurlnrITBMMzzX7I5\nctFHgfEwg9KZ5nmSAH2zyD77mlhEzCkazGJrLdb52tyLCe2vs5pZOYCmWNry\n0a9Bj+gpJAAXkwNNs5I4DpStZMceBK448BSx2UmDq/pMGNbsr2jVkYJmZyIR\nnLjUwxYHJMzUvRmv+ZJv8yjxrNZypefKKjDD1MB8HbKbNRY4HWi3nEHPUcbB\nsm2Ld7eOykmVqG39hHL2HnWUV1goqGARj0ori60w2xe/gB87TI1Z9XLrt5Ts\nSJCk7bNLLHbLrSqhFM0eCgcFB2lZ+5RUhmxQeUth2nBWhDHNhOgBar3YAXDx\nzBnOa6s8dSG3oK6I2X3+cKm2m6l9u9Mc9Yb7fVi7BJZyVTiHEzOSVnnFsNUw\ns2tdLU6xnC3SYA0aMfwUdFQ6MIExmNdxMi0QOEJ5YU8+mvm7IQl4q7D+U7On\n7R4j\r\n=J944\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqiacITJIGTY4vTKr3x8AhM30xWX6RPYODuTKtUDI7tgIgL8uqnuZDp/6yPBXcNHYC/BEwpS6NWF+9dTqTTFbXs8c="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.6a3f1430_1551802984214_0.5766204925917415"},"_hasShrinkwrap":false},"0.19.0-alpha.c9a3343c":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.c9a3343c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.c9a3343c","dist":{"shasum":"a364c2dd755e8559842f194b17c188974555282d","integrity":"sha512-8GJC8Rl8nwYXMeW0+yo6mKucIfSKNozxj119+nDmn3UvrCBc8trUf5xaTbCOzTZy9HyvX2Z4zCq1V3Hl9caMfw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.c9a3343c.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfqNcCRA9TVsSAnZWagAA70wQAKH9Grnm0T6yZsgGkgA6\nDPu/1rda+ePHZhf8YhzYmy8aXPWb9YipuZ0SN1ZejoLtJX/fuv2fleJ0BOYt\nO5ACWFfhudKuObEQbseenHzKqsRumsABvwzIzyBJx7NGrETX37kev9TMoTd5\nI/Vr9uH9thxsGoQVZ73kR1Tw5uyXfbKm3NI/AShv1R7KrVSbIFaV23oROFHG\nVkF2vr/lWS00cgNrOU/gc2GT+QhQSEFyrRSaycbiUC03wWbcBcUMU0jl16zg\n8e0WA3f8rKGE7OC2/RGfKFfXXZhBG3ddKin2loDdpPdKvik4u62R25BZJGXr\n2bLBVQEw4TddzS/xaucqSfHfkH9OANhaAAQxA1UHATie2dkMHNA8aF2/+WXL\n1frPJ3igywqTBkokuzwuQa4t26viaVdPRRcwRNwtUyI/7dxN1NvVGCl9vUfE\n7msLywbFmyzCYHRymvBRe6mE3L+7bzZILRNUeJTrpsJdwQgnJ6GmciHkImnN\nWPOcZI/nqvSzXLNQeF8CxUuGAPwlcKmZ+jkRPDMNIj71QF7uvbf8xO9QaJpj\n+MFcGr8F0F+0FAR+w489verCX+zGqH0sLBhX6dqUiEXGIhkgEgr1krwIvnZd\nch3gqacoWo2UuL5qCvpa+U0PCKoQrmPniZnyaMD6/KB1pgisUVzc9qtiR9ur\n3voj\r\n=Bm2w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHLI4PzgVKugfkjP26LxRgfJ7K9DBwWpwmdBF9YZSvUcAiEAnHogO8Uwx8Za8xaAUC1CEx1f7Q7pyx1ylcWoWildLdo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.c9a3343c_1551803228221_0.6728014911280953"},"_hasShrinkwrap":false},"0.19.0-alpha.f4d07ddc":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.f4d07ddc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.f4d07ddc","dist":{"shasum":"fc8eb346c3315b9b2927dc33d10640a8719c90f2","integrity":"sha512-2vgswzZ/7BsbLH33sJCIW2k1Zht/jhUngW0ncBXa44RMw3F1wjRV3+jf2MBSDiRPooOst8KVfp/l/K8K1kQ5OA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.f4d07ddc.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfrC8CRA9TVsSAnZWagAAphQP/3/wNmpG/kIfIyUshlqM\njRDQ0Ndz/gCmYn0PyXSQ4of5V+s1awFv7sTkszA+JwEsJ4AJkmcbv/WjHFYS\njsj8app6mk1Uktj/zYM+Zde7TtIR7bMGIpZjNcoQAwwVaHt2BkpiiCZcJa7c\ngcoObewKvV6lIhqMaB1xj5ToNp8w872ZscVZbI/z5zQubrvmMz9TaJhzML8v\nTjWfZ6wxnWS3bT+ZtRi+wItKVnFGq/9dUYZ+9Jzzmfn1NPsWob4uGLkWlRiq\n9JrKinwFV9cwyeHKlBI9dz7F7rzV1vJFLebRp04AN4jrp/jUDE5crenTck6d\nu8WuaPXIDkl8UnzS5Qjpd0UiJs8hZ24tmytz+RaKA9YpVL4mGYMowPun6YzP\nTi77DCXIp8YtflIl8j+7OcIpA4ZehmS/TifOGvDFFHsPyCMpAeJL913Z529T\nByC6goB58/mbxmOXZPlB1SeHj0KPWnf4UTe+EQ+4Qi9c9xuF35L4F7NgYLAz\nh2zDD0N3KFU+Pzn+BlqmexB8NFvzuRE/MqCrjRZzjQk6ZVWoesCJG4qlA/Iq\nFo7Esp7+g0HhNFtZs5MGrdI78d47p2ap0Bgw93oTf7zB0I6kaSw7s0ywe4EB\ny5jRLp+rOuiugO6SKRdYsl1RCtIcjYD2bKz5ULbg+PgO2FuAOg1i42y4ktQa\nctHa\r\n=bezK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCe0epeqFniD4vCHrl2OquR7KNIeam/ueGO7z2YGrav7wIhAMMs2U5Tc6fNB4qhhgnyNxWX1mIXzLNpowlvTD7aAPzE"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.f4d07ddc_1551806651473_0.5088759101391762"},"_hasShrinkwrap":false},"0.19.0-alpha.f9467803":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.f9467803","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.f9467803","dist":{"shasum":"55159346c074718d0497025a7526b48453519b2c","integrity":"sha512-2XgQ90/a5IE1bYH0ljoLWUSHZE6jJdJ8v3lEmEjkCMnNMQlowayMjy/4eVGt0f577icik6pM8tZRy4uVN0zMjw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.f9467803.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfrSoCRA9TVsSAnZWagAA0zcP/R8dxuQwO6rvc4YFNIsW\nnl6ka96x7Aj/vM3g0kF2PK79kJUpsZ5W4vpD5pBAO1iVE5K5YBs++cD0ORD+\nuKxVnE90qjdp4aWRD7OuA3aaxY/PFnIso5u/BMF+LO9ZF2U5+rGS0oq3wTSs\nacpZU+y/YRcUUo5TKrrQy7rwOlxUT2sIcKRp294mPUe1/vjUDvHgJEBLWlui\n3e369W0bGo6jvUMzagsVxtGxFCMG4PySWp1oaFSCJ4dVTlrLoavb++wXzENA\nzZCmhfcEWTzgpIdTJ1dqG111xeNV6QDi5pyKOw+LBa/6HTHyl0jHLa6OCYZZ\nD3QTxnRQCcPaIIMnUszASbfhS/vzbfnqNefXClztmvzLLh6OFhXu7EtKa4rr\nOrtCqIAphJW4jOr4iYVjH7mnZYQscgjH63AU8NRjXmQ1YKGeD0IAfZ0eyVbx\nOlcmiIhT+uV+2waULjWnuS7eG0YDQowa/hx154kKbaYgF3CgJtK116qnc+mw\n/SH12b5qVzrr7Psa0Y2oHMvwMNtX3d2fBQ15TbRO6ddUtHdrU7+NoYPSp2c5\n5OkjLmtV3/L9OsDPyok5WLgBUbfDzaSOhH+Cfil3aQOACkZ5Jn23u/zl1zGA\ncoWoYh0Ei3LYpUkqK1S1p21bngoUdxuS2TxITkk26Q+XEC0XES9N7JJnO8bW\nJSNx\r\n=Z/UC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnoQEpGBTQu7I2FOXDeRRPIq5Id+lEQ9OehzplSG+UHQIhAPJt1AAcVJ3u6STn2Rl8L8U/i9FN2Kv7wuXG9fxkOhsi"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.f9467803_1551807656238_0.396933651605901"},"_hasShrinkwrap":false},"0.19.0-alpha.26bc98f9":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.26bc98f9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.26bc98f9","dist":{"shasum":"5ffc240ac1ff5389e53c06309061f86c8577ee44","integrity":"sha512-O3mFX3XN4r4Fj4XakFqAaii8Mz9Vsm1KOuWgdSciVrsTKCqZggdYgb+I2/Z69ODNVz3zDvliFf9FIkt6M05uQw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.26bc98f9.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfssZCRA9TVsSAnZWagAANeMP/iP8fIQiHaxnUr1TVvZH\nad53yWAjMIOw8diSm7NmHVs8YAojXiYZeF+qr+OlR3arjs7Sn8b3d6/jQQSS\nJDF2paWKwiUSemJMA+w+G24joyQX0jBjVX3IDnXTfKEMqx3u0PC5jdN4siuk\nicr8pGd8Daiy1C3YYpWKwp5VrXY/GjyMl8rJDWySltJvDEsy+cOKS6J5LURA\ntqHgMm1Uqx1ZT0B8lif31CxssG258V0TyGNeFzCKL/qEbyk2YYcO0V+hzOTw\nJrRlO8X/7o1fstCnI5LD+wTI3omP9rLWp1AKFqIwOJenRKp8MUlbwAyTnsTj\nRxcygMtdJK5BL5DxKsHWMFi8oc7itZ2b13BxpPTjYoAhQ8yYZhNOnAIusQOE\nJg/4yK1Jj5ONPNNAoRtqXHSt4GRHoL6RXE4hhw4GsIbQ2MUZcvk3duBnRn4m\nUTsxwgoS8KkL83aJX1zLDp9x4R8tUXDHsO9JpQLVeZlj6k5FAiwAbtXZS5v8\nDKxx0PcGrxPOBUGN3/uvnI6XON5p4A6mtvi/NaBmDdziqiwPCV5wVrOB5S+t\nNAKq2dwh8yrDlhVY6V3HvX5BPLvnnQD6UN5tJl8Myay+LSMiBVhKz/A4jXIz\nbR2rAiD/m2mzHUA+FDl8CsB3mbhYcU8V8hFY/geiSbSQoRqdafxH6asel5/Q\nSl/d\r\n=XMen\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAP56OO2dqfBhavZqeHX10XYpE8yWLjde4LLiuptE/KPAiEArevWjX4EpyEvwWhE+i+/pHXZQmlwNGQH8Do6ZlGCgJo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.26bc98f9_1551813399986_0.45584774832791286"},"_hasShrinkwrap":false},"0.19.0-alpha.dbd8179a":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.dbd8179a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.dbd8179a","dist":{"shasum":"98e255f9d6768eb39de2bf9ecf4d69093cc4aadd","integrity":"sha512-5zEwnnlwf5VF56lVj6KD/MKhMa1Uh9NEHUmPy5JpJHze6vA+qFhbVVXobCPnwVbLztXqKkO7J2WqYXN11Z4iGA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.dbd8179a.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcftBICRA9TVsSAnZWagAA0kwP/05gSG9IQdrljJKhV8RW\nDxAk06U4MDqoJC2Oi6UEoFoTfdsgwIMRj5BkxrOEgnfjDgqcDJJ31NLU7cjQ\n8jx9jxhzaUQ8emMPMpbD+4P9XwPPRvT7hGkBNu5MUfsZf2NxSu3pLa8iEwLL\nvk9LfhI1mDqQ+Az66LMZJPCCQdhOP8khjwvARouOMyfuJLrbbIcMLC246dhU\nTTihU7uLoO2az5qRg0zWnYkrbcyWVxHMDKREu7DobZWqD9JfbSPoevD31J7O\nU2OJ8PC3aEle2979sdUo/66+vmZVtWnCH7G1hVP3CAC9juW2XJzWlMq1KNOE\ngIyZUeVgWiu9ug3tNRuDrdphfYHTKTlSqRHRwUTS4/2Zwgt4H0E0F4Y1zW/l\n+2eoaYrE8JVcgqKr3VdCsoyZpy+Q9SBPbrQi+4nl4gQ3rnUjllI4+Fntq13A\n/QtM6yAIge8k12Hv6hXUr33+0WNMLbJhCT/FehZZXVmrE4SCS1evS1rCKtjS\n8FZAIzBCCDhXCnn3mPckiUJ/4Uk8VZgsLSkkCzz+Y0xHOiflBN1e7XYHWrpK\n7naMGcID3VOMBa4Fp9qbAIPq0bl1fITsnEUt8EAWqoHDA1lZVpJcfJq/LH8W\n649Ef/sLjX15Jze1Nv17YZaZ82JZI1zOYjhBIq1d0Uqdm8DwgAyrZxtwA0Su\nUaIq\r\n=s3E4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8zn5oo6gsFI1Fh3RJWkBR1AK4v9ufjyOjmhIRl4UuUQIgFSQ2w4Fd8+POdNuhRTEtyf3oNDBXFES/tgJKD5gex8k="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.dbd8179a_1551814727244_0.16476097127824785"},"_hasShrinkwrap":false},"0.19.0-alpha.33d94882":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.33d94882","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.33d94882","dist":{"shasum":"8b0442be9d7a401331c453c8ac95f04b89afcd5d","integrity":"sha512-GRuHhs883vkEq+F8REVF5Amd5TyumCV1Jf31yI6xmjePeFECKYxbR6z6lR5oVy1/cAljnOY6+VEmN0oFQHuasw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.33d94882.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcftB8CRA9TVsSAnZWagAA9M4P/1YqmTksTN1bt0joqWpu\nIq6gvwLiVyastXy9Z1vvM9IKqkrEELNMr2IiLMx6qKeJJbWgNqxsvdojV1nA\nRHpmZdkc5O3JjqnAhR+JMCeY+agVY74v6q883Dc3zZVsS/g5TGM5cOfUqs/1\n4U0RF4iiyF3iJOD/nsVmEpxv0hB2sWjBgQY/hbahrinAfgA9zbGMzjFYOokN\nu9Ydr4ZpMfU3RLBRNVXiE8cJzDsPKRvdgiiXs24HHh0dnGV9qofWGTt2y0WF\nDFyytAzou3CfqgARGgsGEvGgw2/LGv7x24I66qhBICKl4IvW0CBhbT3ZquC1\nMidtj2x4tS1tdCYsVq3FvYAUPFmM9ufc5zEWjK10f8CzYfeDcTSWG1KIAUTO\n+LZkdQpaUhQH9u/KNZVL5WKZMzDSYqKZzZrAZI06ooRuR894LDqURVWJ/ujZ\nSTnd3iP9zgKNrtmQ7chKcNiURE7rJAqDMlWF4TlcMUt1JoJNbqpHOi2vpDgU\nVEOPHdkepl/2ifuSeBQ66AhWO0DO1QsUGZGNEwQZrdS65AflqY0XZBhkMxES\n2tAWjZvq9Ag9zUAE/YCneU/jjMO0/i35TGCYZ/QKO0FibEgdcw40rk9NyYmc\nSmGskb4hzvI+aipErhD+6eKahO8+X5L+uHXqMmGDVzlozPiiPaFPrCxGP5nM\nCt0G\r\n=UnYW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvG70NQi1vicAhjB8YnuW8vzlwm159mxWtogZ4otd9GwIgEOxz8TQFHe8xLe/AJtUipQ3IbhVxKTgHiyzXCFSTs3s="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.33d94882_1551814779877_0.18742358398494097"},"_hasShrinkwrap":false},"0.19.0-alpha.f67e8608":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.f67e8608","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.f67e8608","dist":{"shasum":"feec034c0c33a519d7c5a0f90525046f3dae99fb","integrity":"sha512-R8//x8GchiNMU4hir7ZE/C/SsgVqjLSDrlQg/dxIPI1W/sTgbGpALno99PGB+Tc4KBEAmQtzZ4malRMQZ0sPyw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.f67e8608.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfwXjCRA9TVsSAnZWagAAG3oP/1aIU5qogVB1NiqXp2EZ\nVCtOYfe7IgoH/JsZVX81Qd8HzihcPerDNb6yJK3rozYinIRUv+0NXWmdxW/K\nS40WlOcYH9fTwHqRevKQ9r6qgyBtllhcn6bKSagw98Oa9BCZ7aDqStyexbmV\nxReWKBVZ8ZoqOm0AB0HI5IVpIjJYgKe8YAUgojFDtVsLkn7g1F/27OtHD3v9\nYymKfaiXr+8t8A2OHwI7mr0b6mQABzwiU+p50wOHiGa1l0uugIBxzIgsU46F\nwdh8JzMA3GaItIx+3H1O7hiJkTnr6gnYJqFS/lFISQ1q1D4L/siqBp+DJrvG\nDrfI5QTFE1RRYSqzAAOOHjZuueTVIXQVpt+qtLVXElkleioNchAQnLPM6Qf7\nI0QnnFyZQP7Yh/CbJl8kAGXYdFAzUFpjActpaSup+hzQTGbyqX8h9mZUlq+D\nnzjst8BQdzg8i4kVvdazuVvoXim79NWb37Nqt92GhWmHQHMqqZuUCE4IVnWX\nH0doqrgOkZLF/tO2f9u7kvW6wvjwogmggKYjTiXw0LYP58XEv7GANkQ8Js4x\ncDqKzeVTWMrkyJB6qYMcAJ/N2rjIhDo9Ghq4iLPH1BStA5GrQwnBovPj4UCH\nbpv33JjOThpfHL0I00lO4viRUGkcJrVL7f4XGlRMvjxrutLoh7cU13IRKhAE\nqUeM\r\n=iVPi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZ72GYxDVDrHkz3wtvlDD0McZwAYcqgsTZ0kNy6Htq1QIgX5J8dbBdZM1kvkutw0Q0cFQtFnUaiqbfb82ByWabjPg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.f67e8608_1551828450986_0.9153872986164149"},"_hasShrinkwrap":false},"0.19.0-alpha.cca6afa8":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.cca6afa8","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.cca6afa8","dist":{"shasum":"6ec12733f83edb0aef4a0ebc13e20413d88107e7","integrity":"sha512-TdSzfElFVOW5y0wt4B+Vkv8MDEIZpFcSHaXlqGPH4TQiB/6Xo4GBD/PxYzacL/yYwMVbMD2+ITuQB8xUuonEYg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.cca6afa8.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfwXzCRA9TVsSAnZWagAAVTAP/3tpTVeIeFQI3WcJ/G1J\nT7AszSGtYpSLmJLU3obYrYth78iwoi34qiherXuzjXzbonVrJlwtLNPoWt5m\nay7M5ptP1ZW/Z+EYtDyFo9szv7hVHXaTdkEP168PPlCAOVoFpYicWPY2eSZd\naxVTLpl8rAjgugGpQ0RYQphUU3DvDeQlC7fqCcOvJMUOXTbWYCvd4KXGkIAA\n7DroCZBjmdfX/ANT9toYUavlzAcs2srmxiaGEhKm/5rWZgFKYYWBslfdxtHO\nQauFaHFgEnCFhUBhh4RNCdCfhorRNP7SaN//sAdEw7vrmNZ2ucGhd4X2HYH9\ngb5ETn+Pukj7eGxeXfLdrNmUrEp2GTUbj9QucR1DfSC62g2nUbLLJobb9Bny\nW4z7wRAw7VphbLnaYEGRBVp8Lc1aH7k0iD0z/59EXTNZ7b3lGDEL0nV4kjAI\n56xT9H9fXev+LmeDEyCop0qJwXYg3kjCjavmmU58+UEPRONhgQaTBHK674Wn\nJLwJMe+GA+luW+9ZTCiB4bLPgSBT5aEmD26obGgsH33uQC9uyzNb5uc3cTB6\nSrVxUzE54MaUHaikid9i0mqRUn/w7D5m3XrAuEWy0/ACrPDAWfT6vX2UWcWN\nEOdTh7/PdthgkQOJj0KfTVWZO8XautgVw96yM84TVhfKEpGGV3GUuaZ90z7G\n0eTb\r\n=1B3s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9wBCAB4UrRl3gMRIC9fI6ljO5KiZotZy2+TysZzQqrQIgeYHcnPMK+GIGbzWlJJBBHAnvmH5m7jBI/Ct2a0KAkyw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.cca6afa8_1551828466747_0.6759464734457679"},"_hasShrinkwrap":false},"0.19.0-alpha.ec4760e5":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.ec4760e5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.ec4760e5","dist":{"shasum":"b260370b52dca459b7d18dcb58c99515df9e8e0b","integrity":"sha512-7eMR3F2fvPQPoGCH9a4rKx9Z/+qM5AmSIMYL6V5lOFQEeXQ/r9amrNfKo8KwC9th6WewMCo51Rp79yepvEyWRQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.ec4760e5.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf4MHCRA9TVsSAnZWagAAyGQP+wQLNud3Sfqv4JFz+Tqs\nOOpSmzTrlfR82n3cr6B1tdNqg+xLTcZE2+6l9EeGexBSH9YrwWIsMFBhrhni\n5H8XZr4TkXxD2txgo0MOP4wehhygM3d+PkvkS8m5ZdLs0TZoqSLQqagDb4te\ndoWZVj0+GhGayyTGjAtQHtV0fLeMwDQyc6jJa2htTY2ylBd/GkT29AMCUOY0\ntLilZgfyAbaYHBcfrBSf+Ewbvlvw8xdUiVCdGFwGteQHFavUDlYk2AYNe0fy\ntnW1L9KeVXiIaegwndsMtXmBgwd9ZdB23bECvNPtHj0afCxF2izNZBFM0m82\nlQCG5V+T6t/msA/qKvrHKbHgW6bFThsrSjfCKg6OyLqMsv3/9BFGZQg1b6JJ\nubQxArvdCLqS/JcKD59diy4iw5tY80rGraTNQKwqicuhzya9572lTzRI3H75\nIzCA2F3turw3jFhLx29sMOeHTk5W40gLdavgr9Yig1/XpOJZqZgniIT73125\nzYVpsP7sUITTQ0rEFpKb9Ih7XOCHVFbhk/NGgb7ZFoMRgTWqW2sioVXP6+0G\nWf60tY6B5GW0g51r5jfCsVCNzMB/5wh5ZwQGt9SQXyuOrfu04kBfg/60keE/\neDlynt+71xyrYALZj26/ItqGYq/W7XBm+1gR7MqfNAypj9uB8jIvAEmQr/8I\nGmLE\r\n=RWLV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDIIvRZWSyfCjrhgcDfObc6kBUI09IqxJyKkP09UAr9AIhAPl6nrSw4g9lvgtNoiWCcTwrxIGUo4K4YA+xk0tabs+r"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.ec4760e5_1551860486741_0.9803038364561525"},"_hasShrinkwrap":false},"0.19.0-alpha.6888a690":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.6888a690","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.6888a690","dist":{"shasum":"a744d85a29890028b2f5005b33779bfc7d4cf6fa","integrity":"sha512-A5HdKovlh/NXwkoOST8/3PziBoiem05lZbKfbjkGpuJSN/K1i/I+RZE2OAw1Cr2GFh0Nkkguti1sspXNipiIqw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.6888a690.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf4ObCRA9TVsSAnZWagAA2SYQAKQBuuPjZb5XQ8W5sS4E\nO8194b6NEXPePnqWX9BQVcTHlVx7LIxw5kAZunS0kg65dhDcy+8S4Svco9CF\nGoPIS1SssfQVvzlh3JjUFDw25wBhdC5G5wXMaTqc1LmP98ptc/Jfl9EZgeKD\n5QWmnHblvRcIjY+7DamN420RpTyrg95SDYY3OToB5jr3KHKIjDXskCm7EmO0\npyZflJJM6KIt/YE6Hj1GIlcpOtBmFS3Raz3Fq3oZv8H4wbeM2kWC+yHNw48L\noCc8WdOmJUvHWwrbQ9KpM4LwRM1c1odwb7fSWiBBhaLuvf6Ion5qTqB4z1iK\nQvRmcQqQB/LARk9GOOxxWatn9/PlHKlvPat3aV5ughe7ISj1vbeD7HfQoV1k\noWck4KkCn+A0UB8biKJMeLgafZwUjWiAnFBWW5uclXiszchVVQqdBJQKSrON\nGHPDts6rTBZ+hn/qYFCKoMNaE8HvfaTg5E6lNcvcZYzTwCaTAM7Vt2F+sFw+\nYSD3Rg4Sosf7Z8hmH79oM1Z1XHrPJtC2fidqqLI9KC2wUhdqaxMZFHALfduF\nlVC+GNPE+RTlgKpt5cNrjmIHWFKN7gxqQgdu1OVVwSrm+YuWEX0hPyC8COiw\nPPucSO9ecNmATU1/AbWP/WMLDYuxdRWCKG6+qsjPtE2XRCR7J4L0DDvzzvTb\nB8aO\r\n=xr4z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaMt7QsJ8Kgqll2CgcGA8L6pVH167y70GW/o/p/UHwAAIgXkvuyUMhgdal/UsbZtsFTQLl5LBbe+YIGWTcwwUCuMw="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.6888a690_1551860634358_0.9095104203320195"},"_hasShrinkwrap":false},"0.19.0-alpha.b268f76e":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.b268f76e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.b268f76e","dist":{"shasum":"168bc3e0b22bf15da2368e266e3ff59ad7f8ef34","integrity":"sha512-X8S4En9Z9PEi7a5nq38fq6eUfRKUogJ5t4xRSL1EpiVtOFPtZHDQZbyrD3GtZ9E8SVX2tppzse9fTz0z7hNCiA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.b268f76e.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf4PgCRA9TVsSAnZWagAAqGUP/jv4RX42WUtqxMO5lxZe\n/4iRoUVrwN+SplE64ojIcHA+94MADYQHN2mWrM7KAOJONtIHIwqzSVGZMCrK\nU0nUGYThB7sKC6qgnuVGkF7VsKpxOz9X5XBdgXtbosurDiS1stVAb3QuMkJE\ndI/Cqpjt8mCfpfkv4CWg5XhM1YjVJYi7EZ8kYbxVuTqYdI+EgU69Xc80a8/1\ntQCd+GX9rkl9NT8aGtwLUIaS3M4KIjfXL8wKU5elFbEYkx8IpNagz8OJ8sCL\n9Vc4rO+0r8ezHz/bAqD4+/RnsRmBLrBQcOa+jHbqpjCjzdg+hbvUdVcHG7y9\nWCgDCTI/N186M+TPp+YsBz13t+bwg6as8q0Vu3166fUsS0DVB0NeEXtFwn4I\nUDCLtIhpeBPbUT5XkPwVGU6l28al6OxIuUe4FwOeGnDgB5lzDESqv9cSLw41\n1Uo7SVTElSwVwZCTPmSJp9aW9efBP/FPuz78wSObe7wkytqdgosM6Io0zPQE\n+ZA3KyPEsuD6l/zpuvDXi1dwvJAyMKOxzGNDrWajfPIW0A2ehDwKMgl8Ogv8\n2xGmA3+hNxO+fpLf9iQGL+Q75nb+Kw1LNc2no52mzJlbK7iGFJLdbxlsvjyf\nkOXf9JwI7z9/cdPMiHzZVSY/XAsNt1Ljk/pt8LUftm+kT0d0kftju1pl1WWz\n35In\r\n=8SMG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGj2+lYu/V3E7ynsB08gpsKlvCu0nzmDFwDsmOrCb5FDAiAmx+lJGG7DRH4BGiONyHp2FIm1NZ/4qzh0AGkUJ3I6Gg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.b268f76e_1551860703309_0.891223784781894"},"_hasShrinkwrap":false},"0.19.0-alpha.004d58ea":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.004d58ea","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.004d58ea","dist":{"shasum":"816d681e34550ded4569495a2f66d186add6f298","integrity":"sha512-/hMVUOMH2JmnOv7fut+4dCbFOAwGNAwh5a7JndeZBWBsKLkBOf1qlH5dmgeUdMlWwXwtr1gD7Vz64IRcIvTZQw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.004d58ea.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf4P0CRA9TVsSAnZWagAAD88P+QHUuz02pu51B36CqkqI\nNYRA5nYLXoF/oN1H4ARnEbWqM3bSLRBpu3kXldIjEqUnCAC883smzTR3ZSsE\nl4VRqeEtU/viMHfXx+1HDViQY3OL6jLUI6GEtGv+AJrONkbQLdSFExQqMxQN\nlMMQlXclZsMdED09Q7oRfG2+Dyb1kfuMBnTixtxbvLG1X/3B2Y53FHcjeT4p\nyPbCwWHpZTqgMrByM3WOItPXY/HKYV2d+CXnd2qkvBV1IG6aE1RWu+uKUpxN\nSTxBFVcWO3RM4xyJ9UoWUGM1MqQ7iRWlFkuy754A1f5dFVDK4n2ZLeqTYXUs\nDCDt7bFwcXkrXx3Us4sTQhkBIHB4GFUIiuLTd24FdX3RM9tuCp5EvUSj3NC+\ngCX5n8GHG56V6NERKDMgPbeARAIxiDfkUqOrEw8fQNIS429MkdKWapS9YDjz\nYn1JPNbUlpMGOj6VFkHrwiZ/CZLGpnb4+d6F4snkdeYCmxIP0MmsuL7ziFcj\n0SwBezPkwth0ar6pt8JJ/nNspOx5dWsJHTMVhmMJd73tHGTAz8FI3YdyI3zH\nTUmeHugT4pcNwhE0hGrBU0YpbFbe887ghayJmTT/4bGaux7u6c9TCPIUx1UT\n5pSWC12zEMswg0TYtGkHLd183KEn4PNivwrxStzKNyCeBRLQEfjy+lGHHX3H\nTbQ0\r\n=kq9W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCL86moZlxwa+4JCrS7zuxZGwIs1yiA/xBtQUzMul03KwIhAOoZoA5EMwPswSxsUusowoHOu8MLkRceFvLKgLVUdLm7"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.004d58ea_1551860723429_0.9824079188167414"},"_hasShrinkwrap":false},"0.19.0-alpha.b6055f5a":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.b6055f5a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.b6055f5a","dist":{"shasum":"0e1b6fcfd6c132173cd13d3d20e226aaa3180b4c","integrity":"sha512-7egDIl2S4j5Uh70Mz8Rl8decESV1xBHrcp1sY8FIIIbRVIDP+6hu8pRxa68CZQ/Qgtgv3rqHMq9vCctKT63qnA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.b6055f5a.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf4RwCRA9TVsSAnZWagAAELQP/jnrFHgLhjQTBDmS+yey\nKu7++xmncbdbJEjvd1YurlAED7UNPRHBFHWJOAiWISmIo2MuoeLw0y++YjpM\nhSX0O5kDba+Vn9MiPtCepYOoNzPWzRMi2Z/rTIhX4lErngB5xFi5mIxyxPdi\n2eQhL97GayPh/NzAilalErkZJax6bYKGC2wNqRPcZ2LGbnl+8rYq3Vvn4w7h\nUmBqahvo/y30r14QDXUqQxGVeCKG5Bn4c54iEu9SqgbF9D86U5TnAo7r9+ru\n/age14SAsYqVnCajjlpZ1dCgDCpqPxhnXKabJ696Sq/XC8w7UNVyYzRPUf4T\n3MQz68TWb/SWV1GUikcDWBNCTe06IRfAd6SEgqYMU774sAJnpmzJaSIw6J9b\n8TqqZKbrBUItaqfESP4jo11dAtDSiFG2FiO0s0mM7BfDd8OjYFnm+CsluynD\nHa6/0+APV9uBYcoBVo93m1xIvWdWG9ko8D7xoDmjKGep8lGuUMxLNlQU5kIG\nBGKW1wBKZwNUbHAoEQ7xK4gZ8aiTHwYVUZNh5TlibQ3XJ4X0dBUQ0KONWzXh\nAYc9qVuWqM4lYSrZNQjDrWa/Vkjp1+qHaUeEls8tpekhm1/ftMR9ojLrlFru\nvT+W0XTPNpU/A/JtIgR9SzucMdNcCXdAEOcX6TT9khbEs+R2QU+9zXI2SgcL\nwuOG\r\n=U27O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3mmeqr9nPRzxF8GNadJzzXELVSeBO6o5TbgKMzphGDQIhALjM1E6cquBF8HL8toEab/JfoHBoctenYAwv1uq/RsBP"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.b6055f5a_1551860847664_0.5926581305791683"},"_hasShrinkwrap":false},"0.19.0-alpha.268be0b4":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.268be0b4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.268be0b4","dist":{"shasum":"8d39ba711f44e26aaa3b7c878660bac469d911f3","integrity":"sha512-nxbTxXeEgd7BlvRnqcrMOvLDscLh6/Ix8wl8Klu9oaqTQcMWOBwl9pvL/E9QsiBN74f+emgUd9vzt2UbwAs2fA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.268be0b4.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf4T7CRA9TVsSAnZWagAAXEMP/jMRjgKxsxlTtYg0/b0J\noVPq4JMaTK36KVT5mmI1jEcEk3oEGVDOJ5hTYcZu3e9AI746arCnpqLAxN8h\n60+dJ7nBmwascjPlWadvqu9S9ZzK2ZsDP96Oq0btkD6e4BFPdCpT8j9/NOCM\n9vFGQnqXRJpdQbKyeEAjKPLemZbfVEvAuzny3wnarBopwgJMNyVkp1rR43Dx\nWjWquv+WoUk2EKWfYYRP/tiCq1zphxMCV5Ux74Y2ikcHH74I3WLZ74UFdD49\nT3fM5rXu/a71GhgVXJm66BC4WaQ1TBcVP+QOLgO8F2wLOD9At/BZRk/CQDd4\nb9eG2cbqDwG4wJgDCLq9xvW+cnozcdqoNDmLf+ePmCQjxFRBJFG34cicJO16\n/fc/IjWa7iE7FPAzIR6SdLqxMfEW2nIiO2VveHydIeEJvZaaKxf2tEaVBjZF\nZNg/IgVRP6m2KSybPuA5eYnHW+hHtik/SkbR3bFbY8fIKFu3grazhvwZd+fN\nDzM2uVX+zot0tLckjYYCA63enV+BeJm0ziJRTEkqATma6Z5KUrXp8qD4arkN\nA181ItISziTOuNVpD26mckqdoEro9shZ0oFmSyOO7mUT13geJayNDTAooOgr\n7ODSYlSfLbS+fF8gDW4Gt1gwzCB8nj0NYE1g9wSjgLNg5DfhX5vTAH7RwiHo\nyyRr\r\n=M2yx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB4jk8OXdxX6zdb53+9YoKoauVtKPyB3+AcvQP03feWeAiAjZlfk6yghTto0WMwZvcwY3+m3YcNnoAhqgRkQ92qd1A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.268be0b4_1551860987061_0.1732107142422752"},"_hasShrinkwrap":false},"0.19.0-alpha.12044d80":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.12044d80","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.12044d80","dist":{"shasum":"e9a335eefec10881c8bc13c2ee43a3deb2b507ad","integrity":"sha512-wytms1pqkspnK5iM/jj3yiUfScMewEoJI858K2U4XcHb0tqw+29SfIg0gG8nrhifMMcnrpsvDlPG+lCGZ1MdhA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.12044d80.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf4UtCRA9TVsSAnZWagAA4ekQAIxkdoUaqEhmyfUqREtg\nH+AS9pKx+Dj5W1pbRrWtwgtD0mTJvFT5iRzRj4YbMZTPJlDunb31tNr+u+Lg\nChI8/to/YzuE5yndLTWeWmc0IJr3nzjDIMnkYRsxQnXVPKQGSfbbEk+j0Ojq\nnmPvOC5IOg5fhFTwNHq1zUexCXQH4u9ZN+UMOSUS/zsLRBqo7mraB9oHJhum\nrDpbkGevHV25yclVq5QkwLwY4ATD+nML1+/iKVTiRMBlYxrcffEUyVHwJTS/\nov3DoWKSrlAph4uOYmnAZlFsZCTIBzS9Q56mN/sMW1El7MMdeX5oE4Egm9KR\nMq9doMO9mO9ZuFBG59Jhx7+6yFoLQ1yyZ6/s/LKXKyedGqO3/33uTvmuBoqB\nh4r4sE51RkfJZ/uIpgugy82k8qDaHa+ql0tHZHM+wOriVKAglnP6CzsqY3k8\ngu1/qCC/HGDLzm2AK0YkU0HCUTNDe/8IGhhmrAKkHjY0HzNnWYr2qjRwN2lJ\nLdjCrPB01o9a1pok3rLJDiuYOorJeFEjXMK/NRHJqjvi+OVm36Q1R/652AyW\nQLm3lMlNtnP3Aw7Au1K6K6TpcXcjm8icg28rw9YliGsQ/gcK6cAjWZtATAL6\no0X+cAXJ3nCsL6897MzCTYuz0QSffiWbNrlcRT46VTcXnVwUjmr3mcsdnvpN\nCVPQ\r\n=+syR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICiK62D5fZwmsrHzjdJmXhaTvAb9itwrfHLKY2n6n31CAiEA+50pPbOmNsdPoW1PjpB9mhNwZkKSAOkrFiGhxINPj2I="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.12044d80_1551861036943_0.9878884473178513"},"_hasShrinkwrap":false},"0.19.0-alpha.90973bc3":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.90973bc3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.90973bc3","dist":{"shasum":"1b08d93d10679535dfa1466758a2e6d3158d0c45","integrity":"sha512-wowSbIgLZ6HJdxbMSV4Ne5aUSIl89wJXWAC+PBV51LhgwObwKGEOnwE6xVHEXhWLB5Y2nEphEBpisqIPNz2C/Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.90973bc3.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf4d3CRA9TVsSAnZWagAAQdwP/iLfY1oRcEflUKSYROlJ\nqrP2JcDcy4e6IN0VdudIajAECuD5FrkOu/Byobp+q9vm/7FrKF1D3nlf+Wtb\nBQzQ1dBPn81q1oSJaGiX6kArU7Gg/nYWhah3PjHbtxeYLaUi+CdUPTf2LDzZ\n2tkYnPkAcsOBoMuIUu5jno9cSgoENuYiLucsDz3MNv+AzqpCzI9jDoRlVhfw\nPHd/Xh4Mipu5SdcLACUQoenP8nQ2qsNbQBrG7nbK0G9htd3PT9S8/OCZ+T8W\nbOAHqKq5FFLJZhqc12KbImiU9HHLIPYVjoKb9az7Kvl4lKVXfGaRoV2DtoI0\nlVrNKOQ/zu0WSU7HbQeC6KwoDkGzZYrsFuFqChQ3x7EyYPXNFGwtnHz3Apaz\npxDlhJFCKT3InpXmbCqbCRQwR6Gg2s6W7haNpIKwhCQmFqDgDH2IiVzRu893\nBBsqMdyWOMvfFk6oUqSmkP5Rvn9tz3BHFI+Mj1xzNuk2lW7ppkhCz13VURAf\nwJJxlhixFtPbZVdyPzgyQHda075anfYYhKEc9UXjsgAlWvAEegfX5fSg9Fwu\n8JYBKQv3Dt1L5f9Ti+6VTFd9iPmGdkmSXhg6PiqiXB4Y1RDxFJS5Jlm3RQDp\nshHH10MrM6BaSy8oGwhe3juA8TaiHCF4k7Uo7ic2vNhTiUsiygynLH+LSkyv\nhErP\r\n=jBEf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGrqNrExZ9q9lCiTrVt7ao8GW9WTVtzCoAmDZROCgrA0AiA1hCghpjbRW9Ivg+/r2Dv9xXA37/65cjLt6hs21qXOTw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.90973bc3_1551861623238_0.021325151725167135"},"_hasShrinkwrap":false},"0.19.0-alpha.f78a122e":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.f78a122e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.f78a122e","dist":{"shasum":"6bcf931c9b1a67b6e82e50cbff44a95f0be75eca","integrity":"sha512-zIwwHstMyD/l/nhLgccToO4IkguMKGr0xv6vye0t3HOmBLYjRtpvTe5dSc1FAOWerzim2sh/7Wmw/FHrud3Qkw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.f78a122e.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf4oRCRA9TVsSAnZWagAAmLQP/RAX9sE4nQ/+Hq3uYmUr\n6w4b3n+nuavIkQNbHnz0woVmmvT4oJXeJU/m24fyOh2Ci7OTSmThyRezTlWc\nWVfEz0yjH4Qqwdahge6WhqftU2gwyeExHzxmaSK4hEA3bx+55IciyBO5f3Nq\nRPbARkJAGRuSU1czPAQ2zW49EpnMekVBxhtpEFVm+vig7l98NX8o3bv+X46w\nXm6SGDVxi81gMYOL/oMjVkyRTnQqCtpFc3KROc407DPD5jzYJxaEbuouMrqm\ncCFc1IVsIpPxLB8QaryyoTQv0KKohYzeWK3FtCFu438uoi7M7IrjW6mqnTPo\nMkjY+CzsQJbfx8fUH5SJvnTnmGOREGMn6se90l8D2POGm32M7NuhXeRq35Gv\n0Az4740LXp3eeEXI6W7eWCewnuiVw7AnOOJdnCGLRfwRNFguw2P3ou5I2jAl\nNGQ4XWqOLIlXQxr8ZdCMurmwwqYUjb2bfLhQ1Ea1IOFQvWskpN5yau5JMBLK\nHjDXl+xiFRYE5ePuQopPwJIWyjZLMfZolBxrKQBiafqBuOolcGcVOF0Nedgz\nL6mqRjtD5dJkw4u3ETNkwPylQYBifkr1u1SdEYoF6prA9+3bgnFINdhFfZOt\nLjp6HxLL4FCeXWu5yM9093EX0pslUtAA3yiWouzZ2THz7o9uHqOzwPPrhHcX\n5Brs\r\n=TX/v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTa9SbI79W2k3vjsgIiMEDlboGhC60MMW5Ap836226ywIgcWv78JVsq7AG9Gs/z59RnL+wyPdn1AAQdAdmsNVHSR8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.f78a122e_1551862288563_0.7515073144249849"},"_hasShrinkwrap":false},"0.19.0-alpha.893af3b9":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.893af3b9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.893af3b9","dist":{"shasum":"57948e97bd3480ed993f41f61612a41fd437cd9c","integrity":"sha512-oH4W1AP3GpWq5BO+kzfkHTqoxtQgtqyDxANSL7+gB1pFfc95fiQ+JL4GWbnLpVBtf8AuWh6x22nfKECWr9iLIQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.893af3b9.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf4ofCRA9TVsSAnZWagAAN1IP/jZ8p39Dk2sXvT0sXxcv\nqEA7KQFhLsKFfcdM91hzTH8itP2INdNgLYcR+krd2IDUskm6K+SqiD15qjB4\n8D3+2JiqFsREQ1YZTJZik7+SQkzE/hej3V15T1OrwpKZjhvSRsptK2K7ktb5\nydQN3vhYTdynJjb1a4QNNMmGUUqqe7CQcrmkEGyUze9qSO5WY9PnkW9HCO+q\nFezwW00FWgXZLXNnCy4Ui5bi1+DEN3aSq0IVCREBQugSWWuoTzwR8yo/BquP\nZa+OULEqikvQe0C7XW1QeCrF7gcO2QuWKRqVywbCA5Eml0W2TXirEd9o/ouw\nOMGWr8LJJ8BQirI0cgAo35pKBwB1mRTQLRb7jfqmIFZQKrVMSoiOaaJtZ8In\nvwNrndxGfwGs6Y1mrnpmfSjYi1LKLAT2/a+1roVPCk9V3AXiLGo/3S8qDJ2M\nvQpFX8391wapc5j+c2neDnxi90YNARjMjgHTEjmUQJRwIWeJls4ERiCizqJM\nevrsNHVtVlPIVsYY9S7BNbyqA23R4j9TexwJ3JxDI+CYXmTJdh3wbssj+V63\nDsDg0kMaNC3cvTNDeFzKKskli3bF9FWW3cDm61qvtH71YD4LxTVjWwyaj00Q\nx/dT5CPZWMHoK4v++2R/GsZZCmIcbrsJJ//NeHO/EDyZfGHGrRPxlgsXhu+3\ne2vh\r\n=XWNt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDB5sgOtIIDaDellgoJxLQw+XcWyj1FM7rCykwK+uQzwAIhAOAhhdxWnGJOUDQcuvLlNKFOM2nGdBmAkVL2fH3ZAB2Q"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.893af3b9_1551862302651_0.7275437771557718"},"_hasShrinkwrap":false},"0.19.0-alpha.ba991e7d":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.ba991e7d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.ba991e7d","dist":{"shasum":"c8b42b9435dbc1df3fb48be6c41aae1415611082","integrity":"sha512-c/mWCQcgE5yPqeu9LcYpoS43bvQNiTNTVlUN1LLLKSDKBTENTbFjtuCxceNL59/xhwprNQf7fxZ24EaMMngBqw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.ba991e7d.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf41HCRA9TVsSAnZWagAAygoQAIoZFEz6JOaO9tEbbA64\nfcZo3/+4trHQGmm5998cFLRLlLfw7ruiEZXeFZRKCyxFi+rlonVkgSCUUGVy\n2W/NjqTblLsMIFeezWXteMwkvr61BMDnZs1mJh136hSkQGbl8eSX7fVlkeE2\n5eFcSE2hMuZiHVsGa4+sY1TysQoIECIx+6b5g3p2h6ulhkCvx2+qr8fCbXey\nHPHc/vAkostNxwWGEseE94ahpf5sHBNceKNen2ky98u/Jaebcd+8TnGTcF/A\neL+f/yd/3OJ9u1kd2JvJwEi5hZUWCu8BsCd7FFHZeX/Kp0c0jbeZt2qOzun8\nuxk154xJmyUK5u2yi/g6JkZK4F6KtaOsk7UcCsGcCYSZlw9kR1ki0LodB4dg\nkDRrshiwJsPhDzrkVz3y+vu2ulpo3SOJbVqIrO2FaE7GrcMfbURpN1FJxXGL\n9Sd/zftVaqYiRsFBVolNGIyQyP6nFjIxBWmLZM331JWPX8d0WxD/YkLTCQJ5\n3VJTQLk6kRAA1D+i+jqzuNgmYDGn8s1mPX7SvzOnhzesmECYnlN6DZLaQkB+\nwrJstA5VY0Ujgggu2Uc1LDo0lLjjoJA+7CrWNKQenU+0O7Ua6xska7EXm4Yu\nVtNTtYTqGYG51cQFMRznjXaKhBPxPheHY/h/YkAKZc/tqR108JEiyD/SccxJ\n57bl\r\n=zy0T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfJngv4k2niXFIKa6yd81O7FaEEMqR2CPSvCI/T5dvbgIgHNubCU6PgkXk23kUzGwCHUssrh3vuUU8QZxIE1HMSSc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.ba991e7d_1551863110989_0.5477072732319603"},"_hasShrinkwrap":false},"0.19.0-alpha.c608c623":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.c608c623","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.c608c623","dist":{"shasum":"cdb55b2bffa71806f4172f56cf99b11381314a62","integrity":"sha512-jeDopBka3fo5DyCo/4Sd2ApQDeQrqXxFhEF9zkksjPr5JVpzJCM+Gup4fsl9vDzJK1na8D0jYiH8S7xVuIH5qA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.c608c623.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf494CRA9TVsSAnZWagAAVfwP/39K5kw9TcwB3h7D/rJa\n775gLnBwyLu/NXfiWb5s2G44a2CWPQlUwiwxW6zLYkwd2YLueDCXqk7XYI6Y\nonFQXFPvnmFSkdoPXC9nHf4n0y+ddfzxcyY/SvTd0cFJuGSwZ5ZH6O/VjEkV\nJi0EPb2tL3qe2bw/mNOZ19+98oNQfZ+jw8DCpv1phLBI165S2XdQzIYa/Pdc\njm8xIPjeoXKxmxU3Z9Sr8F+P+iBIB4dH5PEssoXEgjHKi+zOOBTnCbbZ+17v\nfIHVXBv2SJhjoyFMFJzzX/NWvLWrTSTUsJaGKbazYG+T0YF7QUDaBTdCODx1\ns60qV9apvS7dKRhbV2IDfRlIkUGTaSD6+NgbOFItietr8kvoK0C6OsAneKYr\nZaMY0dxhfRDkywyOvwv1sUUHE/36EGZyuHuzHmv27iZ11taHfyEi6Q3iYN8M\ncve3WceWqmJxTwS2g7urp1gFWiPFZ/1nOM01jRK9+qzBzqsReBufP31EhYOO\nVbcBmp6XhMIwh+EHt9JcmxrFKvwQyZcT7Z/LYZTe3DbH8N82vJmjaB1IICLL\nxZTKPsdldsAQK/+/3//1lfknFuA0B84pBDdnQ4VV/GHRbg9xKx5+L3Jes65B\n9wDNLRDSAoJjRg2rCMlZvrAFOL6BFaDDnZSjQ8odrXv25+45U1Jk5burfpPT\n961T\r\n=60pB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFsqZ9zeansE2NAH/7T8aicIcNMbL6J0ph7XmrMNUf3wIgT/KxFPlxPy377od89c7MAbv0pbVbWU22ZiCD3gO6uLY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.c608c623_1551863671454_0.9973172701354336"},"_hasShrinkwrap":false},"0.19.0-alpha.af581cd1":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.af581cd1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.af581cd1","dist":{"shasum":"d7835aad28b1c53cb7dc4f6a0290925eadf8e1d0","integrity":"sha512-s30vpSM6wziu/BUxz3Qo64otIP2ZtdT5EhexfG0b8oiAvJVweGm+q0VtmwDacQI+sh5DIUrd/rOlAs/z3YglqA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.af581cd1.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf53uCRA9TVsSAnZWagAAzpsP/1MpPbrWZCzqeRoUmCF/\ntqVeu1bHJyHpTtlvow1TKdug7pqXdXj90okUNco5sskS/ojJq+Z9E76Df9Om\nWfKCVn4uKcsyOpcl5D6oV/Zd0f/PLNhQhfyE6hY0/yBRKnG234cC7Vn/MFN+\nDQbncPWCpcRH5+Zr87YFg0lQTpAIF9MwxfzT1baYC12Y+cWIk5/+GpiHF+fG\nH1pX2mjXJc9C0+QJxEMECC4yUoCRzxUpuQDneujQaEqGpVsVTY9PVOUuvz0N\nNwwPZcsTiVZshOcxMo7R9hBbW0Svp5yssRA8opI327DiOl412jH/5rgnTrpm\naELSI6t6t+8us4rlEXhMZwHJyAwPYh3XF84RVj00D/MSagU6DAkfyv+U3pk0\nLskVFPGW+ojC95cwoO/YMUtgb74Mth89cy3EmBWTGpAroKsFk453KC4/daMI\nDiANC/C0EmiD7/pNr9s0LEAr/YfS4c4mVFCW7iIZL9qZeEkArAwuKGIhOe5p\n8sU9qUxyY4yl1q5oOB7Ha707UFJPPVu8yoWGbcdWrGxs+vXdR6OYNfADoKdC\n/VQ8in309QxSGJbdy+Hbbqg1gKcf2PaBqQHYAKTBs4Q7ydXZ7kn/Xg26xjTs\ngP0N/aok30bbO+ApRgSemLECuXC2ihT++k0nBnIj7nvebmex1rQF0oqFJao6\nv92E\r\n=e1AO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyOrBQaXr7hodDHPx5ZuIYdMQl9LXXfTyvGY5eac9YWwIgdjy3lacgGX5upaCrVV8kHcUdp+QBKDBktyAMpxIyOR4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.af581cd1_1551867373709_0.12562675104815146"},"_hasShrinkwrap":false},"0.19.0-alpha.f9e4218d":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.f9e4218d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.f9e4218d","dist":{"shasum":"4a57628852e3b4ff9954e9300f0f78f5d9d9361f","integrity":"sha512-7kCPP01Q8mNh+/gkdG4Kcpu7KQfu2FrQILdhVlXa2Ya+hAaOfWXDm/q5RgZv7w1OudPgYCuYh+vik0r4spRoBQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.f9e4218d.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf6udCRA9TVsSAnZWagAAtxkP/RlOVlrhFk94ZjaXNwa4\nD4dTsTQQi6pYU6XQyB2BfAolo7Fl52OM3xcUBcr0ZwgT2+k1v9s8WLGnXglv\nfUxvEuUA6+nfRuZYRO+aXlz4yu2619dnmih3Cys1a2qbuxdHBEReWuUFfFhv\nzRUvL9DAOARNFd8L+2oQ6YF2eYzAuF9YXNLSeLGB4Tv55Om7UKX8RexgrzIG\nMyf4jOTeZvVdF+9otJ1fvwryV7Y5QwOMbXNv6gh3xFkgzu04RggMymlFxcgA\nyKpawukEw6bpp7z9B2TRZQ1V1MKezKOWOrx1Pu4Zrg5yV05O9S9BYZwwT+jz\nzHQ/Fis3K/b1xeiNtG0jQL94BEX03FUfql5t6nDRWw+BXKyEyuHjVoZVHS9G\nyC3pq3SNbaLExs0GAypFNOpjqYgh0bumefgSHMuksUaSMldf9rgG+mCF/FMi\nrx8inniPPYyrTzkPZCOV3kjTynDPQIsWgR+/xputU8+GDe9HppT+N7VVK4JA\npm1isZLtw+E6nLaZwCQC+kLI63VTo0ifg1afCoyF62n7XWrWmhTlEoQKRx2M\nxT+9UKEY5ZHzAbf3WtuZdG3pMfSv6tu08OqnOmJVkpEW/W62Bca/bvWpjRqo\nYi/cz5w7zmauDJQhqv5SeHX7Gk74jL14LhhJj0lW6FaJCLMrHH7ZFM9haSyK\nRKvt\r\n=DJRd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEw8zyI8vovNSpzjiVut/SIOIXBkozsbWvWh65L4l8X4AiEAgawdbVe7mSUguXu7SUS6BXNGOdaPkyx7DhULH8g3GN0="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.f9e4218d_1551870876293_0.13965537935673722"},"_hasShrinkwrap":false},"0.19.0-alpha.efd0a6f3":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.efd0a6f3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.efd0a6f3","dist":{"shasum":"0e2230e52f6eef159dc4a0b6b3b654211b7666c6","integrity":"sha512-JS7CPeDRx49UlsP88yHTP73g+vpiGSUboAaeV8vdBnBjfS+H3qSGOHQ408MYYflfthYLNd8r3DdZ/JYB+Md84g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.efd0a6f3.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf8AVCRA9TVsSAnZWagAA3EsP/0rlpUE+i+fUl25glBJL\ndy0/qOhBURZ8b6ECmouYqBoKnl5Hg3Ka0QhswFnFZcQyjV7O6dDzTcsaooEx\nr3Zn7/VUW9kL902IncF8err9NgUCQiJ3wylub7hbkkcJXJp2kVR6bHi/s1mj\n4DS0y/qLET0jyCMKe56OZrE2iWofCX6M15KwOJkZvJbRA64dBn8PZ6py2zfQ\ncObdxnR2N8Y0i+7PE1h7x2JYC4MWRvMQRzsFj3wcDZoZo5h7FcCV1Ec5Ne9D\nRnIQKBYST9fNJDfogTmPssvbfwOpKU4k9Tasc2pDHvbk0N0TZKAL5Z7d5EP7\n1pMk8ghTUchaaw2fNU8CPumwnPiCZGiWGn9XuH3rdGz3bgU2Zaogd415MVus\nRK750pK7GAXpMaG5u5mc74faxcsyM1fOf5VwtqoBgCg8L9QdBQ3PCCaLdIvn\n3/tr18EHGfKfT26cT7Cj9ZLBXNUyLO5li9esnGPLwMJcboHcuFpo5tcfs503\nGb35/Iueipy2Wrazl6WcS2t+b07UaAVXv8ioXz4jcyXdUATNaG/zJoDtl+wp\nfVneL5YDz1oUyu903hT94rO6dMLfxkUu/Va3d7PwBM/rIpBMYVgGIbLsHkSb\nfo+rKpcbBbNHlNETmdt0vnxSRgFtLxNYkhMLd+yTZE/4tv0GcTJ8lBpyWFy6\noZJ6\r\n=2myN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBuQYgRrlwLBxckL8JX4O6egbnLsfsLssoXDtnt5rkONAiBtO2jlVmFKZK1OGS5CGRgtllbVEOCczxo72hH8fIpj6Q=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.efd0a6f3_1551876116810_0.6686140862022247"},"_hasShrinkwrap":false},"0.19.0-alpha.19988f95":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.19988f95","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.19988f95","dist":{"shasum":"b0cadec50bf2a0b8767777d2e7dbe0ec95af86ad","integrity":"sha512-MIYc1ZK6/6rcpqaCQNmieMmxBZnaV+Qa8tNfV8XFkz4+W7aYPZ53LeUVFMk/jPvQUBrtxNKlHVnau9JTKQt54g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.19988f95.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf8MKCRA9TVsSAnZWagAA2ZsP+gOhjnC/nVvT/R0moVOZ\nOtElbhyLygdopWZn1RxMHDtOmdn/+lK1UPNUuPgfcS/+azHEyk9lKlTuhdyY\nAAdrfSHAFpwEpW7rrAkFO/xO+A/9hvRlT1Ya6KM9kvgefzOAAw2Wc+ZIKGtm\n7nBdqbdz2XFI3vtdqQRSfZVodOnrReVTPRzXW5VlBDjBnwMod5QiP+62gG7V\nZ8IA3SqKHr04WNjvRj8N9rKt1+heqFTDdS7IcTOZ8KRK3yWg4WDYbwCfpcNH\nYrwlbZuD+vFLU/JvieD+KYfwAeyzTWPTfyardYmNmruLEglODJ5Zhm7gheMz\nyBYuVqxDGddiJ1/DMLQ/wV4Kiu94PausSMflyFQ7ISu7EZvKPJnW8shuhVdP\njDfxsB4JIvBHv7DlnW0j0fIr2i3+gyla2E6aXlPmOQ/km6hpMtVJZY726GPA\nIqbl2+vddaT1J9eK0/CNJx4y+EJ38ckCD8jOLBxv4j586nWpT2IcJNoWMrJp\nodUAmZlCXdOj6NJjgBLL9XukDfSoySKwHqGlN5quMqaBD5DrxeHsXabk0UbY\nsATB7K/2JVMkAaDs+wDBa3xWJkbZ0XFe+16ivHRgq4BEe7sC9U0W2P15HZGX\n3yiMgu0q/NhVtqy3EBVyZMjbfXMutHS2568qQlQolgV4wg8ZTAIDoqWHy7v8\napmg\r\n=SDta\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIADcxDGOkt5JsfvoZUkwTKVUTrjjM7i5gbcqofn0Rb/sAiB8hUR+C429olBc2LtWlRVPPG8fvu0sWn850olVGWZfxQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.19988f95_1551876874310_0.6909697864490032"},"_hasShrinkwrap":false},"0.18.1-alpha.16":{"name":"codegen-templates-scripts","version":"0.18.1-alpha.16","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"gitHead":"2d20be06228b820a4ae721873c1557d3912fe8c8","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","readmeFilename":"README.md","description":"Create GraphQL Codegen templates easily with this Handlebars.","bugs":{"url":"https://github.com/dotansimha/graphql-code-generator/issues"},"homepage":"https://github.com/dotansimha/graphql-code-generator#readme","_id":"codegen-templates-scripts@0.18.1-alpha.16","_nodeVersion":"10.15.2","_npmVersion":"lerna/3.13.1/node@v10.15.2+x64 (linux)","dist":{"integrity":"sha512-UdTGsSzaNA226iIYKmV6kbya9OdyYEVPrLPpWTi1qXfI/fuAF4/J7XenPov+ldLKXas7fOJKyz9ZqYSkL5jMAw==","shasum":"ca08702b8d7edf21e4b4567b04cd7fa094938282","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.1-alpha.16.tgz","fileCount":11,"unpackedSize":15981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf8OdCRA9TVsSAnZWagAAVfwP/3LXxEgtZhyOSLC2XfD3\ngkFpF5erCIkl9Y9xmXGaO6cylguLmE5w3aRap9mRgf0Y6RCfqLifmMWHl6fH\nU9ynpKYbRyWen30tw8jLStbuQQIDg5n+XgeNnpUbdevZtiIgPGuTTONSlxX8\n8zOLorb9jBmp3tkamWHKydNc2+zvZBaPtIBlPtsgtMN1xMLm1e95BIqgvKCX\nLP1+nZrzPU+WS7hQYWiLkmddovZueS7Pg5EesLu6z52RnMoGMRMrzkkGD8h9\nhffuF4LiqCSTKE0R2hp8qSm1NcmF9XDEf6ByVq+so2qdl+SzaL3oBCqlHzBn\nJUwBMGI5UBjwQ33fg8JwTGHqpmjmztn2WjJUrgXJBSfMB6x1Y+DvHhmldPd2\ne2gl6plPpd6a4BxNQvrueCagVkInvx5FnIZfm2KRVtff8EUTaQXPNKwMINp/\nj19G9uijlTbV+/fnabsdgEXIsQesRaztvfwbPbV4BPXkWvNIuQaleeCyxVCi\nUVWzgSDsoPpKOGqAb2yYfPA+4wnVGPhKh9tAx8JNMbTubizKPFMphcgSh+XS\nDeRIifKznQmM0j/nebcBEP1p4BYIPPeu/+9BqsPSFjfylPfBIPPt5aN7vMkF\n7MKsUnLHRycTMVeLHLCGYn2A2+UAfHx+0o0wb9bYJCoFbyw20YjOZ4MLaTcq\nZNzf\r\n=PR3F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdo6bWPPY9liuwo6GVfQaFlRCXHEt9ANHKKHiD90wdAAIhAKCLPKDgkJr83OCBCOsxc8PFWIMxg5yObxt6eHW95kQW"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.1-alpha.16_1551877020823_0.8386793504880741"},"_hasShrinkwrap":false},"0.19.0-alpha.1690e3e9":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.1690e3e9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.1690e3e9","dist":{"shasum":"9a41d93c2d5cd4f36b63109f1e6d2e62e91307ce","integrity":"sha512-eHa3IJAPzkYJhuFEPo4ojis/uWlobOlsM80uJ6bmMLWDvzhv2B7BuhHNSWASzUQoS3ejgUC6wP0YqNwB8tXmRQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.1690e3e9.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf9f8CRA9TVsSAnZWagAAApEP/jjNfTtd599DFX7/Wr6U\nNWaLFSDVUKqe0F5AFC2W/anq7W9HIlNN+cntsjfsdMtk2BjsPQf//L0WUw/M\nQeqtKt1pIKWGqm3rJjljpzOVTYaaJ8OmkPo2BbZwH/TDOeBFbLi6/+rXR1uw\nXgxbnfhwnjrxdpFcv8kkIFWIB1Cz6wDzKBd0VuAAHVqdBl22z1oYJhXAG01c\nUbkFjihffhSIDfJdwGFjosEADTjR5PHsSYTIf0q5pU++gu+DPwMERP+zYSte\nHJA0bxYORhReZkSxg86v38wmOl4c26Yo7jBHHqadnQgGaAZBO8I4ym5rOnt9\nswZZwPBdIBchobndaj6b1xhas8440+JkPBxeVe3BlnaqPaXkgjhumGE/0bdH\nqn7NjZIp4g24lNuTrAJfFUD/36n0NhVsjwGT2RP38JS4+19iqKLg/11xOt2H\nNVE+SHqcWHM/VPjhdGlU5ER8JIoSVZZOFoq3Hc42D5cUetcwaQn//dmUMt46\ngP/tNrv4xwAuOJ8dqz+9WK7nkiCsHYlWIrT/Q39L1kU7KczQcHQFGSpqqB0V\nZxJS5iV/Mo2lrJJ2ucqD0HJlJC9g/EeSml1lAQIcPIZ8D8qSCbmcaudOmzpd\nYigu1DvKna/8BiHGUZPBJ0f5GkgkXRAZ2CIZfqgiPU0FAt9wZl3VEY+UcCe2\nV5D/\r\n=Aox6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChDY7r6voQuKeLFObGO6yJ0MbLcQ/HqpWbgceW6DH3NwIgd8MsYdR3GhHq4JbPird2OQlDGciCKb/daoO/wNg3f6o="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.1690e3e9_1551882235469_0.5384436963559169"},"_hasShrinkwrap":false},"0.19.0-alpha.6863e55f":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.6863e55f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.6863e55f","dist":{"shasum":"bff928d46a1d0d9eaabc73f0705c1c9de94da64d","integrity":"sha512-cnczMcqa7Cqf4V7m3wlu/BZh2oRh7vT3bgWwK/gulGxvmpbCBtN+SfW3AICy57GOk5NoT+yfjZV/NZ//Ofpiuw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.6863e55f.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf9o8CRA9TVsSAnZWagAAVqMQAKCHAh6bGuu4tERiol9D\nri5FaTP2E9MHgw032+qUa4JdMcPPv82XunctSCqY2ppqvXs38eduvzt60Ovg\n4qHO+XM6HncSOpCS742jCxEWfyuJg/qPqDz8G45TGD0/ks4Hiv+rNypkyyaW\nZmykrPLo43U3I8G9mARDp/L8nYm+COUvuxzmuzqYuWtd2n8+pyWBz4GZKQEF\nHr2MyzqaEj95/CRMccdN5iFgMVG0vi95SU39tNpZVuPgZHZ1B0BTFYLYkWcx\nlEuWvjw1tBB1DpfjWqmEB/lrBuxn33KaIPP5eCejCGkm15ZKhIK1WYQVyH4m\nq68/xyucQoQVTzpyXHl9xFyry5PNgtacyeYjHnavvPwL80F2nFxkhlyfIdE5\n6x+sKRjgzWKuqVywoskn2Q0UhnO+IGOit9mCHnucHmCem0Jgt113lJzi8xBt\n4ZYgmL6rL4HKix4IT2hgg63SDsLYd7+bt1f0nXD9DScXk188UowGpsyBGbpW\nCk8exn8yw0VNpRYmYGkTxKgzDkiyCY5P2vTuk87lY9fOS5ajR73yHApMOEhb\nYtQI7JU0vG9GJHfbY3W0rYpbi7adS+62QiTOjXCzUD+xB1gX9nJkcJ5zftt9\nCjjy5t7GgSt7Ik+QV/tS3HGTOGkCezpkcusW4QQUEWmnBoL4yg0kXRwsdj4v\nJ7s2\r\n=Do6+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA44HzJfE1Qjlv8QBuF5eTGfBsOJPf3/bgt18k32m1WwAiA2S3nL6BTGZTIDXSXepNV9kG3BbZnt7Ui+DIJtmlGsVw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.6863e55f_1551882811897_0.01769284737050847"},"_hasShrinkwrap":false},"0.19.0-alpha.7ed9765d":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.7ed9765d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.7ed9765d","dist":{"shasum":"78c2211b5fede6e25424f52aabd761dc72d4b0dc","integrity":"sha512-9kVox97ruNGadT9dM2j+Dbk6RRvlIyyAakVe2ZFv6OetGIluy6greVSa+Yfo4mvIoQWeZgCITuMQRvIdakyIpw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.7ed9765d.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf+9PCRA9TVsSAnZWagAAiqwQAJTUeJ09DElGyBvGw898\nxAHyuRePW/uuzXAOKn7XAt58IWMxkPkx6iIOOHKXmo6bv7Ew6JG0HXTnC08s\n30h+wg265Ru1RvTV76H3T1Z9Ql1DEbe5UgGQMqklJGHXAQ8zzGkMJz+95PDn\ny2ihJkHzgKyy3krYqiwBL1lx3UkWaUpDiED6QzwlMuGv8w2qm5aov+8T0Ka7\n4sQobc995iTtkqgzc9lvAQPkXBQjZkNL+07QfTomNie+AmdHORbuTFgcUix9\nL6m1nCbk5W+gTchwDJS5x+RBqNfHi14H1fGAQn690K10Ip+14zsHx2Ci+6do\nlOmTZUmMBsBsDX7cueBMMgBYvqLMrCFZofrcwUi50mTlVTP+Ta+RD34VrY+5\n/e/Pd8lt9FKhyx85nsuQOVOnGbNyHOBZucMbZVXnhC2f6PqYXZ0BljBpzyU+\nJJDZtZQTOguLvZO4ij/PDZz6EgJLjwOe0OF3YJQwhwDHTOqnUfLjb4JWU4wS\nVPunTjBF5OPiZlDL4qJyCDqsxjwvp8R88LhWfKYGdm/VU9Y7m7Y6mH56eVKo\n+OLlzOHw73WJlt2IVY1epOjWCmqENQlOLs0j78NWBmNChSjqW/a1oHDVRewc\ntuL02RH9bcntMBL6wSvYBHZuoemkH7M6N02TcBo2LvXSzIaHqCmZIjsLkIwL\nz+Jm\r\n=468P\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDRU/XEdpiPxie9PittqOjv/sgKEu524QYThvlKUZzFHAiB3xzhdDOaiyVxZFmI6wXk9mNwtssqDjChtELYeQfQ6RQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.7ed9765d_1551888206480_0.9712932041912548"},"_hasShrinkwrap":false},"0.19.0-alpha.b76e699a":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.b76e699a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.b76e699a","dist":{"shasum":"34bc6d08cc0da6d2447d01d25db38fd9c318f791","integrity":"sha512-bfvwee93bHvVg888RcoCTRqFhQ7Y6OTa6BsS3NvfkvFV+GBp3OjIlxxpmmTT1M1B3nIO0nUlPbY3akMZErt3ww==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.b76e699a.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf/yICRA9TVsSAnZWagAAKhwQAIp61+LR9VBtxHaFvUR1\nT+rHNT0eWMQKdhYMib/NINAJDie3+LwDLf6aJR31jB3apTzACzOTGzynj0Gg\nOb9/0MEbx/WM9sqMrM/NLlLKgLn//JJcXIWa/b+s786+5oLD7583FzB+wFTg\neMXZSbjjvGEQUSMNOXlgxI6nJpElHvTkrqq3iF+3uxGRxEjRWoobyf4lCavh\ncHJxWKkVs9Sygn+cJKxSFnyZMSyjCGLl/vZaCUmMV7muc4bDonenW//pPzQn\n7dHGVa3226/41aYjiUYhXQDFQun6rvk6FBjHKTY/DTZscymR2sIAnQY1mJzV\nM8eV46x37SbZH+SqzIF3iThfIyHGmUrJX55idEXe5RlTjUvzHDgPHSshUhzS\nql4dhBTw5lvOcNMmi6d4EM4Q+zvKWLzEhNiJCymCGZtY8YvpFWVtz8A5Wyby\nayr0LZqVCH8fDXpXCzPOyH1DBZ5CBxxOie0rvdAmF3fv0G8guLkt0ybfY6OE\nyKigr6KdcvlB14S3tUHzwgxi78VXgNljCfY7J6w5nDdXDi3kTsta1dTmAzit\nawPttCz9g0OaKq7o83e8zy+ZZhFPKuttnZ9ShYMnrjZIGBZWP72H7amKEukY\nt5+21bL2PqpoqevESwa2bExWzKwllp6JY5rKUQsEwwlR5Gd+/22b07sq64Ul\njKQl\r\n=YQ9q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMBaR182I422PZjeRapRdKw6QrRAE0cDW0zHc7gwRyTAIhAKPr5rkVG/1NdGVKgnDcS9VBv7d8LMrQFDOX2slIi08V"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.b76e699a_1551891591454_0.6891937454920276"},"_hasShrinkwrap":false},"0.19.0-alpha.5634c385":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.5634c385","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.5634c385","dist":{"shasum":"b278e38fb8a573b38123ffbc11781653a2fdd818","integrity":"sha512-5va0lxXSRnSy9fIFMptUMwUqq5WBuJf2RhOdpHTsA7rPaqhFkVGUT4qwEgtYCVbFf+6R4azyKK/qTyndCniDoQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.5634c385.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf/1CCRA9TVsSAnZWagAABrYP/RLBIL1YY5G5iDQnPCJB\n0cTg7Pvi7A/NnKZ9kDRgKet5dWyAJgSoUgAgnY/iEGT4+P1WsIpNR3BlU8Dc\nyvfjsI+54kY0oZV+EoO6YIJjzQCzE6UhIBW4VG3Gj/G+xElsPRRUSkYh4qhp\n6TfSyhYnRYSbIZ55235RXMPkVJr7J95TLkOFpc6/JUca8T0rTwQKy5SWy8yg\nqt98cdm0v6cedrHdlUkr6gB6otrVF0agcwnJJsAGFlZ9seBt5ctRi5/d3UuO\nZ6ejs9hBlJnl9+woQeZlJ4EZ+VeMi9QChG8VtemTNsdyXU1IhpNAt9vB8qDg\nm2PS1Dc4OjXDxh8xijR0YgHc0ZgZK3IK25Qnes1Np6JoNMw/Y4Pf8HRYjpTM\nSJ4WKxCKqfzbqqMD/BNPb6CDOLaS3u0irAuc3EGhcUlfgSsn1R6f2OaEAqzN\n88PlR/uf42oQnhWm6TBfBLHb21PCGx4+eG5blyVnMtepWrSxNYhfa1SB/gzy\nAG4lSTZhp2REf7r1gU/bFVE1vw832qE7LKdqa6z/CzTS0kxFq0BoY62XXQbK\naufTQwu//QEgVvSPOyklkeL5U3bw8O4aEfiAjlR/4quQukBG4jCimPjNIT4u\n5moNT/ArBwWvK4Pccwh0PJCvCCej8UCIRHa8TMMexi71iCVuwxICgwsPodns\nH5/H\r\n=OjAu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAU65yK4PbuZeBHrCNZIW3oqM18m+3rEhm4jTOYTpjmQIhAP/TBy8QIIJvBoSmz52jBOfBoVDDK8AiMYreUsIYngDG"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.5634c385_1551891778032_0.7784622001658055"},"_hasShrinkwrap":false},"0.19.0-alpha.e4f85226":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.e4f85226","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.e4f85226","dist":{"shasum":"2e667c1d843319a00bd4ce50235cfe761d6e05f0","integrity":"sha512-Xs4rCxj47qVmQN3QrE0LgxFL1W6HqQOe21W2t6oH1vo9IZhn95kh4z18qVqJCdktsCRWkk57XLXQopG72kcHjg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.e4f85226.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgCyFCRA9TVsSAnZWagAA6yAP/RBpR+Ntveg1nygp5YIn\nMH8mAgktBgPLY5dmVTCfjLjXVK0Q/6cxMCtQtZnowN1hUIO3a7M4G5fEJEN2\nTNZgx89VGaTcQ626AtQFnNNX2GPHm1GmtnrP+/sWJpkRPp+uQFc0vNz8zum4\nknWw4t5JxLdRRNQS+akzTfzz1tLM3WyzrKGN0T7Le5StEfqFz+EJQHwi0jQG\nD6Sy8wkU6wTmCCH8dVJ51kMjO/cCQd0enJUYFbFmlYn42ZiTM0bshIBIP0fq\n4oDXFoC0RiN86j/JREHQeIfy8XxR6t5j7jXb29haHc7XiqSLT4RgbbBO3c3V\nHUPxRwdTRDkMRBN+Zn/yhjlOb86roP9ue69izKY4JH/9rhAzFW/U29okQuMb\nWLvMtV/+KPDxJdiwz2UuU6tRhwIBMUmC5b0FuiEZXdzHU5G/PZ0YVAI38ATN\n8Up48j3+A1d4KCyqMSb15Q6n3JqzBMXSAx8a0oOHrr+y8lVD+ejKz32YQ8uR\nrOaSxTuiUZIfcxEqhOYcJFZBOeWIh1sBQOVxbuAnspkQBCDGBvv/4nySG6Dl\npTUagCcWNa6ik7aRMPANeyDTiKI2sPAcvITZqTO0IlZMqpW351za4blnny81\nIk4WFt8VuvCBBcmgRTIMxnpC3bI1l1pbHME10Tf45tetYzSK7BLvKcOSi212\nuMaS\r\n=0PAI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDNeXy/6XO6wnsnP2Me84aDJ1VQYp3ME/KjKKVPLSnxAIhAPKswLNGQWWPusMERn74nPnyopfsd8ki2R1DMiODFtIp"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.e4f85226_1551903876548_0.5901173536134083"},"_hasShrinkwrap":false},"0.19.0-alpha.85754bbe":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.85754bbe","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.85754bbe","dist":{"shasum":"905763b8220bb84e7fdd5e4b65188c16239a53df","integrity":"sha512-Dq2Xnvud/KWl4P36+TzJIxi0DwsMGzvt85hS4RPh+mrQmJa/s+T9to4BDqJTs/btkD70UWiqdOFQx8e+sSwxGg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.85754bbe.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgCycCRA9TVsSAnZWagAAJHUP/iRqu2RawjOpRV/0ujMP\nzZk78n6ZlMw7hI/RCSipj4KV1m3qRykT/a2RSZDQa9abhB/r4AXriB5/pO1H\nKKo0SbPPaUOhS5653Tzn/CdmA+AG+/Vh/jFGDSSPhwdDYC8nbLqUfaiRczYc\n+YiR95cff5NNVu2c6bEi6kFbIiuqL4w8erWwTtKdL5F5eYwGfTRQhRjSqE7U\nFtT3UnoZjWb8Btlp+rfq0WOfPDdY6PlqFePqhx+OlzROD2BCBkVpQKMTKcS4\n+YfzWt1fUrXAQdlAXu0L1QvIspkex6J4fe/v72vLsD1B1U+A1O33/Jsjwyns\nKLPnBJE3Fc8wrR4v6lws+gr3gbJGBDBYwRt0WFDhWpha3Cxx9u2F3XizSZEW\nNK81yTQKttURrbEXhKXVCKYeFB+D+lsWj698bFrmdepkWfWacsEKpUQZxcvn\nwClQcvdGqhJ0ZSY6nY7LxwYl9Jr37oeCVi0YR269ST/B3hj2ZeyI7vUG+bwG\n/1gAHyyyZK5qfAr7F6ZD1Lr2x3Z9inqb2VFRVvKs3YxljhBlfI8UJMY6cu76\nn+DX5iLCkOz2NEyqGq5XS5rMQwNNtaMlz6OMgP8thPrC0pQtJMd2kE9frXfu\nxP8bb+yBWlXAKiIjcxgme89pmQj+yUfbFx44Dq/ARsmCradZro4uHivZeDxb\nMBkA\r\n=pTAy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZw7AFRi8FJ9TjPpOj1OIrRX1CvNCSjIwF/lIcVlFsXgIhAJxLU6EKZBs01HoQrrhanGvJLNgV2Dj8I/4j2OtJJyTB"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.85754bbe_1551903899892_0.25854674795107924"},"_hasShrinkwrap":false},"0.19.0-alpha.4ed7031b":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.4ed7031b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.4ed7031b","dist":{"shasum":"0c91abbbb994056062519e36c6e2a7f13fb9b0a5","integrity":"sha512-XUd3QAMHq6YxcMa8wQjW28Gnu02ocLSAE8AV5jHZOYc+pzHMRBExiiivU536eTHGJfu0TBmHshBbpt56Fg9E3Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.4ed7031b.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgKBvCRA9TVsSAnZWagAAL+YP/1rVV0b9RugRRXM9etNr\nE56t3g0vKognzmz+SuvAlluXnWI/j/gTpkTUrP7k/J3IkVoy4CS02NrqSceJ\nRbWK70az47kcUIfnSEmTha8NOy6Hq7bCDCRGHmp8ORUq5JXb6R0OXnQNqk70\n1MV9vbZZkuLJLJBEM/6+YvkMlghR55LM633yTNcKi1+GPtqSPKrn6Laje8zC\nzQd2ks9DUOIXmSiODEY45m0jvM3N9O+irq58/8Q4BudqrsAFHvBm9dsOEJnM\nWJiSevTxesizTKkwLh0XUR8C03iR8OMv01mo7d/mWKhXiQa5SweX3rn5aY3j\n5iSk9b2hdk7kF6pRQSbgylsnOwfPcnqynHbIe/RNuaWg3uQ09qpxqOMDqEQo\nQAtZzMGXxPhoUQUeBkddWAOo22Njs3VBvknTREBPKBuRCFmvJLuLcl4uDMPd\nriCnkmddXvtbprYxIoFE+l4K+lxgyln2x3HaAJG7wupFxO4sqGQxnghgieKr\nkPbyw5MBByfUn/iGF67Ax34IaVosUF/vPqKXQZSz0PdcpZFpwZ9JEIhzIo7a\n3chQd/JFABkoHyrU2kCmzcjhFzW241JXihWbjcAL2/OMZ7LOksYk7GC6S4dg\nfx6adlq1AJoLwLBc5vClrWFgzhRzYDjkRmVC4nX6GJT6uqC0YGysjkHuBUMw\nlZXZ\r\n=wUeI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkf4GsWss6dfOlgmsCobXGo8QpwQZEDyHdPqr50T9HTQIhAL6Ij1OrNzchagsBMKnP7EnLD1D4btDzXM82N65prg53"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.4ed7031b_1551933550955_0.04204637317924109"},"_hasShrinkwrap":false},"0.19.0-alpha.7aea222f":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.7aea222f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.7aea222f","dist":{"shasum":"a3dda06ce6016587848c43e9bf8ee5599798cca1","integrity":"sha512-h2IZcBIG+coJjSv1BdcSMwjWXQFD++UueA8PUaGY1tBAHrgNRStmZAeeB+5eIQu7lGcBw+cIDF3fJymTpHBLvQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.7aea222f.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgLqFCRA9TVsSAnZWagAAq3IP/RLXQp+Zza1iNdXQoNsx\n2E/1EexYaygr3eJSCeYPHM2WleVvPgUd1EnPsGC0QDxUT7DIS8fNMKd1LsJ1\nAp5XMWD9MkYpWD6XIOOowxykJB9DHpyoF+nH1C+8Ah9AS7gCIleErhuoKs3q\nsZk9qVPYRpXNun8x3GDLO8fw6QthaA8UNugsm1j9fGXfWZXt9B4TG9+RDLil\niSHomIyQQcpNJgk5pXSqENRMcaTp/qexfRJOTvd0d6RcN3PBx6jucnxgNUT8\nqPPkO3u3whsHpChBmLFqIFusQiAzHz0DjTkDKfJWHfNA/hjU47Yw0HFWxJs2\nl0mTUhhMW0CYV9V0hHzEPnQkKdvYCdc6lOWVh4klbV1qAOgmdfzEm5iH13Cc\n9rk9DD8OMj0D8mugzNPx4w4iafmt9cz0pHixiOrxmTjixh44TmcLUzL9nX2X\nRBKmxtCJh++5wXPvq/hS8QZ2lXVNoLuwDFmv1g3gxV95KbA9vofxzPH5UCP2\n8MClxEnbWuclMU8kjGrINgfk+9kBE6T3OHIKPswpUQh3/azalf3XkcHejx0l\nu+0Czaz/SKtzGekS7Yavgt6mhe1lxyFfwpzURDTMnjb3W92rJxIedqkYgGY0\nUIbkfaqbbnc4ddI4ALiiZQ/uSxWlERH6DmFGwoetsJkb+oFUC0flYA4NPa5z\nLWG5\r\n=UYfU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHV2KHcYssa96EIbf2QUi4ZFZyfEr0kdCfzgD4y+ysiZAiA6Cr2wMZA8KWlDIzY6Vwe/wTm4TAniHJHMb/CUG2f1vA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.7aea222f_1551940228279_0.6888975758535056"},"_hasShrinkwrap":false},"0.19.0-alpha.81053f45":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.81053f45","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.81053f45","dist":{"shasum":"199579c13923078a146fe02635f171df641004f5","integrity":"sha512-mTB7UncLbRrxmkU+urt4EAy7hfJXhvx1aclZ6lpQ5AqVqxFTqR5gny90cILS9YxBv2oK7/xQrHd7Wni9jxjwNQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.81053f45.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgLqaCRA9TVsSAnZWagAAa7oP/2Qfc4TWRvxfDEEsaFrT\nXbSizi7G5hh54qDTn4sW9G8oQ0nx9w2giUAIZ+trLxraT10Td3AYWQjnykI1\njbTcVR6hcKZBcbBxaU7hRy/JEebNLPqwNfdS3jWSX/P45Ih6FtHdeAXgOkpx\nCsayDjQuIF8djbuYU4nzpJjJmQPH+OAW+rHcpWvsYFAYNwEi0JuX7M4cC3mF\ndyuT2I6A/57WUvf1fEqYQuqvjev8LcPcjEwCW1tHrYUJ6wr8IhFSkPMLJJyh\ncJ45lLSjcCSWd7jh7y1fclEXYEPvj7rRYtdUMIsJvsNQp8YkDiHWbI3RZr0c\nsKZ58app1pciDCFd4FX3Ps/dwRXKd9nLImF2g0E5gtAXUY782D/WomBXF+md\nxcA38XwggRc3da1k8zl39VtLpyZJh9eItlMeb3PBc87Qsli6Tll3ZWzYe/zr\nPuIgA+FZz69SoDOiP2f/9JBmyN2kEPhR3kejGOkGR6ju+pqSPOC0wcdsb5L/\nwtMGTvsnVebxEqwp4x0YwFSUbR0US0dxb9VTu57+KLt42V7slfQinf+9s6mA\nQ+/G1RSVN47Aj1QJOSI9EZliEM5cVVl30BjFwlq2VNdoupFOVwyOdHMkaW/D\n/RC2KfrWotIrmz+aUk+NDMhlyDJIkzrxZQk/k5NHNlm+BkDqpm/0EWhHOdp0\ncBcm\r\n=lUeK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICmJYPG1rRQ9gBXCzYNnkDoDEme3Yl1VJna0RukyHutzAiEAj9VTGJaNy4Q7C5NJB60CkXkNensu+S7AEWgtAzLm0ec="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.81053f45_1551940250092_0.1773912825025743"},"_hasShrinkwrap":false},"0.19.0-alpha.e1b6f2c3":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.e1b6f2c3","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.e1b6f2c3","dist":{"shasum":"365f6239e8f9458a37b1ea9bb218e13cb549893a","integrity":"sha512-USoaQ478sOvGfakWEj66e6DHhXjlfpkX7rZIKfy8JgfnZOmeCkzg7iqZuMsxz2vpe0IKyDZaQDV1z6SSBhuG/w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.e1b6f2c3.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgLqsCRA9TVsSAnZWagAA7mEQAJyTEMeYCDmCxExYgk1V\nIikL2uaxAMs8Asgr3XPF3/N/W0oZssCk8o6CqX2s3w5cPoK38fMUk701krA6\no3Ikq0asaFgZyuZ1cQnbJWwTyCjhygqXXY6Ta/SFhWBb+rylTh8gO+2ASvQT\negwiAWjFLckEd/HtaX+lmpjQo0EaPM0hkszxBpxoeVtsoaoL/EjPwYuF9j5i\nIm75+D13vOeLUNc/HvC0Ifz1g+HaXvVzXiLMAS5be0rkxYN6o6td/BJVyKVj\nJKSa929p0xNx+EfTvHAejFT3ykJVQhzdSbrrvN3OQ3y6MQIvj/dTp8a+kPGg\nHyh3jWfyqE7F+Zjk1SfKKxq9ZZSnVWzTNgWXrH+udvT0g8lxBmwwBpjAZIrh\nd/RakR7psruLbBrSSjT7bG1jWKZ3/EDKv1hmsASDZbw4hPDRUJfp0RMl1HSE\nR3Frefu1is4viAJfWh0q/sFGZ1+jVi3efsfeyxs1kNYtkpSQuKCVeOfsNTLj\nRdJp6dldDbEFMMH01hAOOt3qzXkakmB2lzIc3v+L1im5L0Oyq/QpMfIq72Cm\n0RtbLcoLr6jzwzNyC8TW4DYKkRL3QcCQvLxKaALYsIOlo4UWjI2Zd0rNF41e\neKgioqTnAa5JGecLPXsDn4seSoQPwCJPEqbi7me2mQMYgYAR4BSRwBE0SJ91\noC0v\r\n=aKty\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2DZMZq/UJSVyXFXu+rESpWleOEJp0q/z9207rwV7GEwIhANkfzYsWZznLowwGD0fkIFSXaye+YGDSRuSFsjjrE/+b"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.e1b6f2c3_1551940267717_0.5935061518665214"},"_hasShrinkwrap":false},"0.19.0-alpha.620515fe":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.620515fe","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.620515fe","dist":{"shasum":"c931c7643811576fc8a60334f3029a44568937d8","integrity":"sha512-+wN4b+7keTJq+F5uaqhXss2nps6swuE+5+h7RqxSLpdEcQ7KVF/HOSiTstSYDEOe/dmNArin1a8dcV0dbJgYrw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.620515fe.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgOtPCRA9TVsSAnZWagAAu34P/3q+Ov6HMxVdYnRgtqVK\n6mUJigdM/VWZIIuUem2yozra7hVDhJCMo0RaWDc6ZkWfUm41BBpX02SpP6Wn\nfleVgD9XuOoiwEWilwtifyh2xt0YDN5qkaXKBGzXeefFAN6iCoFvf7M4qP70\nFpsz0MZuIOqjaZGfgc0vZoiPRWMVwAM8JnHE+tCqn1cuKp+PiJn8GkgS7HdT\nY2CPlYhYlhCBo2e/snp3yO224//5PZLG5RuHKp0XOWD+u8EBWDGQkEs2UGMv\nAeFMmZQ+WNfxRQyNVz1rl2nRJ6Q22FgG1vkfFlBcQqonKuAi9MZLH30cXVpN\nYMMEqRiNU1UVJaSH9Spg4Ml70wiPjA9J8lzp3emyDbdT1Af6uOtqdgV7FQNz\n2/KiO2/KDEsZMRPnzLoOB5yMeA7dKEtRpvKMB+/CKnblmg66qtkaNZkP96+H\nugve39VfWQ3TzjLYz/OIOBzjuPly8Se9o5BmxmOnjERqycHnzmH68GdlqFi8\nYg34tncpIvGhN6xjmUtFeBYSI5TRnxZEJ0nvUrgprDOT3DExjqW97x94C16b\n/6fAGQ/ag8ZDovP86U9bVmwRE1ogG+G+TiwhNeVQl5pE85VBK9+OWoeDB9Eq\noMuGq7WOFNwMpRhIi3n2D+z59CXAeDVM4CHjh/4GJJYpfufWDf3f/e15uBGm\n6lbK\r\n=N27A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/MX4fjL/RyjuvcsLRHUJgg5sg5vb1Xc9HGgMAEuHmXwIhALmE/XossBnmSkqD3aBbjkwPTZ04cvKXTPrg9Ed1DGJg"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.620515fe_1551952718980_0.30573093360634074"},"_hasShrinkwrap":false},"0.19.0-alpha.ce9824f7":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.ce9824f7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.3.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.ce9824f7","dist":{"shasum":"aa7c2e8df1b6da217b17e01d46c6c69117de5b32","integrity":"sha512-gCe27ufeP+rE1oS2EVmulzH7q07D0KR/E3TKQj93tuJzkNghyqpVPyNev8CDE8n8yPlmuvwDIpBM/89oLowjOQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.ce9824f7.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgSBtCRA9TVsSAnZWagAAw2oP/j1r73maU68Aw8fWHwyA\nk8HQrsAiR576YgRzfqnVpQVc67Kn/rxfIV4ymfvHJNdEfVyzSCmFN6gZwG5r\naowtuvIFfHvo8n9pRDHDywjblY3JrUKbFb6bMCUKpo32iRtVowRxdu2231oZ\n1JCXluRxllLAwKUBAJ6/qJKqafISNLM7keKIT72gnX6qbo1IYw1mm4GuGmtw\nXJUL3iAM3FMihFQ/hyHQrCuB1WIZB5Ww0Jwvao7UlCeLt+jOYjm8GDAhTY8O\nCty8HhhY17CAL081RG8Sqmi7eauRH7ttsxFL/KnHNIfTYkQU3anDScTepOtD\nA/Da9x0A7YxY7/O+toMw3XRM2q4SGrZG4Cwo+Wq4PvxUoMsNlrrqmb1CKJEd\n3I4oNENLkEIbPAHcjAu031EiCMcA58h50ieQmZBpAf6EF+UUl0zR3+gYtPn0\nYX10rZKvXFQBgb7ecvgdb4mWovfwO4/4a+D7gaeqJ+2CEt9MrtiRtMx1kpJM\nd+xhqJW0hPp1GioxF0nm6UOn82eJ/qS2V5R4TwBHlIasjvNAl/58yNY9Z/jj\nkYulf6kGWFtwr000nULYgycaMLvOJVeup/cMrhxZeRDEL9Q62vqdpL2aHwZA\nz5BwGyShG8hIl0MC5t0cTWRD1PZOKwoofoOJ7x129XgXSHpZcUF65Qefp6Vj\nN/1y\r\n=FdkL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC0M4bL2MEUIqgKEkNf+vXIAJL4WObyjzBYtDKEy3BEvAiAUD3ZSjPr+bcXe72sOjPK6wEOOkV18T8oNrvDSTXrlwQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.ce9824f7_1551966317055_0.42938141223498194"},"_hasShrinkwrap":false},"0.19.0-alpha.80bb6e0c":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.80bb6e0c","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.80bb6e0c","dist":{"shasum":"e3a451ce68b697b8f3f0e659f6aeef1b438deaec","integrity":"sha512-iT8LRkHwv3Nsay6hB3fcn/62lyTEglnkIlTbkwRKwU4SiEyrh3ZEwbj6Ez9OtMTapKciQWangkTUKHKGvBPOmw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.80bb6e0c.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgWp/CRA9TVsSAnZWagAAYOMQAIqAfL2cc1zUq4hno9QV\nudwFtbrr7xzegDngeUYOcrawscXsCuml/qEnlO+f8DHpzhCJIurse4egnWHy\nbwMV+q+CVqZDCu05cqSEov0IQnty0+aknRPMrBpD+KX3u4/Xhkc68SN+uCwd\nShxq3ZmFlhpCCBLxDpweF4X8b3+vlxzen82eo2lUX6viAMIDD5QE1G65S5GQ\nVhb3/bLPOSphkDvDEXb7NFyskjcz6tuAQjDPcmKEP3wSk3mSMZtNdFeK+NvK\naPRRKG7CayFrPOmVQO033yjs6igroKKn4fRFAE7kkvptksbO0dlktUOpmOqH\njSUR5P/YvvbGDOs90y7lhJL9cXxU55NkLghG3rGXs9KYbksCfo84I/E3Uqcf\nbvEmt3G1B0QjyxU5PIS4P5qVRZ90i8OuArwA9xWM9Rglo5i+QY2NnXtuuqFv\nL1NZ43H6P+q5QKTPlMJAd5W+p1UUhD661IC/IIaPFAjr2abnR1hQDnEmDjp1\npZblaXafcWdWxhZi2rypsKXnH+nHM8I+VmhseMuLOi1kTsqThjnuVBz22Xst\np9/LfQne7nAy595+eT34NhbsLrhKCMsnBbhakkrwqykkVJ3GJVoG79e8bWWb\nIxITtULFMoC+eoQHrPEhthUFalasrT0Rmifw4Q9SzLhiwcI+z7wpgJgnSEGz\nKMS8\r\n=H7Yx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEr6u8KQ2Oh6estusg47hDkEt6sIQwwvnOXJwO9PgpmOAiEAx/hXy+P5UyPlTrPgoSwdZUZkff3KTykDaqfKJ2m+IIQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.80bb6e0c_1551985278316_0.2510153130315822"},"_hasShrinkwrap":false},"0.19.0-alpha.7c0f61be":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.7c0f61be","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.7c0f61be","dist":{"shasum":"e6dbbbceddcb201e2aaae24580132ffa2da70165","integrity":"sha512-4LDPfTtFOH98tPAvX30d68/kfO7cICbkYit886F3zrW1vOIIvBhxgmfdMncTLDfyLAxmTO25pERKUHJomn8Hew==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.7c0f61be.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgXaHCRA9TVsSAnZWagAA2egQAJg8zFXbsxElt3nUApsV\ncUlo+gnpSOVnztIm3gwTKOyTW13Q5cC9TfL0ynDoV3w35ACrPwF3hid2asK9\nVNuF0j52VLoncNZRtll+vB/068c13zPkpWIxrD9P5v/QACqOZjQsQKGM5hqU\nhq0YLfhRwbspH7oCg2Ejk0w7uaHajSMiK914BaxqCONEHjjfgXlNDJE/zVZt\n84TNbjxZjeRyUYovZNI6lQOhG5nd7KFQV0YQ1KFxQ3et8QjMGllQfBRR5AuB\nMGGTyrX/EzahGjTjbKP2+CKwrUQQz5j/f1JkSGHNn+9fWxLJ34UVJdg5oQXZ\nBo26QA93TmkSSvKtnWz7eYKItTOeO/qTWYGcmP8oFXYtebBKvaL3DAWtOmA7\n6ycsFE+aWDziCgksbuzIiRIe/poYKyoPjQZuEaBkwm6DsR3uncmq6sXK+jlH\n9n8uAtWc2HjDtxtKXLD/wVQ2bK4vGM9Sbw4sNTeArVuDy44QvHpvkdpgVgcV\nBrLyK5p/+eURkr0FYn9cbNEAU+HtLTwQ6NcdrKkVYASbH7swlaWtQELk+veG\nrs1Qdx9fheCTRBLigR+lj2XK+onQZXtGvTFpvZet4BSrC4MkwUXZva4G/aND\nhQlqbReEqYrlqaNFVJNvSljCaq612agvr+53vlf6kKn84V805akUBUgVOw4+\nu4hH\r\n=vD7X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7dk5u/74mxvgRpY4oXtFMW3sz+IMMjbNftip88k3SqQIgAmTPDAupX+bO0Z8DBSttNKmqpqWswGzjPHTc80ahlXY="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.7c0f61be_1551988358886_0.4924633231300326"},"_hasShrinkwrap":false},"0.19.0-alpha.50be825d":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.50be825d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.3.1","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.50be825d","dist":{"shasum":"2954bc7637946ea4f4d74a4611176dcdf42e7102","integrity":"sha512-22/81k63g1gG4aeYFc0jBOqsiH4wi0gtoGuim3GK/mNGanxfu4VAxNKgE0mnCWdNErOqKcVU1i4omSj9xB2tXQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.50be825d.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgamGCRA9TVsSAnZWagAAEl4P/RYwzWvqBs5/YA5ZG25t\nmrR9ePvcdRbRXuFsvV67h359EOFGZkvmCPKmh3qHaQDTNxLxdSjht/0paR5t\nOt+MQRRP3FjyNhO9QvylETZqA9uHC4l/uJgT+bZ/yZ4bewz0uJo6ofDuHPj+\nEnT4C2TfWXwey05fKuPdS2NYvCYlkb+/UkTm0IewmFH/1w1togWQrJLi0ONH\nvpLJ/ybjo/u52b9l6rQus4bjoPOij2QVETOzkqAXblNwDV2kcS1jEoPgPvdY\n+RKdNFemDXRvRye3KK7I9AGDKGYRkw7nJ0OZiNQGVqzqhM7h0ZhhggAHNQxA\nMRbb4+ZK31Pk0ZM5Qg5EAWG9FVUgryg4GhbtLsXbkvnjH0VTR2SXw4vCzJvx\nbJflFdwKB8cGgSWK0fNygTl4eePvPw4VwM7dkUgLPPmdrY7CVnxI4/ks1G2x\nfDG+bpRKMIQQ5QhC6KHhFphCJuSRQWK6IoBEtAjazWcKDBA8Q0tIJnKBYOWy\niVT43RRHh5je6p+t+heVNN//WfDi+S5QpdZbj2n1NzuO2iWhwKsncyrf2liD\nU4ArUZcpRzjA+NT+9GUbZUZdqQanFR/zvfqbZde0BZn+mv96coihI8890U4q\nGY7uYnjfCtkQaKBTUuLZKIcgOYi5OsvmwCqbhEnuHZ4UhLR8i2CqUpRWbC+3\n7KIb\r\n=Gdro\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCygzgAXH04w0mL0yfSmaJljP1F891JHdz1B/wGv3BfnAIhAIqf7IOoa9CeM93ePSLLjgsrvwu7tHglC8If81PpEEA4"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.50be825d_1552001413178_0.1480553816788983"},"_hasShrinkwrap":false},"0.19.0-alpha.a0cd86a5":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.a0cd86a5","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.a0cd86a5","dist":{"shasum":"76b20aa5ed80e3cc522aaaa00ce672fb3ec50e49","integrity":"sha512-CTg63E9llvu5EMrspvv8MwDd9/tGhLhZ6I7WOxszKh3Z+LsK6LDCXuh6+d8OMcH8udM0xABI7ti4/ePKYX8T8w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.a0cd86a5.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgrrICRA9TVsSAnZWagAA7fgP/1W7Zg9P30UyW3dIaSTo\nPzbn/A/x2rOF6IL0QVjdciWDwuqgTUY9yRsc6/zH+ZDV6JfDtvY+2MwJaZZF\n5K4ivt88OhylGXlOW/avUnxpsSKNecck1MsL6cU85WCKnc8vufZRiw46dYdi\n71CU1uNAo0Xk3WT0gIFTULTjk5jsrfVcKdDo4Sypb4gGTc289mRv7QwftBDc\nVAuELbvcVxwFVNitRycD/Sjxitx9GOrM66jQy9HicoOSfaYY8V2JAOUfiKAU\nXB9WNFqPpneVl6sbTHftAfUgF5d8jPlqUqj43a+CFZY87tSJYAZr+t9q2Ir9\n4GugdVVlKZ3ElWCUTCsy6/agIFMUf3kwSVvZ9ZUB7LLmtfwEndAkRpGcgXwm\nH/0bkYWTkU+nVaklCSulZBCUzuIdPAS21XY4ESxmqXqH+ebqnBPxhx3ELmzl\nA9n+eQxTIUOxYEJesidkmfNoZEl24fAIlk+2X0S6sd1hD9OAKwamwsxPYXvN\n52qphkKRqUhewlBdyenVrGlNimt1GpsfnBpsC9gMFzcQE73MOHLw6BuTFW0L\nKTaXm0MLjcftJMq/I/ry2Ssr7yqrYGzqcmS7E0wk4CIfHSwfzUYxSeRLdFCS\naA4yis2kOcuRY9H86Q4sQYqLtfw0xHLwMKVy9kYi5iQmHrLaFETvPAgE3EAB\nI8ij\r\n=B0ad\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGIs1AZlhAroP/u/qBwyBRP6F7Amowcx+aHbuuvt7LeMAiAe4c1wyHgQujTg5sKTcgN7A05OYLsrzxNMPLHeLKMcSQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.a0cd86a5_1552071367706_0.05229154438755601"},"_hasShrinkwrap":false},"0.19.0-alpha.45b0b826":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.45b0b826","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.45b0b826","dist":{"shasum":"2c1ca77a374d72a61e3d0aad62c040b53b810e34","integrity":"sha512-aF7Vfo/gc5z2V7S8byfZ2ahnCyOOOmKpW6l0uou3K5SVAWW6Bw2uc1iOS61Q04bKu4uKuA98LfjfSP2e27txHA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.45b0b826.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgsQ/CRA9TVsSAnZWagAAVNIP/i+9T6MULlbvO32b/n1n\nhFSXo1KrFNqaCAeZXZFeU40JjyQKzBGlr16W9UPxGiWnfHUPFT0tuRnQygxT\nKpOggBd7CFH0a9eBxgXkdLNLIeoM19AUvhOWYHGMpmg2YzGyFfEZe0xUPd3g\nxOy9ZRpSg2d2D8yn8zSU8sbNLxoc99rxxk8wvSttPbFrPhz0e63PIy/hGEuJ\nNsVWlO62IgyPgumqTg7GFjtNodCJ9JkAshXp9yTRiGQdYNCf3wJdcw+ZhUdf\nXZWU9tXE7Jso/r289bj7vgetrjZAk1moWKNdGFBGaSVFre0J+L1RTzWO3DNs\nG9PWojbwY+5036qqU7ffUOij6IzwKJUQjgYc8RO8gOEl0e2MS6IhLqXGPvRn\nM/aEcsU3WcxTtKovP4T+d/BHlT1E8rGsYEf2pCc8huy9V7CMMiD252+D4Y9j\nxsG7Baz3mY/Qz5AkjE6qhD7qlFymMekw8br+iN38gZw0A+oqmLs1nZZLBFrE\nJ16hF16yg+KO2OEC50Gn5hfWSb1Sj6xlQZ5Bpaegx/4H2S7qphb24GrCRXiL\nCpi5IyMiSnT2eb3cnj53kOpJtMHYrbl8p8uCcnFO4zlnjUWjMfBAQGPCvKrC\n4KgqHjO1pVrycisX1btmGJY+tr1nMxDyxqSlPUI9uEgIh1e0T+8RKXFRbojD\nqxmC\r\n=xAM6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGaz03jsxSIO4ic1fxq4EVCIhnqOdS6ubG3cVgXmWZoaAiBoB4qJI8+vHAaOqXKe2CxvK7s9tZjWPhvMfe+qlCd+fg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.45b0b826_1552073791039_0.38736432249860697"},"_hasShrinkwrap":false},"0.19.0-alpha.3973cc8b":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.3973cc8b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.3973cc8b","dist":{"shasum":"fbdf8e1c918aaeb1e23264dcdf5b1ee3f1cb24e9","integrity":"sha512-BQBga26niWLLmwSULebEemx1ZBAXGkVVF/kKeUPv8St5aj80o94oi9V75bUwEB5w+CdCLSEPZS5xoXAQ4E84YA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.3973cc8b.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgwnFCRA9TVsSAnZWagAA0P0P/1y7UMx5adcXK3IdblEW\nhV34cnLnQv4lE3BnDoHFY6JvBAKgpNN1e6RMF6kQ8heakzFcJz7eHg3Av4hN\nDosgOM4SI1evU4wcXvXKnZrJoFm51WhA3NILs8gpGg6S3DQQKihOcWcVXBj2\n1pHMIXZ8J5F59gIawmUC9B7JIdZbMQUC2Rdcc0fQ/StY2O7OtN61O0ghyfJl\n6FQh23PR4FCRF7ONbyZ1T77FgzN1piYF2BDsl8BYHYbDjWXJJSJqlHm303nZ\nFjM6bAZrogj7thUY1mPWTM34JITJcRA+7AFI6u4X2aVyxmxAK/9+g1bUtv3+\nfmupBlY0VaxnTvRvCGh46l6UW2EDlD8nsZQ/7mgJp36VmGVpvju/n048ZYi8\nJKhSoPRNrWI/fL5fCHswOhgYY5l7QPRHE3NROjP4jj8L8bzhbNoF9xQ8icQv\nc3Ur6bduuxceR3uDMnppBtSe1Gq4zeAl4qyAiMidGJpMB/CjZKY/Hm4Iu/Dd\nRB8GfekyaxE0FGnFM/HEqyzHPKUxdrh9OSOCegDVgOd23D7BetM2XIyhKwIh\nESDzB7Pc/BCsgCvtt4VC9ZfoK3tVJPqe37Cdiso/gPzCVoRiVqLOFY7mmNQN\nYDV5U2qAsmMfdgnLKPMhUQjwdtU7J5kpNr7pj6cu/BCWz9/smOB5iaBlNezJ\n1PvK\r\n=VB4r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDGSow3kVO2kJfkWblO8XObd/7mEEDUG61RtUOnpioU3AiEA7fK7lSO9hmKGxc4X0nP8Om54pJbdYDWA/i9nPP+iTk8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.3973cc8b_1552091588874_0.5534023699289661"},"_hasShrinkwrap":false},"0.19.0-alpha.ceeaf808":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.ceeaf808","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.ceeaf808","dist":{"shasum":"39f46bb9091e4f3b9c88d0269c6d6a6d68dc744a","integrity":"sha512-9bGmQpHodoMIte258oWOqDvoRfVevR4psIhfKYTQ/M2Wk/RcL9p8dAPe7hTXjkcyjMR+0fzAiufZ0bSOsNOSLw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.ceeaf808.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJchiETCRA9TVsSAnZWagAAW7kP/iveHSAtZh9n1YehleFW\nCO8FiT1jZAznugBR5PfHrDwClvmD5bkFxKzBepTbklj2U0bT4gK4kjPkTarf\n8HYfThCOjHVRsUTr/cRmDYvnMPvojhYQFwoicbuUMP3s6aj5vyNjoK3PTiiU\npSIqp4OHKcrrYw5S3NobtHwqJKeDznbZbuZyW9hWFAAd+voGfnV0KSR2DDRC\n/uK57pwjw5pDB4xJ+rRqPCOzJmvbhp6SBLpilBc9pG0i8P/xjPsS+k6QIzl4\nAlXkgsHpYYfOFOU9MAlF2WJPIhS/LvGh8kIDhgX4o59X8dMFcFRfyYs7F8ia\nhciklLGPLu8h050PtmNbVL25+EebWkShobNqUnP/2CCbtGdbsR+jJvgpKX+L\nCmhi/43lPYKIYkK1vzgULbRiGWot3x6pK8PNyijcytfmM9G65Fb1IUE2Kgvx\nAPQtKJgysV7n1ymxBHQYrFE9se2bWHrgbW2jjS1ykq12oziTka8geFdsi33m\nCYYaNcWp5Ws2YWHUnBySJYDF4DtwZUFI1CQ5i6QkePQ5rGoLIkS0DBAUBFnU\nDIC+qthCBeBCn/ga4mqFLZuUhUGWUoI4SLe7/CAS8IC2cWGBx5EkfDKuFaxO\n3ZJQvBHFvE4hoZbM9PHtf+YejKcQT+KHtXO+3yuzu4SUhEhcDEzABTSNTJd5\naAJN\r\n=9sGz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA5smhACMrkTi94ALfLy6iJDfZqv57WEIDzgvR92ZFRNAiEA+Emmwc2rG3K9b8ScOD321O5kYMmxPQaoVaLGWHuggBg="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.ceeaf808_1552294162547_0.43113885711631883"},"_hasShrinkwrap":false},"0.19.0-alpha.575474d4":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.575474d4","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.575474d4","dist":{"shasum":"ae1d603f775f98a81180d26a200950ed05bdad62","integrity":"sha512-TvgqeZ2EtERvZBHRVB/aSy2kepxlruytNBcQ0aQerStQ7TaFed6K8WNPiofMLum/9P7/xP9Rag5jYhzxpTVHBg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.575474d4.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJchiEzCRA9TVsSAnZWagAAkYAP/REqYQN0MCsRqKKgPeOS\ncw/vrzJixLgfkaDkKLbFhq7WrwL44F/JuinQwN7pyCUfZRZcFCBsWupDkF8+\n1fgN6nqHEMq8wCozVsOMkqJfERdufkPTUXz/gbhv9ChtuqNTY9m0s0foHd+p\nJ6hXY+LFy3f31X1SQxA7Gl7+1Zb/5tNHPZ6W2w8FW7bq0NFp0G7v0FFZmO9p\nbY1zs0s2VNtfb4w6n5STYIcvmZKgNTwCRsIrmYBPqJi1+EdiKIepPBu8HVSY\nP8V57tp/yn86IH6b5enXEq1audQxQM2N6lkENSBkpeEZIPb6Rv1VjBwbIm3o\nVKFsaJ2GNh7aLX2RilpY2apD46vNodwHaviV2DBGgxCsNOe65kysO7C/iTSr\nmcIycup10+M7w1NgTqnhghBc6gRt8rKYbC85cHjJZw+z3n9gmGZWArB1HGYx\nfK6oyZ+Oaq7WuDgZOTarlokxK0cMsGw7uvs1cMWQ26NOGVpcBMIVdbeGuLdM\nfN5lFlkEDvoggxWlhtSL2ijMga6/fyIM40Nwom2P3drA4HTimnOfc63a0Cp9\nweMWrPyrgjTmPKvGIRS31vsw+DSKwrcNtk09UXM9NyMItCOLpqo4aaetm2zz\nFs/jt53xipcQ5NQOFQ8f6NWTm4ush9grTA3FBGO+2ZyQLHMrxxCgGrWTyih9\nuYkJ\r\n=G1jb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1R4vayTK7zXPO774TVIRJOFstQZ9dqE18B9tUMROqfwIhANHqJoymJd49A+ybSJTkvZ2qFk99jmWpx9LIc1GuG91K"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.575474d4_1552294194860_0.6113850319732494"},"_hasShrinkwrap":false},"0.19.0-alpha.edd84a2b":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.edd84a2b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.3.1","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.edd84a2b","dist":{"shasum":"ec0c23f16c8bdd7106c44e96f12b842de83e3369","integrity":"sha512-Gk77w24cefpTZlYYa3FQ3TIxENcyoMSizkXFdo3K6pQ2V0vNEqZRfGfz+hpAF/EO/Wy8nz6mRt0kNw9O/ai6EA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.edd84a2b.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJchj5rCRA9TVsSAnZWagAAvwkQAIIpAWmlP9BT0BLX0qUo\nG1a4Ft5VkGx7fm4DDMjaDw0f93VMONZmIHk5AsW7DGzi2uOtZP74XtGw5rZJ\nHXPgVvQgb3DpzTdVrWR8XBfRBtHZOBEw6ZoDQRe7mskYX8xx+osBiotAmXLC\nK5hczJ72OYm6GptIAzcWWmLh6KzHG0Cluclyk6tngHVOOmLjqOPwxU/PBq2v\nVjqrxrMOEOT60ard6HHNaflBWZ/iWnlA89hY039Q981RG9rNKCiTCkcqWGLq\nRkhxIM47Yz+n257a+vgSAmwMWy8oln1HmKcYEjV7b6+pbQMKTJWjAVsCLX+N\nikBdNTXz40C9TCsnk0WI6xNsJSscliebe5l/N8REyu6GETmZdcRF+XF38W+x\nuWpFHGGy7+X9AQ0JRou0qjHdNQjxvq3s2hbKR/VQscAXqI7iM4zUFkc6x5ZN\n5QgkuXQatEqbmy/8W8enGuan4nzDdPN9qYy6Ptf71wWR/+afOXFJ5Nulgemq\n5YPLzk+Dmwr0KhKa180nFSzkKTSn8xSadSmfURWbG1FBFngQI59nqvJRhaAl\nYY8wBKAp6Jf6mQtpR/4G1xdo8O/MoeixSmQoKqdO0nsegqvwhjrNuXQFywRL\nQgvYPSjNLmuoU6gY26mRSZfnMy/UALRN9+CmhyDcZm9y8dyudG5xg8bIOPkH\n9CU4\r\n=Nkxu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD52bbfI5XjAumZgzgvnKs7mHjEL1ORH+xqPki7yIaIrgIgDDSuPD0wdyLnFzRDc5nbVsv6trBQvj4+iTG/mEUqgH4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.edd84a2b_1552301674936_0.9527169160386311"},"_hasShrinkwrap":false},"0.19.0-alpha.35a9f308":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.35a9f308","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.3.1","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.35a9f308","dist":{"shasum":"53900a7162506a100c2c1007b27474939bb3c4e3","integrity":"sha512-k9E2ZndcWs5vZg9ymRtqeTx9pSV89WSj/rxo2F6NiN6CrYELcWjCSb1pOEhtuSgnQ0I9A59pkJUH+2w/HwCGbA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.35a9f308.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJchmK/CRA9TVsSAnZWagAAAL8QAJZNv6TCMKT57HjD6VGu\n1zShxu4nFlq/dA6AlgSzxcTJsvJ0jYgAQeu+ER0fZ4cTJhhdVewq5OizihT0\nWrqdrG93otplzOgwEdbUne1vnTqvq5LouFHHlXIpANmf2tXyi8+fX/4TjjtL\nEiFXm7JTwMd8l9BzFI2HeHnHWqpZux3/i++rzy/6lIc8SyV5AAOMg+2LjYMS\n7t4eZ0XvGmN7dKsD28nwWXVyoDOcvgD07gMijb0hq1srEEo5uZS/iyRRkN/A\no6D+OU4uv3Zvefna9jD5liPAcJP3OokFhwWHm1VmaQL13nxA74O0BK8Ax4zu\nK1VMuveVEwNIwtoXV5hSn4m+LsBCZ9IV6ZWri1Ni4hfF+7jUZqDUy3oBtr6K\n3gz2v0EoItTbi4eYqh087w4irpmBXmAaoxE5rcaoWFTOjcaYiGhOKK8YJilu\nIorG9HMzaXBhEXQFiOWv8y/ddx0xAbE8jfOMnob5OLGk+GKy8UP7ApwWw3rV\nFq4CVBakbRPdZCvdHpO18kz58O/XFH/jIEkVJ8Bz7me+/4tLOStQDLFC+jzi\nG/AwBazzZRDqKrao4wibZHfJTxJlTDPLPxYt6f+V7Z54pnEs65CDtMdWWJ4D\nVP9sLnU8kLdnCEKAb1xAnneYzR9fKgbcyTQxOoI3ZBeeVWjgaBtNVKIhIP6g\nKO49\r\n=w+OQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFh4CFXa2xvsHQwTvp+0Pp6rdZHKsrpcEiYu8NqOrQntAiEA0N+oalCsTDaIbqRHLjcTjI0nrADc0mBs8YrhjrORIMs="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.35a9f308_1552310974128_0.18925125494200024"},"_hasShrinkwrap":false},"0.19.0-alpha.6299609e":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.6299609e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.4.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.6299609e","dist":{"shasum":"661faa386dc54c03cc31eee62eca1e26bba0dd59","integrity":"sha512-s0r3dPXm6Hslefr1bXqgYvet/sFP/QTfUSG/48xCijxv5FNK+WbjyJLNG8rv9Tk/wTLLhM9ppNCEQU4rPPbIhw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.6299609e.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJchnrZCRA9TVsSAnZWagAAvvoP/2hWs4qqrCwCcx2dPLFP\nWDNptL9XdHBTdxJhWzqAxEMijof/jaEx0mni3OveOyeFUTp2AzFWuE6dLf6S\nD/yMZ+DkIx/rCbg56sKLMX7mbnia73x4sM9RErnj250ZM4d3BBlmtdxRkqlJ\nfAbDKyaYY23Se1/z8Q+6bK7/Kd3YHqR08eE04BEY22S6C2KpA6iKzgfkE+wD\nCBbzW5GgjFn4Psu+nVFDVUOSPggfuE1i02Afjg1ReBfs5bowU/jpR621uqDZ\nub8vA4ppz+OkLimr5ORdrKVTkuAZVsoaNx9h5pR0Lg7oyEUh3kFQrhdae3WY\n5bStUg5h+d680rWdfaGhfGA8YOkjwIJnr+zQUqc/YL0onUP++JVVeIA711f7\nhlTFdp9jyJ1u4brce6JWy1mPzjoFWAFh1o1uvDeDn2kqF5jtIaMfq/7+9obm\n+0Uta+lxYlqZCBR8OCkrhI/Kzk7+hzTpTMaRZz1HSHWzUOnCSzfZRq1sMFsz\nVXilxf26+AY0nzctUh+p+0jNLEWEIOor8RhymlwezJkdGLYJhEoT3mBUETAY\nI276WJSW/9HqlHDJVyBpQYozZr+rt2f4yfj3Bm392Ymu2p9jemudLEtUFrcd\nJSoRlZAhOpPuBG81U4aj6+Jt8ScncxJmpAkFKV6oeUwQIpUEoYraef4untS/\ngsTd\r\n=YH1K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYuMAJxgrr3Z9oxuvM7y8t3GyRPwj1vkacqDvaWdbW4QIhANvgu0W8pmx3W8WVuc6ErsnYEz1u0aHrjgbjvSCMaT8i"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.6299609e_1552317144446_0.9233935229920829"},"_hasShrinkwrap":false},"0.19.0-alpha.1275f653":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.1275f653","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.3.1","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.1275f653","dist":{"shasum":"839a804d7e098948863d69f431be890040e07873","integrity":"sha512-FhwexeyiYhIULaZ09zOU6UVcsNhOJkdD4EiOQEW64IPMQKcXCY+Ki1ySZvl3spFTEVj4rtBk37YxmBytmsPRyQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.1275f653.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJchphRCRA9TVsSAnZWagAAoGYP/342qVMCZSjk4PCd/QFK\n8FbeIlBloO6V9scbvtIHnvnFryu9X7zjjjdfacd/l8qnCdDq5FCdjzBAeX2P\nL1aRb2QgoaYwbbivFcae6lMjqi+Wm6m3IU94pBQ62sZUS0bn4/+Ebvw54lMf\nD2VQN/7cvVmgp5cXEnBCby1uaO093EGLaE88t9dqXZnGjTzi13xwelHpcdsM\n9n1c1ifKJXcLpVajmfblpcLPmvHVb208Ps7pPUIbDDSHHYdfX5twj5u4rkgE\nOTdkw0+99a2DUBXYM7KSIlxVyiDjmxsA4zdQETrTDmCMK6TZ0EsXE1EwGnKK\nTnZ2LO4mtNLPpYwz+y4JZR8bXMnpoC0KWGIG1woZUej66+3g72Sz4Cj6i7Pb\nAWZGZ1SQjO/W1xZlVXaXHcslkI4E8Z4N6lj1cROSbgxO2w0k7BI6NCUXtEmv\naQvabxeT+lNAMHhnT8JaCtJVsXtJhkqg4MR6O2lkuNuRgGpnavT9hURC96+3\n1RyeyMI4o97KZUEDBt0UxutNcC9nb6LCU527gnrozfpsudpmrNiuLmzGX+Dw\n4Xf+/9spev+f+Y5jaZo/kHk5egb3ZTuBrctbdd40HBB5vj7BAb6eOlMjLq+u\n3edIis+W0gM5BL0Y2kQISkfZ0bak4J4U93QaQww/aXz7fGhCProT7R7SUSpn\n9IKS\r\n=7bfq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE9W/5Jqf8pQW2v5cXtf77LwObwVArwf9+XdwTskQf2PAiAN2A0/Wvfs+vpZ2zAk3KVJUZpGBNQ2xWuDcmsGTmloiw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.1275f653_1552324688469_0.2357302113442623"},"_hasShrinkwrap":false},"0.19.0-alpha.e74eb07a":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.e74eb07a","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.3.1","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.e74eb07a","dist":{"shasum":"8904dc2af9a7829dd79bd4d22ad2cd3701eb9e5b","integrity":"sha512-2+eOVtFRkFta3fGJ/enEoj6d3WKwUk4IYgwM/GWZSMNlAwghQAWQnDt5mB2HZMFoPF8Bu36APIfeXtfceYmOtQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.e74eb07a.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJchqklCRA9TVsSAnZWagAA0eAP/3mlRXuspze34OIS3MCX\nFrWNFu4ts5/rnzn4b9eHiCEojodKRrHb2ACOvoGEcaKD8mP7xyNX8ARP2IWF\nj471BoZXmAkMZjYhVXMIsnabLcIiLPLlMvEuzVzVj427v2podl9BGy7z4brR\n6BLrCqtzHkxFJ4xFW/jj/UZ1IRcZs6b3TDjFMEUpIae+HETQNClHsysN5fbv\nk3W4hC/sCdoiMIFsOjbzv0mmK2QUqEHC83jwagG+jE+ThsxbiG43oJIaE2EX\nS/4rTQQq8ga7tO0UX72P8mV7w4JseRdGn376ePxPGxEtms+hQPYp+Bf2jY+o\n7AFvxaPBklzNovixHjEeIb1y0d1Q4yzwxuLKSAqDRL8Fa4umBPHU1HnQUP76\njIJtw/LMMuFkYAuZUcW7u/y25qeonWyd7z2z69tuSvtAhO6AgfMdXBm67aVb\n/6rzgKZ2D7ofyu4Igs7H+ciH0NqUaN6a4SIiYuOS5GpsBXZmXfv/mM9mAzj3\nGjiE1lUjGpkQILViKnUImLyKVQ+9SV4GGXAZOKWtUaE64NKTSNrsFQN3tQxb\nYdeg15T67kqH6/0CSAheBf4ma67aQjAkUW/KoBtvfhEw4jFep/XwsLs75v+k\n5jx9o9UNKcaW+r+JmIBPzdOuI4oziBahVNbv5uea6EJ1ewYJ9vgt4ygGQr91\nIlbZ\r\n=Goe/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2IWO2m0RE8n3T1DMDpPIK8VcjanoJ+3J9piM8/uXAnwIhAKNXh6XLXv5xPbZeSTDdAu2Tn0MTeK0/uz2yWEApJBep"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.e74eb07a_1552328996882_0.9214053005341354"},"_hasShrinkwrap":false},"0.19.0-alpha.c95fd6a7":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.c95fd6a7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.3.1","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.c95fd6a7","dist":{"shasum":"0813ce2964bbac4814e1383246796d5a2f8c26f5","integrity":"sha512-BJHzES7oSnTJQhHE0qBvd6n2IHa5iykEUlUghkeF6laBgFG5zTEP7qaP4wnmKF6YIdUYhG7z2juhQSJJNZ75Ew==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.c95fd6a7.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJch2sqCRA9TVsSAnZWagAA6xAP/3Pp5/JTz+sy5vDfN6FC\nvtny3/2SayvBQ4p2FJ+jIjfG8lceFBBgV8WHSqfCU+AJcfGtxlFn1UuT+qMn\nbQCsI7HGpGoN5LFTO4HG/0g8sCWwZbMIgn3sFqoX7qGYDN80m+wAS+R7dbe/\nsr4YRCRekGyiMBo2iJFSyHBs79yfUklFTcqyot5g67jHYWn0wzO48uza8MiI\nCzUVskqBHiqlWFJ7u2JYPXJf4lT7Hq1+If/A6TaacWph50s8c7osTi+OMLMD\nht5GCH0M91FcDesDmU3blqf8IeK2Wj4nXHtsvf6H7/25fh0eF9McrS0wTX76\nUW5/XvUvNceFrJP6XKq8RboWYwkjdCOoWtgwoB3XQ2oaepLzZNen3CzuE7FH\n/fNAEtgcdK2XxNQ/QCMF1EBtJCaAYm8Od18ssYfKyyliuK+tS8wsakUDsnm9\nzJ/hjR3MSY8n4JrbDJoDgz8hsxFmopN1BHmJ6hJCaNXinnmSY1hg8zU4BYDQ\nP88g0q4Mt/b0B05Zsum6qA0Z8Z6ZdTJY7nRZQJxmPS8o7EwOY1UjBOYY0mS1\nOW1NMS1omJ16B4ndiPAgnPNGkBlvdRqk7Wn7RsP6ubYUzgPxoC9ldQADQ7xN\nWxqLr0FUKUfFf29TYVXDbjE8FNPLWnJBysl95WC8aH4F5jhTUvRQYKaOJffE\npKrx\r\n=k3PK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDgL2zmYmwblUPl39GJt6B+w5k6z6W7mKYJePjlYaxkcAiEA7NS/9Pu+5NceqlY0Waie2AuQtHrdazYRs+4PWIl3/ew="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.c95fd6a7_1552378666110_0.39183622147845876"},"_hasShrinkwrap":false},"0.19.0-alpha.a3a6b268":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.a3a6b268","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.3.1","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.a3a6b268","dist":{"shasum":"051a2a31130288ff9dd553b96f9f435c1eef1ccf","integrity":"sha512-kvSvmMwItJRidvMMoCGMUZ02bE/pjnueYsM5MV6oCgLpO1wYyiukv9KeRe8mA4FLhbX2jPfksNjWTLjUMVN1ww==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.a3a6b268.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJch6lNCRA9TVsSAnZWagAAmv0P+QEuaACiHQvibeqr0WGl\nZ5MfqHAvI6lNlcU9UHB1NA3F5aikB/1qZ8xkpV5dMJ0EuNnb0SLVh5SQNb07\nLgPaQzid7hCNzBau0sWWwaCwTRV12naIqVxzyhczrA91cvxPV0NTgGIYHaOE\nEd/uMaEKdGeaHOg1KnkMzn7Vyvbq+9ZZqxofbC7R9j1QNNq9/N0k/9IfH5iC\nyPemZ6ohp8G9PymNJ1mztntyz8mbs5rPdJ+TBaz2+0uG42Oq8R0dXlGt/jb6\ny03j1sx6M02syBC5v9eRHmVSpCmlrqhSOvXzcksasSKdcu760XaK5Fy0aR88\njiycdSff4mAsq4Urst4Q4a80+sjuO1d/zDMrYv6pnZ1iCCUuhJNtinpOViOs\n29e0ADNo+TDSf9RielC63HwD4MDqQS/1Wa7yKN8fdwRlSXs+NHLbxgMe0eWm\nBgtIfR8gsIdZegNKq6/wojlvo5XQO5m606OZD55VXa6+qk6F8y5XToLYRq5a\nVFv+qac+FV4mog2G49994+oqsqGTSStFJPSgh8jOBab3zpE2HSR5cf2VeYQC\nAbIFQQ9vdvoQIor6MYCs0PkEPjiM9RYqb8QmO3GttzX1T1xXg3kVUQPBA65/\niCAOMT72xLMFsgZjazs3oP8Wh98TyQv8Et380lFVwYmA0MddVggdlxEF2eVo\nSWvB\r\n=1R6g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXb9FICNCsYHg0mJQbWudP/yPhlm+YYZbAt/vExTbFzQIgC63EijNRwfnPKnxwo/k0ktdBM+k4PUM+XGaeuX6phfQ="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.a3a6b268_1552394572998_0.6219513466415925"},"_hasShrinkwrap":false},"0.19.0-alpha.ecd17774":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.ecd17774","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.3.1","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.ecd17774","dist":{"shasum":"13addbcde3091805cca2a2ff2c5d70e2ec49bf83","integrity":"sha512-hd4fWuCBPkMcY+UChedQL5jZgJ+wbpCYxS62ygQr9PGAI0HFzfTvIFtWxx2VY4tdRB8vvlBJ4LwR8gBZYQ6p0Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.ecd17774.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJch6lYCRA9TVsSAnZWagAACNwP+gJe01iMqlC2Y4p+AIep\ntGinQOLDbwdq0zfrihu06mCPkZS4jsPt11BthIEww6W8E44Pof0kmpPdVlzr\nuluvTDOt3WEE81ylY+WHZMykIVTHCPrZixzWcTI+9SSVBN5i/MLvgThpTqKs\nKWp/TPd4bwmIRNqsf9LpHpYTpDh8VfmhPbhdTL8eOY9GYUUVGMNfTfqXskcI\noZj2s4NKvnzabjcy7SWQBXb1ZEL6lg5UKfFq0OVEFNVIigDT9rGs2Byl2Lkx\noNQsdS2QPp/jRXnRqbXsK4esSNPkNu7sBu+wTDz2wMgWJUg8DGjJAdksn9QI\n7yZ+Ec1MTr//7NJ9QYdJssXFMuxeIptne4qMInzoSW3jeHHgvNzQ4VWkwrHN\nL3PdgvRniLwwMll1HZFy+0r1pQk0Pf7CdbHN/wBYWizAutAE+QJgI6vKejvb\nQdmfQq1Kg083kQ1FOUlk6EsAZia1RQ19Csptt2S55TjGeGOecRyJzFaBEJ7N\n8rhFocWKWzTo0CzeJkBCd0Le8XFbsCjzRhoV+BciGftZgl7Dh++IuSvy+8Ci\n+UMDicPvlECgcw7Ftl2d47hGHkD60wN/6To9vlff7CJTviN0C9R1ehtUMULM\nBm/xt1D+DF9KDJ95x/dVvz3x8kcxxAwuOlyZSAvwAjsRaBPjU3NaHBBOdYSs\n76/r\r\n=Hlzz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIASOdEtusKuhLbkhZIm/11vYSpjshSSKxlxL6pvvVis+AiEAzVzaFebJGU3g81PXmzt6hmh3koMHg3uHqx0jNOG1yDc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.ecd17774_1552394583914_0.5447640536490246"},"_hasShrinkwrap":false},"0.19.0-alpha.d99a62e9":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.d99a62e9","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.3.1","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.d99a62e9","dist":{"shasum":"4190baa9c5517c5ffc15764e8c98e208be19c9a5","integrity":"sha512-6DhzCjQihxfbE06PAB0Rg/hd5f44z6C0odumPzUytoCEa6qVa4JP4qThzNUs1PEDFgvmzHneqckZFKtcZpGZIg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.d99a62e9.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJch6mKCRA9TVsSAnZWagAACl8P/AyrB47s7k5NqnU8DVIN\nDtUkKFALDVARZC1XA3XCFvz6BWZCHNwjcpOJqy7P9Bc0ZMZWabOmBzFI/nfp\nnA5cW4hJ+QYO+UvPWXLg1KtsTDtNnp6D1BJa5l/xXJw10hfEToLO9UZCCKnE\nOxqjmksCe5h9ZgwCsa7oijYDiuxYbuiGyW7244iM20zW0utKcjsF7HhjMmrc\nnEYT4kP6VokbnD+AjshgX9CAlZr6UIK+Zvs0l4xvk159bGMGRW3UzUGbIWyh\ntTdEUOqp0J2CQVmcCNbfe6GTVzV/AqWn/rMh1ywV2ktkC75sSSUdaYBqmAZq\nvfUnFxMxL2NTzxp8VYd9jx2wWRtag1y6YnEGYivRt5p0I2JNKgJ0mWqy4TIH\nI1f/3ZbwCOiRvRo1RMb0FLlax5MIUH0kmmR+/1rAVkID4VqBHjvF69KYWOvF\nQ1B24oYQLLHJmQa5hGyy6V23Ycf4JKdL4XziN7sXajR+uPrCTUEXqnLDBB5n\nodmh7H2HRdvpVwXY+T8K4L6rS4F0ym/aAZwwIxQepsJHpJSBe+RIhmU1oHn+\nITucK86Rifp1C14InK4XFekoZcs74+z/hQ6Jv50M8C/O2FHz6v7luqtIAMzV\n/FQzc3POBdObcLu6dpHzyJq4xllUrRXhMs5kC2x9EqzgY7xkJ+qhH7fPKS91\nPmxv\r\n=MeBO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDH/9VSxPSamcahRgi5BEXlyug8VtKhwcWdGWKr/iISIgIgMNQVdBbwBmewIezFqTXKKTKhtThVohK/V4CnawLoDs8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.d99a62e9_1552394633928_0.4713499453096339"},"_hasShrinkwrap":false},"0.19.0-alpha.4e578a05":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.4e578a05","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.3.1","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.4e578a05","dist":{"shasum":"71ebdf0f2b13fbc4843114448a31274aec64298b","integrity":"sha512-MjKhA1s1SdMyzozN6CwIu8/Zj1jSg2LYkyCpY0DsQ/xy8o5HKzowLmtIWxx4WCwso3ormHNp7xYKQAq8SFjg9w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.4e578a05.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJch6rSCRA9TVsSAnZWagAAN6oP/0WfNx2FWAEGFO4cc9PK\niunATwbpyFBBDcH9M80WwMf+sd/txmE1d0AMTkF6amVm6SZI912NKtwv7yoQ\nWCExRwj2n726JRvuWRJVgLA/eIvM2Xi2XoP6jW/MiBUOGR7fhbs1XANKV9ib\n/oIF4YtCjqPtlRo0Ex5sny3J1L28tZpCDbyEpN6S7vHf0/dVEXpJ+q+yHYNu\nOTWvxnJqa1wizxqKYkOiu97neJDXBY4kk48Yt09riccsn2SS7XuMBi7BGY2H\nyUmN0mOuyu/CtBUyKgQZCEsY4GOP9rKYpg0Y8DTYPhrK3sAy45g/r0ZWvSYW\nCVqa+L9ddILQyrZt7sa240wJVkEWV8Sk3F57Jeeimmx0S5fzG/3g52sKh6zb\nexP+Jg5gzzautyv0YovfiYrCZ//FwYXJA8CWip9YOaxWnrBAltxgir1oyloW\nEhuEFnAYeZ7EgngymikHgd6cMbiPSiz3OOZPSGEUYK9Dl/CntDAmkp7epQyc\nxqhaacgw2kf0+/t9IeAP4fOjcZCT4OtPFFQtSSj0jQSOZwnAX0s1n43h2CPx\nPrRVKl9QLkol6bcl+Ue2kal8XGoq0gmPOakP8nZo7NOLAP74aHlwGhnCU2QE\nqqykvgEzhtvTUinQuXZdI1bUhn1QHN132zh7imz5bpp4oEMHnQXqftDEl1JF\nZiHy\r\n=kYxj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsLxiwBDknbvF2/OVHlvfPwenGWYEv3IEwLko9BSBTcQIhANiAMqvZnetmdHC4LjDZwxIwKwewg6Vgv8t0mPK/coKy"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.4e578a05_1552394962083_0.5331867930124552"},"_hasShrinkwrap":false},"0.19.0-alpha.2e648156":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.2e648156","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.4.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.2e648156","dist":{"shasum":"200a85f8acb7cc17526621b94d6ed09456b82ee5","integrity":"sha512-tQvgciKwWDtTM7JDbcVwG5yZtfjfL74WkSbgkvpS8OJGt/OS5dmuy0oX+UOKRwmG/a24dxqNgj2WRzltKct4zQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.2e648156.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJch6rwCRA9TVsSAnZWagAAs0sP/1wJ8mq84txUp/Wj6+Cc\nVdBnzdO1TJkz37RNX1obo0vzBC3qaD+KBHLXOlCIVW2Vrd0xsTRhUiHeoUZ3\n7Y26xk0VKNCcfwCdzsgzVtq8PrL4vU+7gr6dp+0RXS+5CRjKnkLaVoYyajms\nfc6W0RYgUdDHtaR8RACjZ+ln7WCQ7dJ4xtPJl0b/tZwfGa2vimpfMoS/lYCH\neJxE2wRycYsu09+szpCvYvrCHmnUCOCst2B6QQVqD4RD321UqAqCVrLh0LWx\nsNvFcUebom2jZvck+sdUNFSeXOkgJBAobeT3NhX3J/stB0L1CxEekcGnAFOf\ndKmGCjn8EsE4aqFS693KvVLtdkQuNt5iql578S2+VUp6WvqoAKTAUvewLnXg\n8TYCv1Ii8Bs2oy/Qrwv9s1JORd1SXbNOmqz9ORTSgr30aTPlssorYPRA/JJD\n7vhwvpCg/3/Jfm57m2TQQsB/TGS4vqw2udHELGO5wImQdQxogLU5Q1O76MN9\nxmCM3cly4ry8EC5il58wop0mFpciRcfcBvRB6OuDgL4UjlPM4YJM8OMM7/Ex\nNHEtsIyzrE/L9edEtngQyNB2qWJ9Bq5V/vlW7dQdLqdLYM3ffMexVQdoGyXM\nWFk13vt31wkF3SGND8rxNIigOSej31bQqXO9Cw3VJCeLjsDcg068KEg07dlR\nFiKA\r\n=jXRF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDvGy88sATABH+4cvh8ntS6JQDWURVe/taNgNNh4cNWcAiEA2ln4vGCEsGiTwKXtlgLie+VZY/r2+ToDT/wW/FWz3Wo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.2e648156_1552394991855_0.19667464728148043"},"_hasShrinkwrap":false},"0.19.0-alpha.f77b20ca":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.f77b20ca","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.5.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.f77b20ca","dist":{"shasum":"34cdbb9f5454a9eb4071ec728a18e433eace10fe","integrity":"sha512-QU/e3BQXGEzdspnMcsSkfXIWpuG1EBhWPkUbBXhse0veNBkf8s7oDCYASod2OPJSYKegJWDKEd8stYKcF1KRjQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.f77b20ca.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJch+U9CRA9TVsSAnZWagAAtMYP/A6UpAS/lbgPE4ZQcDMk\nHBNXIgZ7q0V07OT5MyMmkW5fte18SPOmA5DYrWM9w4BQ3KBiWKZB79WeDv/I\nKXQwlEiPi/IFtjTZxGW5ZiK83zOmmh9U5qaEf7Xp93yjEaIpgpa9g1+fC0pa\n6vgjwkg6PVPHcSaE+zYxcfWlnoBAvUoHKi3eVqQh4Nfk7GqAwqGwEgmKz04f\nxXkwNTfD6axJf40tCuxbdZk4uEPeGFaez3t9bm3jUs+DC6gHngqQHKp5wj20\nMkLn1/jPbsn5eX4fWPyn4VyoMwc8OC2KcMcYUBti8dCTk1IaXkGrtwoIXkqI\nJOmCLLQKsErHBYvj+aR+QSBV7H4K38Z0q+dl92k7UxXyuG9UCsC+642uB+qq\nvNmstVYq17FZ7v9cslzwasVPQWvaFAof2lB653wxclUo+P6BM5OqovgnPj3X\nPidzVr3zseY7CH3cxmHvSe+lVMbhrAYRxQY0UFR+f61iGMY/ICPI63IvkOHK\nj4XZD7Yuts+2D0LXxlTgEgG1EUzYWTR4p7el75sXNKi8va+SSKB8GHCvIYN+\niuzLGymrnWxZzwAEEhuwOYgcJRrQVF1aw+YqOL9sPULeLsD+cEZg5yOnnYQt\nstHAkqYuVBM+thhEAZ6ztJRAclJn/nPojXMnue0TxOF/UWnbNqnPX726BQvX\nr+GK\r\n=414S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgWHbJBTwg9mLxkACt+D7OCdkYIAoebZp0V/jJdHsdrAIgJTfUg+qZvSQvzlkWmujeOGipghH0z6cyTeqgAN+GDVc="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.f77b20ca_1552409916430_0.3179160825283551"},"_hasShrinkwrap":false},"0.19.0-alpha.6f658f74":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.6f658f74","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.4.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.6f658f74","dist":{"shasum":"02145ec52c11444058664606abf01517c3ca0931","integrity":"sha512-psiiAZKSx960xdAsY2RKKd6vy/CkkzrRJ72343VrkRDF/IafOmSzMUApsdL3cDdfNSBox6Bu94sORyIYWtqmKw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.6f658f74.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJch/s8CRA9TVsSAnZWagAAugIP/Rztkw6wtQb7gS+mU56w\nVC4a1Kqm9tKjgmdGjXo665vOmR6SioM9NwSuYzNz/wSQAjKMwHOZ/MN0HCPv\n74mg9I2ZLXUF7FTCtsOG/1JL1PUbi8AvqRZ1m/JJ1LupLe/Mf4ST3BvT9nER\nyN3azaNDwQhtjDERFxg/8lyfZ7bXvSJg1nqhxF6etHgmIqxnGEHJ7Pq7Ario\n0hcs//chf/mqSm+JfCZvwo2rQaledwHpMdaSQd6jf5cC8EyeJ4Y6q1uJDYq8\nGfSKtEmWBoG5+Qs1nqus9odZYTzbFF04IRiJcSoZ211h8vvkfYUZvlMCU/+x\nU5EY3UMIi8qEQbORVyM3zXqhOUck5nYmD1DhfIrMnFoj2N8JwiTcUX5V/D0s\n3UcN0bptjFZC0+pTd6ri9p3ryPe16OsVLWgPBphDmxSOSSmr6YMGcpqkf66a\nhbDtkHJaJQctzvItyUCB+hlBT63aXImNTZbZ10KGDPkH/kJB+HGTWGlaebZx\no/hbIg9Yzl6LYzZbEuHlJuweuZxNxFOaRcWo2YSMUjbmYWFTk130sJwfePxF\nbzSRWi7aMhBniliKObtbTg4DxnkJhRTLf1yxHQaPp9KvkHH91cYm6CR9/i2y\noEU1fndaq6FAGrRYguLPMzd0aFhGHnyfhX9yxMYXzFGqND1CWkE0uSOxamA+\ndAHV\r\n=a7mu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCEeQZyMLM1srjxxVBrXB1jjLresJCoNQx9Gpn/Oh8rAIgXhdZKXjKRXXVdCIkVX5l9NZ1hlpY/FpnKEaFbVNN4r8="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.6f658f74_1552415548173_0.15490055760842192"},"_hasShrinkwrap":false},"0.19.0-alpha.5da81870":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.5da81870","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.4.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.5da81870","dist":{"shasum":"3c41145f554f5af9589b9c505eb1a161dfe975e3","integrity":"sha512-4z8UJ/E01Fn4fOQNDYApGCz3JLmFQEVorm5/umejuBwKIMEbz+OjTztqblpZAFgEpc7BQsUvXyX2Ptansqft7Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.5da81870.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJch/ugCRA9TVsSAnZWagAAUi8P+QHthsKEvKXvbboM1IQE\n5cCPOg144/5vg7dfNM2Lue69K9w6g0tdyM6hofPWt4MFyJaGV44HfNYvwJQh\nn12VB5SwfiFFMK0EN0WC86epCzFK91KLdhENlnGEQ3q75itrF4gTgAqQW62i\neckyexUXGOE8srR4+wKJrEORkyIyP7PrNtxZGK16bxsZkjsQnG26ZEoIPk8T\nLsLLBwuWgHEwH2lmdnFfUZH+A1uk6h+PyuYv29jVqJe6sk9s+FDDtKJapOUQ\neutf33pi/Ik1hvxRTX5wD8vkHnOOG6wO9B7wSorfmdfX7xmp2z9gu3Fk3Ca7\n8ZFDFYw1GMY+P5ZTj0kpCh79TY5vEVYYQJngLzEmdjaLVjHEUSu/tAtXBh8r\nTEwhudDXk+jrqvGS1rfWZDwf/rV3lkhU8/2bCvk6OnQRUcBE/vTUPQY4+vhW\n/Pckh/HqQ3fBOYkYgnp/Sajf+P8apNV6lPf+CSMhEnz57PkhXvd1lRe85ePC\nTzE5vHbHYr1MTp17UfzS7d04JevKhCV4mMAqZvngv3+oMLXJcku+Xq5z1iw5\nwooMHYlT+CaXXbCnplKq7qKIdMXsiielWIao2DOI2GO/LPYMe+NiFnHl2joS\nWMrjmuNX7vJWHyRfhBm5TrZVLZVV2Iu00BU3I1nlDV3HMo0ar3iBqvCBFuGD\nvS+5\r\n=KH39\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDE3Seg1EiNQ9vXTHuz9riUnoUNwHFV6e3yqv1YPHw84gIhAIbQUhcH1Aoc6txYbmfPgPTiBKIJOm2qt77Al68EFu00"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.5da81870_1552415647935_0.9453335752942651"},"_hasShrinkwrap":false},"0.19.0-alpha.100cdc59":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.100cdc59","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.4.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.100cdc59","dist":{"shasum":"0c2fc1c4b8f468c7696b1c2abfbdc156aa385ebc","integrity":"sha512-ZKeL2PklNV3DjprkDz6X05jTX/VpO0hq2QFEd4eRO20c5ONZH99ndLlAI2ZY/l/vLtzxMi/J4ChB4xtsUCCyDg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.100cdc59.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJciEWoCRA9TVsSAnZWagAA25cP/jtKVbBOyGJtWfK7HZfM\nb5IqeYg1H3+tobLbVjz0VFcuJNkKoj9pik2nHbIGMIq4AW9XV8N46TWwQZYZ\nUD4HzgETkBAcSkUya97uhCGqPlAzvw0MRFw4Uq9V9Hhl0h1+j2klA16yR5UW\npVUk0G4mcACh2K0p8r5YsQ/Ug2MTPPGCezy38Gk1NJmVJi09K/xg1DVIxo6Z\n2P/8BeQtEqEpUICkTT0JHR4Gu7RoN7S95a9vAr/YTV/zzotEtYcFsgXDpG9E\nLOzqprOUkSuOrKK774vYXhopub500vo2e45TzlllQLQrXx6z68tjfdvO2Pkl\nHUh98QGaCwSzZfn85ISYJhB3MlrAhO9XFYupjBpqhZlPz2oS18ZpWf/wjuIk\ndxyUE7U4hFtwYfn9IXnXw7MyND8oStschb+RWUh5rLPy3sbENf+5mSnFfc4D\nsABmHmbEQPbGn8uC3kEotTpEUm4ObHB9noB4heCukDmbeRBAv9Au//95r9Vq\nNv3FTQ6UqPgomsT12dVNWs2lTzKLHcsYLye0jQhJWL4jWNBOZL8nhB/CTK17\nubP4t+jsDhiLXp0grdWF2PNdd4HTcpw4IfBC+2PAruBw4peZOvSr63slatT9\n5uBAcXLki/Xwi9IP4lypyff5/3zZyoGLFuqRADXgOyR5ifI0WhO75E8a8zMx\ndDj9\r\n=K5Bt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDla4KXBLUpiK8JkkLHe8XkABecNdGuLUIsythVDRKAVgIgaq8r2BQb/n6FMKd71t0NboMcP0esrPKhX22523i8P50="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.100cdc59_1552434599859_0.7994084400279602"},"_hasShrinkwrap":false},"0.19.0-alpha.1865f150":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.1865f150","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.4.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.1865f150","dist":{"shasum":"0884f595954a05414be4613abb9357341a588191","integrity":"sha512-vt4pfcx232JXWyNlCEpyfjoazNHZAlf2MoEEhRpXeurxlFaqyd0aEFnp3U//0o7xrdw4CVG2sYpEvO2J3jOBDA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.1865f150.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJciIYGCRA9TVsSAnZWagAA79UP+wZSyzIsqQhdu+GnhJB6\nlx7T8kOKBFUNTdCmESUfsGpsSDb0Vj6SpPN+sz5iqO4TSadNIX2TLv6zNOsj\nc+QYN0Bsc8tdIZxLWI4OMZP4Pq5f8y8RwW/pphlFfrdwji0JJhKQt2G3zcqb\n3KO6dZNJsA/AuGaf/gf0fJr/Y8abh2+iuxTOsC9pz/FDOvjwhNnbC/Z+Ib7Z\nXqFS8/ZEEmIQKH/7WDmkqdGGa4nJrhFVVJ0mI2i9yCrDAI4K+Bm6C/hAUEZm\nGGyorl7I1OkiQc7rReeTbF0vHvBnS008B3faGX2SsfkM216IpAC7KhR+dIwX\nNtlhhtSFc6sNKvCfo/vak1xb3gNTgez0ruwUhuR2dj9mkg46yFa7jiLXKw4y\nES+Q52V2T6y+92JsgdLJJDYdLU6NjrJNc1f3fZIFYWQn3JrZLnWlUw6Lv9Vc\nPqtd7S6s+K8PQEUutVOx8T4xOdLq9d0Hqmc6l5BTH8mF2eTvaGYPwkWiUwhL\n8YVnhL3bL1BWKi+gl40dhS3CAIrCU5InYLM67ab3SPJCdTpogSLzq5CBHtos\n2xiU+Rx1WupKlg63a7O6T/oK40ISMtj2tvfryLH4JRUwCttQn5Tbu8e+v2/f\nVyouZnF0CFqrAgK2BVttbOyJ/Jo4Vy6lLHHwedkSfnKHu/WVB0M+2T02EPH6\nYpwp\r\n=W+Xz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjfA5gkCJeMrY6sYzHNdpVfH+raniWHtoEfRWr8xGgVgIgMiou0T8ap30WpgeG3ltkeCzu/mtv8Cip43+ITfGgr2M="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.1865f150_1552451077892_0.6488542658345811"},"_hasShrinkwrap":false},"0.19.0-alpha.48475fee":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.48475fee","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.4.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.48475fee","dist":{"shasum":"eef998092f7d5458899bda75e3bd7f13ba7f7ecb","integrity":"sha512-QabIoI6UmsYAffdnzDyyHncck3x8Ay6FFxVP7szv5s71GDpJKSsDrnnE4yv9M525l/R+KeW1fuBiltndwVh49A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.48475fee.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJciLEGCRA9TVsSAnZWagAAh/8P/j9joEPJM9+YjNnpNIFs\nQtR5J+w/iJP+n7yVW/e33cXsYuTFkdbFHtWnTy/mXZ8//8c4SVb2uhTZ7eAt\ncrWoC7Wu77bsJXVfZ14gbyOfvcMATYqalsK2QigRqKHD6+2bDw2v/Xc9JbZ9\nbu8t7TNC9yH23kx4pTsFoIUGnit4nVSJDCfbMNBSEvPe8K8DsBqUgY274Qvv\n9PC+F2+YJ8JAXkExH+QSG4OF2Z03ER4qSUgBuz2sc0/sR9maFD8HtP6VrSQP\nhHFdRfAK//5DJqC00reWxQh5UdXM2Qi6/g1Ufm/30WqrLE5rU0yc3jepKstM\ndxEgjEUx5je8F/Azr37zZ0rFWhqA6q2j6YfpMkWMM+CoKwsA4topI8yZ0lHk\n/FbIuTqd3zhLI9PqeJyr9B94Eq/CDVSX5rheajGcTNZ8viErUveeNQR7U8RW\nO70BR/CfdbnWeyEIcGtEjpgnJRPY7UONGITbDCDrbTvMwd9kiXU6s0FAxBx/\nBg9JGnibsUv5W24+xWaHq2gOz04ykFHpUxRKCFuDubpSGdK+M3isZZyDgnjW\nlSvZtRZ2dOMqeBF9wCcNtbYkrOhPpPSjKtk0ZX3Ch19nJHzHrx8bkbuKO50y\nQhspaKQMPxt9vOXiE2W17NFEQn6XBqlFBeHymIoPeewcWF1+ySG6enjnYOgn\nJY98\r\n=0xz5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGoFJ3eBP57vxAJy7jZkLZr8DqQHkBIQJuRbbqHNHA5HAiB21978nryEdavu/RwjXCidsEiLIpMbD9X3Lldk0vDWnQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.48475fee_1552462085899_0.7183211277743702"},"_hasShrinkwrap":false},"0.19.0-alpha.1198c408":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.1198c408","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.4.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.1198c408","dist":{"shasum":"815ccc44070131b0e65631a23d408c7a0f78e1d4","integrity":"sha512-Dx0YP/4AB6CRi2GqlywRdq62wHez36X4kUYhimRydEPRzvp/smYZ/mvRtK5JN8almX1A2hQc++c+CiMnVGDfcQ==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.1198c408.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJciLElCRA9TVsSAnZWagAAiSIP/iAeVfzXTW3mauFdsNIa\n8CgS+7aPDWxRSwTkModzUeVSmzF3A6GN70OUCM54fqjRPUDP3p+eYJoL8CNF\nHhvxQLzKhaT2DEXQ97kDSRmbv2anLlcCu3jX7WMpGaU4x4gVF/fyHIhpIutT\ncRIC690MrUGM68Mm+Xk+DY/A/KDpyfsCgJhf2z5T0YJ8y31aWDyp3yAydZXe\nDqvJIyro0GFY5o6RL1PKDN/xYR6+9EIyORPbeMswIMrPK54YDOOECQMJZqIc\nckbzY9hqnRUkWIht14/fx3IkQJL3KSO7tl6oos1TIhqqzdl0a5f8xSOxbqkX\n6mtE/9avvPn7Iu40H6Al73dEawiHxqIvuHrpxKlxuRvJjHf2iD1g8X7LO/mT\nMhgKXAxxiJdN9T8iXFnei0UK09sTcarigNkfbD1C31HTAaql8hIqb9uNUvlh\nCqBN3v1y1MTV8f14AzUlK8tMlF0nM8XO+XONzALGm9oKHPM6cK+ajQHQ5eX0\nvWUX7FVdEyvLeE0K4es/iJk/+REnCoE09YHiaI8kdQv4dS8YAExP5TkBNzIm\nmuQ0toNUQH8MbqcQKI02PTjodkQJn8IrDafIagNMalKm1NrQUCZwBkdI/5rO\ndAeFeq1873wiWpaRo8uoT4pd05TGVW13QjCDGERegwU0tTBNjwkd4nnJNo1b\nxurK\r\n=BIhY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAIhB0TsPsq4mzD0TFnUtWbqJ+LVAZNyHlNyS9hYgL9MAiBc/U7sXMpGHWvDETpv0OtW6sZPBlGbEOUJaM+/ujjscw=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.1198c408_1552462116480_0.9202976617372367"},"_hasShrinkwrap":false},"0.19.0-alpha.dfa96422":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.dfa96422","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.4.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.dfa96422","dist":{"shasum":"03b0ce344065d4f213c02595dc70e574f922fa63","integrity":"sha512-ae8S1VoNFJr3gHaYqfgvlUYArZgtEXR1MffoxPKdalZvZU94DNvikaQgUChGY5PdmCaDqxZjiGSkR5yUYHFciA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.dfa96422.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJciLEzCRA9TVsSAnZWagAARcoP/ic3akd5xlLIxKBiAnWZ\nxmlilxngNmdJ7yy4XfRtQweINWV7Ik2qI1FWmjMFy1FOzp+9EIqJ8rnQ8G1m\nvo4d3uzC19s+9CmoX1FA6kNyR4D/MTyRInqGbKMfdheqSAf+Vs2UChySHzd2\nriwtvPI0kiwqEOUN/X3V6cZKuG2+MhE6L5o79wGIZxZx8NKQ9513Yl31yIgZ\nWQLCGVLQBIpFUkMOBSdY5anmgjM4o/EOciN5CW1YMQWjIo2HsSqPrmSwtfTT\noX5kWOLpu/MqyTxWTBWqIkw97F/sv9yqQ1Lmjxh8RQHrSmPU84Huh0QMYWV9\nrhAx1QtjF8BSC+2Q+AwWZ2QBBFUNjZCSyYgUfD280a0a10RTKeoi+o3xQmp9\nIuJhy88syypGrc0/p6CO2gmjyOnGi4lS43WsEoHAx00xCynvmUf4jZYtVPxc\nTInIHByYvjt2VMhnhctN1hWAajE/c9e/7mLhJyoAZtj16IrSNpyT0hk4K5iu\nA85ROCf9ZVuLop8EJ52SAOlv99n9lgGVp5nN+XqUSMOJwJ1LZHiBxVO8J/ea\noh1dfoR/42Dj7UQe4WQFV4ItYz84nmlET1u0s5bdVzTmYw501OGAZczFBzrJ\nDloQq8l1Hxy6WWgTbbF5aE6UnbX0ZpWQA4lEogg32njGBlj70TzjZdGe28Y9\n+Uee\r\n=a4jt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFWLhxcDQv5YMW+RyiNfdt1LWz6b18I0M+axPM1M1LpOAiEA8oh9yYwZ982I9u4XW9RAVs7ceU2vx4abuJHDo/2Wwrk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.dfa96422_1552462130518_0.3609703619631337"},"_hasShrinkwrap":false},"0.19.0-alpha.c92069bc":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.c92069bc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.5.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.c92069bc","dist":{"shasum":"ddbc52a94122fa8f21eac5debc24dcb3c116199c","integrity":"sha512-C2YnDsf62zNJYTI+6fwrWxF9RAeJc0H7hfFLUP6OTZzGJjEqojMG4I3PrI63LKWj0QcKXUTUB56KauHPho7b6g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.c92069bc.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJciLLsCRA9TVsSAnZWagAAO8EP/07uRb1fCSUo93uJqg5P\nYTcy3MreYnRx0A2d+PepJ2i6/qtEp4amhM2cKzFH/wU7r7fxcMCzTnZZRYrI\n/rbDlYLhaXr2nL8dxOSYFz4lTGMNRFtrce6omUygIvyDr+IP1y/qwQi4XNXR\nPRj0xRwcBWM32+3WDtXlACoVURTpjtVHD1QvlyKeeQZ7dHrZQ7QfE3fc6+yQ\nCS4cvf7pkQbCdbvCeQNLNS66dTDUoTe+WTCmlndXvadRvyDS/Rz7xt0sR8kX\nKK+Ljcih7yvSvdzfmSop050+dj16OL+4A4kw6FW6p+F74QrxUv5mq2A5SmQx\nAiGwAk4B0/DH4mIOxE813FHNDhO0JfO6DYEz3SXDeAWJnjb8mkFV+NSTqozW\nQLwNhK/N4AZMvuPZojPfWHjN7xqr3nRsx0Ycnp+siirvtNPSWs9/JMtCQQjZ\nrTtLcCR0xt1ay5iANJhnCtOB7llT2zvTTtPKfvUUCwvNUeODbUIvWAcbw7FK\nDVXB8PpZf1j9GV2pYQOGQB73WUzObQGlNjhx3wGqCXgchk+UVpGLkeu67nGQ\ng10Fowigxcb2khoPqOvmUkclw8C7w7O6mGaMk8SZgIPqAu4wSO5JwG5dvLHr\nM2+DShT1X5n513TZiyVIgQQjDmo/Wcro0AWlOzQUnz5lIshe7KNWN6SUBDHm\nsD7C\r\n=qBRl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE2d16oYq6cuVPvAhoIPX6rwGV4kza7cPxyPwLe/74c6AiBJwSu0efShl8xhCMogmLeRepGsMhILHr4oaKRigx951A=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.c92069bc_1552462572053_0.14684739498769872"},"_hasShrinkwrap":false},"0.19.0-alpha.af1376cc":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.af1376cc","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.5.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.af1376cc","dist":{"shasum":"36e9a74deeb8e4c26e1c2ad53a67481fc3a2020e","integrity":"sha512-N7Uo50GoHx3l6DuHuV/7+joidQAoi44anWUfds1FzBcde+BWVvE+C38Hh71WZ/vbiuuRpOcYS21B7xjfruJR3w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.af1376cc.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJciUwaCRA9TVsSAnZWagAADjcP/RZe7vwanwNGxGhyn3Hq\nq/NwHV6avtpXFa4JKfCQJH1xXSlgRl23pzFYgf3xSE9XgU3Tyl3UnqzePIkH\nLRx7TRKvmPsa1jzkeJY34K+gatKtNuRtw837g+h8DMYPqi5++nbnLJqG3Eya\nCbzGtPwmfndeQJ0neY2b1aOKwAn3kGOBZbLU1UYJnBFrqOPQNcZtGHm2/UNg\nACjSKvsABAQWp85lPfs2o0v0ZQIXgnUA7GYByKm10kO5PpvVVAeuBTEaEGIk\nvqzIyLOlLMhEKo79g4JQp2Tbd0v+v8/co4Q9UrT0iF26bcGTxpXlNlcWxP9y\nsgEjCQSc95zqnP7U5vj9EADal7vWkGWVdUiVPl1mdsSKnR0f6lWNXGWigA/B\nn55F93AkgjgQB94NxWcjSFh44+jK6vWHXbhsrCS2Ty6rE0YFmNR9KsIjDrtq\nLwQYA1vYWfhX+F/HFqY72PnaTQUdqsfI+i8vfZkZUT08he2ogjKCQwuR3tb1\nKBHYVP2cBDeOxfQKi5HN5rd8xsXeu26kUrAksLf9BEaG1Fr9kOVygajyzPAm\nVsQLBT2wOdHb5FR/vZyppluuAKJhFx6PwRwxvsdCiim8G9twViev1VIbmQLr\nfEdac0DFEkDSgIiwBKmJsEa3IIB/PrusyUlzEo01oYteIrcAVjaqHpiCa2u5\neRBs\r\n=PxQ9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEb3u/41wZvRcyPpsKFFKXCVapVOdo1gExhbt3dWFvBjAiB4z7oybPAVTWpBKbIoTyNAVF48TSyuDj4f+txQyobnMA=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.af1376cc_1552501785944_0.8897556646807705"},"_hasShrinkwrap":false},"0.19.0-alpha.cc52ac6e":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.cc52ac6e","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.5.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.cc52ac6e","dist":{"shasum":"f5dfbe7e64d7996796f51385d6b1f63ea11c32f8","integrity":"sha512-cQ2+GtUm2fL3f65ALHNaJ0HKO4uUKRuo4fatEEtdATVqlK25L0QKonLibU05Jm4Tw06D2yjeqvoGsGX3bhN/8g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.cc52ac6e.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJciayrCRA9TVsSAnZWagAAmK0QAJNj/xhQC/m6IeDOSUTn\n8hNXPXy5iCU+wHjwYBDFcAnnIo/sIMUdnO/QLrfPpqkFSQj9TmicaowBbdeT\n+keABO1De97qtGpSjF5mEYJGW6E2606IiOO4Bc/9stPtOjTFqv0x7tnO5xiI\noNHmxTlYnJI/3SODx/z72RRx3vLdpQSbZYg8uVEeVI8HGZsk+aSntGz4HRov\nbSL6d8aHdAODzpKD+1rJtJqJwbM60McIovdR8cmT9Eu4JcV2X0kkOXblO65w\nRZTCMRIlJ3C+ksIgV002FBa3i+907oWU1RQwR6Jpl14144UriSOhiLPGO4Sm\nFLv/+G57Cqnmt3nICvO0D4+mQyk7bx9QnX9R9/TCNOfs0QTZ+PEcqWWkYPbl\n83Jahqx3PaXvaEmsfy1cH7CNVoG1Jv1Zk79RVJyZI/k7f5G/FVhLBny8Ymv+\n8Pi83UEmhoOKyuiQJaBifSJxCh+YjLzoxBVAZWFj1GR4jM/qVFKY/wjNUiF/\n+l5R9Yoqb55kayGaMajeB2jD0QKSUFGOtU0NoTOLvxY1hrchB+VVggHOzXp6\nFblr5qasmkcGXh8ebmBhM0XMEUigDyO8tmeVpfzU66FzYHncT4moOddTPNxE\nkt/8l8Ws5sjF+HUAbwP4Buwrms3QvG3Ts8qxI33YL8lNezHzwDx81/I/zXVX\nEDeZ\r\n=R9Nn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICV6UFRDiGwEfj2C6JsSTASGGuv9XbRw0WAfWv0c5Z/nAiBrP4uLFzYlANdMO9dDupYiDvOVM6SMSCdH1Bnv4w/L8w=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.cc52ac6e_1552526506806_0.288457900294693"},"_hasShrinkwrap":false},"0.19.0-alpha.85311445":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.85311445","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.5.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.85311445","dist":{"shasum":"481ba3d0612684fee084d2c7c7fa5e28d3e3cac3","integrity":"sha512-cjIVOPuK/rQKODFWcUJ8BhYjvab7crFUnSevLpPEIur3Ny6SG2JAyEmfslW1GOzDGtGR+0Z2kZdgqC7v5Iek6Q==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.85311445.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJciflvCRA9TVsSAnZWagAAki8P/jQDOmwWt7xHJKzzuW1Q\n8nL2FhCqcCysd+/pXEDVrF+iprssvKj+wn8lZUK7O/lX/oP//O3XGtAec1Aw\nXOvj1wwfggsSLzktMWDUJqKLSTiyAVFG8zEYvaBYki+Nm88lN9i71EY9BO3n\n9yUgyqyFJuicpQ/bE9C6ZA6NAYpuypOzFhOCovpdAoadpGlIs2lwj+fvW7pX\nnBbAEs9/gmPcJn1GDTNeGm31xB8vCFr/DHJjROOYmpwrCOWYk/hZMMZgOT68\nx7YrSlVPOTas97kqREBsRqxgdX2EhYY15D2Il0BdBF+VkIqMRC+MWuORah7i\nkB8kIwSEov9O/TaMqL1AmCqjRsj/ZixEBIZg0Gdfg4EGJ0HKjDEn9wqvfnnS\nvYphLsgD/DYhSRkNAmfy7UdkV8xNSo2pFSyNn0CeGbvbbTWx8deKc33aKjUS\n2maXQZCWv5B7zglE/zTS1kmbsIM5MDtDf3oWDm7pdwmqurJOCwfT8OYvYCun\nm1fNZPzKTiRafMt3bYRQp8hQ5Nsl4Tb03/RROSPwl0QcRFDww86jlMJsnSDB\nGONXNF1WovgH4J0UbzLnP/lbd3qK5xXMQtSmCN4vTy13x9WKVr1o9it/vTox\nvgUaOK04a34FRnWxFUi69yAqiP6QsQ0NO+PQySHMqX8E/+qh7Qp6wTumuVPY\nHscE\r\n=t7rJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICGXy0IsULGZLbV+qvfRMeVD/joNtj2IWFKUD17rFO4UAiEAzXyK+/dIRt+D18HwnQuDxjtRDvynpLIuiyI5CPDjFZU="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.85311445_1552546158381_0.43708054154453846"},"_hasShrinkwrap":false},"0.19.0-alpha.22df701b":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.22df701b","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.5.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.22df701b","dist":{"shasum":"efe8111389ccd49f781e282b972815ff79aec052","integrity":"sha512-ZNTVQOjtH90TMKkaEiL9orGmzUp0n7pOv+duNX5gyBlWpCYH8S2KN2RvwuLKNDtjGT4w9kPl3LCdBN69PgVCMg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.22df701b.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcifl/CRA9TVsSAnZWagAAXK8P/inLEZf97uY7B7H0glnt\nYFdXKkNhPx5SAAlWxOLVryStOurwgv73QH6CZ7eYVx6XCVuHqvR3JONkZd7i\nQzq47ETdM0pEitEIRopOWcFNmSbz9hyRtSuMY/mSOe11nxFXLBOqYINGJ8tC\ngNkYevYuVi/o5k5f7SCEbd3jQxSovmi4sPbdFaGSVBbpQlybn1NaMISPs8wU\nej9TuM8b59zywxnC4rXzvSILwKxZ0XJIW3mrma3wdY3PeWCeTDVv3x/9ZluS\nv/uO3qlrco0LcpCf/MotB8gtlk9d1alvtmpzn4BWc83FvGhEhaaebZe7PD1O\nRxnt6niM3LxuotCEXvTuiQzBNd0uTVvRC1tla9u3P18qmupyKupvBBVOlU18\nUNyuF6i+i3kAn6m5agn5KVYeRtHDubtl1a1jwG1ty7Sn1RWc+kyVapBdcJZl\nlZ5hzfow+mr9CCkeQWtxyHXHKnUT1L3FQBmSeOawPqqFB9vKtMUxmI3vydpG\n5jq8CeCxAk2v8+bUz13ecNbOpeau7pVuEXm3pK4Ov+3iPfIJiZMapwRl3F7X\nZuUrV1Kp+tLbPeIOol0q2JEmhYiMqsD5Y8T+zZWYfgI6gZlQ3GZAZ5dsh3vo\nBiswliUZKx2wLzvVaRNzWVeWoYvAeTaD2Pr6OYnbGHIFSofeDHSdff8W5y/m\nzl/H\r\n=Q/pk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICZBHo2jK4x9MCWGiZUf++G2qV99d6BnpJhwtS8rtGHDAiEAtvj0c8x3DGdJbS3ICRl2V0YfsFBhRVJSHD1KPUt8uWk="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.22df701b_1552546174772_0.7622928835719689"},"_hasShrinkwrap":false},"0.19.0-alpha.66950339":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.66950339","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.5.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.66950339","dist":{"shasum":"442151ea98ff7d63455ecbafdbcb2368cb06fcdc","integrity":"sha512-M2gRk3r1/ziiuXnxChYPCfcnk0n5QlATnflnM1GmuT27set7kSUS0vrq5R4UMuI9qwW6McKNGg6ANEA4KoEV3A==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.66950339.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcijntCRA9TVsSAnZWagAAHicP/20BNnNjcq8L7QgclWvy\nYF2HADkM0rU6WSSo9plg48qjbxZRAJmF5S4Io7PiQ+9a4txKzpZJ+8gcSFUs\nP5NF2i9Fg6gcfpMzB0iNIZ6L7yjB/SVTUWl0DZN04eU0TAuPMGOXUVjsemPa\nuRQuw7xUOMZ2a8KA0zavsvfKBx32DQ0bGgEzLyytkw8/f5G+g9I9quDowfKQ\nzGpA3uTq8EN16G4DZx1Ph60c4qldvbt9QUs3I7WQntdHJU9a40Sjt5Fjf3Q7\nkck3RsThXXMLLjDN5qmkAB4RyzxRfAM66DvQa903dt60nTtVnH7W8wcFrxxq\nU+t7KzwqVfEmEgJren7WJXDO8/snOpXcCjgCP+uE2Qs+PNNGZQYfibKpTPJl\nv9ZswXTNB1OPVU2zG5fN1dm+8gl417upokpc5fENxlZWx/8HfemMr4B7bXyo\nJn4L2GF8nICpglIrnZ0H6v7yra7XpFeM52paUQDJwWUrEv0AMWfIjO5f+bAt\nBa72jZgWmdcqtwcuEHmmBag/2U1jHlnEwViGqMR5G8NKA/Me084TIkHxTXQo\nWfBk/5dSgTH+ps9MRYUCAi2VJm5tb7Vi+O5dtBVeB7ozZ68Ha3sHrQKZB2sb\nhfa6Q2JHJavZ/LviGjmbaHi0hC1THWZ9Hi9hcC8cqAELgWGJV9MqVtMol+On\nXeXK\r\n=kKUh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEQKaIDvIqgWo1YJpGzPDw7BmaXETiqqkv0iqvdQBahcAiAWAk+aW+cgeApBHPnQgOfewiyremipLpQFeBRkKsDdGg=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.66950339_1552562668697_0.3379817988592786"},"_hasShrinkwrap":false},"0.19.0-alpha.67e66c5f":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.67e66c5f","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.5.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.67e66c5f","dist":{"shasum":"6a4e0631e3f03b455da07f6fd6ac8e8fa542beb4","integrity":"sha512-kE5RjkZcClPBK/ATof/ukEiKpb3/9s/G8BRircA+KQXbfBKMYKRuYo17ukfw3FxAEBhpuz7BBahkOsVRv7TzZg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.67e66c5f.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcimQXCRA9TVsSAnZWagAA1E4P/juXTukETJmiggUtC07h\nWpWpJiu9/pIf4M1tUDibnPnkJU3Oor4gKC+cUAaEf2z6PCTozYHRVRLnaL57\nZ2b1VrwNBO6N85zI1X5t49SwMoRZy4OkA8sjkgvzRoTkzooJ/CawVktNQ8xo\nM1PNXx2A4Vwtvd6lPolPcSB/ELcNS1SlCasjq6ehja9higXhPb/sTPrLcs4+\nHUFpPy1ucm2akPOtkzMkOaaijONUiJxDhVUAajCb3rTyoDPcdccxQYlhyeYS\ntylRXvH7xIEp8d+rGVMsh+tHA0nCG4LdnUGUKsusesL0Ut83lTXv5FDBIzIs\nPL3XUhiulKqGnu7A85co4oTTnNxzM5oWTojH2oy6aLhpdNlrAHVc33yVkvc7\nd2yUVwPLT3ArFhHTgE+0MMAKJlwCWeRxVqPMb4ZfziwQd1k8C84gc+NIp5J+\nGac2Z5+bv2J9YDTy8riFR64CGs92wQsgi77M/6ikNeCLanJql+H5sf4l0SXQ\nsLeQjCoCurYp2UCATQrCZ05pRmuw6gpkH/YA8fMqVlBnmcmgOwA2oYiBnWzF\nRQJflIlDO/PpApVpNpv1n0PSLAAzu8aeXAjo5g/t4n1OgJRfM00XDgFvJ4Ek\nbguLtwq5PodN2ZsNZHnFnySFNvdhuk2Odt45BZXrOAFK/rRFGlQa1uOqquvR\nV9aA\r\n=tcOr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+RMueJqbBqfuKt+OkZmduftsvDRul4bDXvwFUkGU6dQIgJqHrh2DFd/eGg1Ubsk30qhlfErzn8NlPd/+fahEft9s="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.67e66c5f_1552573462873_0.009500309568937215"},"_hasShrinkwrap":false},"0.19.0-alpha.58c6a93d":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.58c6a93d","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.5.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.58c6a93d","dist":{"shasum":"dd17027bb1d5af5731f5b74b385277d99e835ee8","integrity":"sha512-iIBC+BOJOyGEOuZcZA0pZsHYTR61OqI+RYVZSMM/6weS4gNeBaRABgfUTtVlF4g2svVGz98i3Extv+ykKtEx7w==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.58c6a93d.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcinOPCRA9TVsSAnZWagAA/MMP/027A9v6xckWAKlvU6AK\nJ84DbnompI21bEDicfpKArE31Ni/Pb3dRr6au0P3lUzJejsaPjrfwHQmtWY4\nHvLqref3D5Cujl1QiACo2hnxFCNdRTRELTl34UZxSkRCEID0+ezv5s6i2s4f\nJqJGNLBohPUcnFqd+LtABraKqIpqX4r5EuYxjH3BcewdNfBXSHNgRgoEFv6Q\n40DZrsH0epbkevAztztpyVHSaco/IzHgqFpRVA8Zxy+2LIAEMzIYh3DfFL0z\n+vajuvXDHiAUvo59HWECzmhU3mP3Mv/fT2huODrIGI3lGySj0YfmTyO8PMhZ\nfUb6IBOC5WagtYZsXbZieQdZQTuDFxjzwdQlXP2Z0/jZV9eVAI3OqzgSuZ9Z\nlXrsndQE6H2x7O+AEkLlRUwUhedsBRG8a8fbhcNKDYf+FeagDuzVQ5QGP4Nb\nLrEKA0el4yHG+PRSFSarYIG8kis+jLdaB9ZKu35pNJOlEWnwH6MAH2C4M7/V\nj/zxUJgyHlAbIfFygyfkoEdPG2nK9PoUVBRmU0r6pLkuEmh5XA3oH7uefLEx\nmtkhKGs7p3d7A70ALdixVqfawmCyaLYKMNZUHpCqhkQglyTMwlkK5TgZANmV\nnYRuNWgV20IF93ayrNdf4PS9IgU9aqzhuSCGJvmGq6hRWDoD5E33dwohpoVp\n15cy\r\n=2PYE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEMNrCN2bQCqddy3unrbEPMZW/krGqKP9P7ILnofnwnJAiEAj9ZQxG+zjzvSKyuWKrIDqcT6DFBSJ2ezpRj1/xtKXi4="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.58c6a93d_1552577423093_0.5941274477696163"},"_hasShrinkwrap":false},"0.19.0-alpha.28c537b2":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.28c537b2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.5.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.28c537b2","dist":{"shasum":"8c626627e8cb8a9c02ec2409084a6cf938f540a9","integrity":"sha512-2T6JQ3M3e5gkIx4elzmT3N3JrmcEvQKSahfKKGGuDLRvqX/iyTLaSvLRb1mz81nhJAZ6kEMMPdW9aoo/wQlbIw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.28c537b2.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcinOlCRA9TVsSAnZWagAAjuYP/RS7AD8ofgQ6zmj0SGSt\neb69gOnj6vlazkz3hqmN//mYNeEJDbNZmGunOGAln3Vigva6t2x38No6p+XT\nlHnEWFn/PifPgcY4tsUmpRzH85VyAb9sCqcjPJ11qO8pNUm9k2T0hDIHRRMo\n4nnzsz/JHtKiAs1ZaGeV5RM8llvlYqVVe40Y1g+Q1I36bwJUOZMFKbL1wScO\ncSc5pU+z5uSP1NprtRTTk5jU+UvIV8aoThUy157b+gGAZuD3qXt4qtGrGdmr\nPQT11LHwYaDqejviuJVtpoXITbRU+uXNKo0S+lschCiujJFsVusLzfgnTp/C\nOJxM8sKP/suPskfEw2eT7TqrQxi5GdAu23GCVioftF7ATQTI3Qq3O4H6QIpw\n8yw3DJ+eachpM12ufnhzGsnvXNp+RheLxt1RK92c91PvttATvUE0JyXAEBxj\nU5lnf49sWmC/4xisLHS1zG+0De2op6q8NMunjgdNaKlk9EkIOmMWbDIEeZKh\n1sYqTDect7U2OVmZxngqRXPe8yJ7ZGiK/fbKLgWSHKM0Igo+6yJDvFwtCCCh\nmUZgGDW+54J/9KA+4lKnKU1VBFBDZnXjSqQuCFvzwMExheii6ab+fxeWzkDz\nBZViTifIZIHUbMgTuD2FeGcsGdl219Y19MEEVe2PoWkbEH3r+0OPKJH0q9iw\nS4wu\r\n=7NW8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDP4CP2tsxVoxlrPfa6xuCWK6jZrqeVxyZSWpTZePF1+QIhAKM3rTygr1oP6/cAdMbn5EvKfHEfPSKJtB8TLcnFVm/0"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.28c537b2_1552577444886_0.789784494285507"},"_hasShrinkwrap":false},"0.19.0-alpha.7713bf54":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.7713bf54","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.7713bf54","dist":{"shasum":"90c9358a54f7d63ebcba74ac4d89a376b4a31cf6","integrity":"sha512-L+wPET2p7DtyVNNljf7d+4KxPd3L3x4wlIwy7hVxTy4QtcdOOa8jManKJF8SegRhgzTAEwjaMDaYQn5baWseGg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.7713bf54.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJctfTHCRA9TVsSAnZWagAAyHEP/1wvlw/unGeBXaEuK3Pm\nO7BRTShAtMA1Zsh6kk6kv2y3QUW6p66yLzUdQsxbX2vYBchoa5jKjvmE41ig\nh73BT7PUxsJyH1N+SmPz1wrlR3OhL8r1wjGpy9+r61AwStKEeED0kxoVvXM0\nYUXgoJr6f/FzDW/wCJ0sDZp/YtZDiNxbLMDHjX3KbeuxxRMomgV1ZFY6rLDo\nBxoN7+2TCADMwB69BS2NCcMJABxOprlqxfQ7Mq4NFDGzxZzqF0TvPUEePi8U\nzmmEhjpQTPQTMpkCigp9kGpuiDGRkf+5elZku+twQbsdZelilq7VMU8XXbel\nHmwnsx4wkJcSWrTXAq4aDqSfzkZhMNTa7cf4ADnykEF/Str2WCeIfc1lv1Vt\nf3T94FjDrh7YcnlWcInhPOmRQDs2vAKJThDuivuWI+BMelXAXaHAOy9hyT/b\nKzN8qADrOkHdvTTTBFseXSBAuVXLlKoTIvqL7YH6YvhyH/1rEh9Sw0H4AY+e\nITguVgFH8HnT88J1rCjjmHjUO0cEKuq7373RStGVSTlCEHmkic5zYo3CBL3t\n/QO5AXYWfvk/J5HOu2HgyFtL4ko1CAEkTqrN4lX1R22avtAn4LusJL5WAn/K\nUNPqezoUxod5ViB1ElLS48/iexErjdfmPL2xcE4WAeKb0yTikbcuvsycyS5I\nWQL4\r\n=OOZp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGRRpU7LcOFECRP5SnASi9YF9/4NQMlSHI/8K3WfDPvCAiEAgZ2zrgnO/dNnHFrl64toY22jD5XUQndLcUC7ZFH72+M="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.7713bf54_1555428550552_0.5261714809625515"},"_hasShrinkwrap":false},"0.18.1":{"name":"codegen-templates-scripts","version":"0.18.1","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.1","dist":{"shasum":"c931bcc0d179e122f57d64470627d039dffc1ea0","integrity":"sha512-5VAZXBO8QhjtDWN4d7JyM+I3LnQt6AXpwjbJm8xxFq7qpd1UJ1Z67J7FKuQdOLtTgWp2Ul0RpPtiH65/SJNBsA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.1.tgz","fileCount":17,"unpackedSize":15987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJctfUmCRA9TVsSAnZWagAA2lMQAI9ZesIVtJ0ZMVlaCczT\nbactZ38FgOkNkMx47VmQdeXT+g9ZwvEKgLYWOBAuW1Fplf4XRLlAJ3TmtzHn\nX6mypgvYpsMAK2Sq2Cik4Ny8l0t9PcabweU9wQNZo4KSrzzJggABGCu1AbE1\nTuxr+aZOocQ7AHcvWvUT1hDwvkDlehzck4MXkhWq/qbZ/qk2XDye7IObJzZB\nq5jOHTdRZams7ClQ5b6P1W4PneafAVUPhoxguPgPQr6j7q77dqnl0sAiXQma\nM50ZUmA98DN3U7zFcbz15yrG7562Joh186xv6GvvoUlYYOZHleufYMM88xGW\nejcM+81pwGoU7H6re0bowJHw8bAs+pjQ3GordgwMMGIF7mO7ah1uB2pxMFqx\nGAFsxlFgXe01mnR9upg92fJyDYXhAo34EDsJgDGGy2tXioPUuMUo0lb20PaY\npVfRli7NtDpYEJhh/7blNi77c9BPXtaH3xFpMWZSePKjkdXFf1x1OpzXsJH5\neVbWAB4ONeqKea3DnfaDxSiflT2uf1XsVAcnNwKtyBu/7MG6bofIBwAPkJsb\nQrM0pZ/ZpappIz1y3SF54UOq7AjVFfkUZLNf0Gr32aki9owcsllcVVu0aUb0\nhxWGz/p6HQUc20vt0n6NNFELw2tMTheHt3QDyytrVamqjVf9zdV9HmWKzDzF\nuZ/k\r\n=VmcY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCn1lUVkGmVeiNLqbsOpBBgNZRNyodVXi9LSxe+duS4sQIhAKa5FdvBinWu8yA3eq/96lXUi17TQ3UzQMXofCEul5RR"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.1_1555428645545_0.7623112834706769"},"_hasShrinkwrap":false},"0.19.0-alpha.a49a2a96":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.a49a2a96","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.a49a2a96","dist":{"shasum":"68b2966f09634513b7313edd946b6d5a400424a5","integrity":"sha512-Hguo2k4twp7Sb6dKNRKn3gmxKuUaRYSNzct1k3aH0ZSI3Z48j3Tee8kgBqld+ER4fqUWtI4OyO/GYPIPnKoohA==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.a49a2a96.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJctfbHCRA9TVsSAnZWagAAJ84P/0VVeU39lRRZYPMqFzo4\nBJSjoASvW0PYGotPhUv/wPtFShmKbUmZjMGiD+QmX2q+9JSgun9km+h1Twhg\nfc5qCDoqmvdNYfLgzOlFBkNo25ZejbXpV7lG3RYIFN/qbwP5+NUv4/YEtq25\n/BEO+eYY2FZ1OY17VXEyFtsRlljAiBiIRVBHDKINYv6a33/kOsyPxHfpKfOa\nZyVUEFNaPGvYoqEEqs92p6IC5NDX358G+HUSlxeIcf5uAdC33a7PLOSn/BKf\n5k5LFMlNFaVAd9TmyD6WrkHvFiCON1KZ88dyNNuIfhmj3vMhbKuKAICoUoqy\nIaaS7S5MolU/TSwV2jmbT3GLp7F5L9I1s9tYS3BwvPXeFC190yn7TLn79Olk\n1BXYe+Y7dT4/rZv7tKii8UgaPdsjeJB7H5oh2jfUJZX+PMLK+dQg1oat1oLE\nnlaeU5879WT/l3tmm6Us1IqHb9aVmJVlMf+NR9yZwPedFJQ0rv0Eq55aSfCF\nWTCrUCQIH9nuusYu3i25ULyKBe5ahyXd3odp/+i78DuQOF/Dg8m8/4bMw0xH\n8GoqWg+92J1mdBIe0xtv1HgxnfmQGsEp/Kk+tswcwBuiBcq86a0MvllJM+Sp\nmB0Ipb+Y3/jCKSiiuu8fU2ROQO/AP0RcwD9UxQ63Zv+BFj5ps0KSvgn/Fu84\nFnz/\r\n=xVVR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBNEL3mjXP7+Xlp+Y/2Lr+vaINBEoXEVITnaOH5AZSn2AiAGMeS+lDv6LW3UogAQnWQSwDgFe6vCpBOmoTUWhykGmQ=="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.a49a2a96_1555429063124_0.63117235014246"},"_hasShrinkwrap":false},"0.19.0-alpha.964f7955":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.964f7955","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.964f7955","dist":{"shasum":"af1c3c030fa0bd06a960c41a35b37e281a22dabe","integrity":"sha512-gL0ql41SG/9a27Rh9Ryn8jPCUqYjetFrgPNk01MH06wemYBE+sVQYmTIzkmLw9s6u0sMtk2pOdTw2OKide87Mg==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.964f7955.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3S0jCRA9TVsSAnZWagAAc3oP/1tQY8t+O0QTpf4FTn2D\nVMpLrBf7RqZKn1qU6cf1+6F88Y/SuM071aaA7ltsXNpT4zfe3Eah8QmHXxRb\nir7zCY5Z3qSAGs1ycI7ODMPlCLeRzi8Oc0LgxfJCYUVBZ53DVqWVUygL5XZB\ngWco68YGjfY5lb2HVBD14JMxpRtRcDO2xA8DQIVYD3M1wtYBy1YdL7BorkQF\nBqXSoIKgdQwCDCXK6cspMHVgvifUoneDL0c1hIblcXrtmLkCo286Yr3RR0h2\npz6nXLpmzhMvsVitFHuoYdn6VpUtQaIOPPDfObNx4W17UW6G6mdb33laRFVt\n71nBgUZ9Jg1SmH3iLplLtzzAcBmdxe5mL3yVAqg+Ob/2nHDSPemvJGT8l8wv\nggDkausmvaIh/WxYUSm4Mq4e6drY5EDX5humuWmbEpc4UW1f15E6C3zbuUSV\nwRu1sSxjFzxDQOOCP0/+T5pQAJYz7tIRhOTMyoVOJ/LwEJWCbFQ1XBQYBM2g\nhzRMhnPl2FUKP0gJXkHXmyL/BWuyuJQ1+2wJhBZsfFSKVEo2QDz2/KOzVZBj\n1WwaH0Qp8LehZRJmzrn/HqjNs8MOjFCRhmdvFgsreMIachL3PWEJnDh73MhC\nZr7vr6uy0UF2GhrsJsfFn8DIGaZLITf6WefOZN9crlt4NTXylOGvN9IBr9U6\nG8fY\r\n=UhLA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHTf4BleMwNZssyzr9z7K4hPDuCGyrFZD/Jiq+uZ1RIQAiEAw/Ki21e/5Tm8sz7ssldheF1a5mQHQ41xG0yrLq2FIjo="}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.964f7955_1557998883091_0.6251760204371017"},"_hasShrinkwrap":false},"0.18.2":{"name":"codegen-templates-scripts","version":"0.18.2","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.18.2","dist":{"shasum":"6256a554f920e80a5512cd4845dbc9d26030a9bd","integrity":"sha512-8BDOoK3HcVjJIhR8PViwP2sxXtw08FJ0dMs7jTSCChQqXGO3lL5mfs0MtHXpvDlvEhaDnbISv4fhCPC5wHXE5g==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.18.2.tgz","fileCount":17,"unpackedSize":15987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3TIQCRA9TVsSAnZWagAAbTgQAI6upAUyB8JJcTpzh6gB\nhc1VRMMf5b+/wLGRbHgddaLpegk473D9Nkj+nJkyKQ5mEHOfeViSrl6VXBfR\n/xfI4TQn6D8ik9Kio2P9XxpgBWMcjqjg+5KF6IXcpijdF/J8RPmAp15iMVHW\nCLRBQca7Jhdepph/Q5/25eXg0T+a7uBKf4hUYK9zzrKa8KBc/kOIroBJwNK6\n54Z2Ug3XzYWp7zscKpnMWfA/ItDA5SRWY6xW77RJtDjy52hyr9kfmXBWLhVi\nV8uvp66GEj+RhXctSaZLPjjYB41lkGqAkZ+pNaTeMuZ7IKdlHgofqEU49hxa\nPXDup+BSPJn3rD3MZ3/Qcoe1DLBiibte1Qe7WbjE4qkfKZ1WRbFE+WiwJxzk\nGtMtaMtcH6g3uyVK5WiDlXBO9seDigKdx6C4jENtBpqNCF08talb+H8Dd8kF\nkpmf1AdoyY7iUrGEXYqGZDoNXRTC50IkrzqPm4/Z9u3+DfB8AXwQhueQ4SZQ\nEC00XUqONCNL1WWP/Afd2CyGpyTIV366DRippJhjlb3R+FUL7ZAAYhfW+U7z\neCrvLg9Y/xbQC90Dy0iT9G5iZRynE1qAkmq8ssLGVjQHKQnk7rN0hoWrhNP8\nP7eDo7l08sluS6Ydq/4j05e8nAN6g5Jncb4RL8eVKFzmTKqqsGKoLfVbzPCa\na5p9\r\n=JN56\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDD3UkFbOMXZSe3buGPm8ESn/Ki+ix8ur1pUQoDDJLxnwIhALc3BSaFIkMCRc//mCt16+TcBdkNczL2HiQOxllx3rDL"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.18.2_1558000143665_0.6815404983592996"},"_hasShrinkwrap":false},"0.19.0-alpha.80ec87c7":{"name":"codegen-templates-scripts","version":"0.19.0-alpha.80ec87c7","main":"cli.js","license":"MIT","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"},"dependencies":{"awesome-typescript-loader":"5.2.1","commander":"2.19.0","copyfiles":"2.1.0","jest":"24.1.0","raw-loader":"1.0.0","rimraf":"2.6.3","ts-jest":"24.0.0","typescript":"3.3.3333","webpack":"4.29.6","webpack-cli":"3.2.3","webpack-node-externals":"1.7.2"},"bin":{"codegen-templates-scripts":"./cli/codegen-templates-scripts.js"},"readmeFilename":"README.md","readme":"# Script utils for Handlebars Templates\n\nCreate GraphQL Codegen templates easily with this Handlebars.\n\nThis package exposes a CLI util called `codegen-templates-scripts` which allow you to easily create a GraphQL Codegen Template project, and built it without dealing with external utils.\n\nTo get started with this package, install it globally, or as local dependency inside an existing directory:\n\n    $ yarn global add codegen-templates-scripts\n\nThen, to start a new project, create a directory for your template project:\n\n    $ mkdir my-codegen-template\n    $ cd my-codegen-template\n\nNow, run the following command inside your directory:\n\n    yarn codegen-templates-scripts init\n\n> If some files such as `package.json` are already exists in this dir, please use `--overwrite` to make sure it changes it as well.\n\nNow, install the boilerplate dependencies by running:\n\n    yarn\n\nThe CLI util will create the boilerplate for you, so all you have to do it to write your own templates under `src/` and defined it in `config.ts` file.\n\n## Testing your template locally\n\nTo test your template locally, you can either test it on a real project and use `--template` and point it to your development directory (make sure to build it before).\n\nOr, take a look at the tests directory and see the unit-tests examples. To run these test just use `yarn test`.\n\n## Building and Publishing your template\n\nThis package comes with a built-in `build` command.\n\nAll you have to do is to run `yarn build` inside your project directory, in order to build it.\n\nTo publish your package, just use `npm publish` - everything else it already set for you.\n\n## `config.ts`\n\nThis file is in charge of configuration and declaration of your templates.\n\n### inputType\n\nAllowed values: `EInputType.SINGLE_FILE`, `EInputType.MULTIPLE_FILES`\n\n`inputType` defined the template input type of the generator, and also declares the generator output.\n\nFor example, we have TypeScript generators for both single and multiple files.\n\nThe input type field effects the rest of the fields:\n\n#### _SINGLE_FILE_\n\nWhen using `SINGLE_FILE`, you must specify the main template name, with a key called `index`, and this will be the root of your app.\n\nYou also need to specify the `outFile` of the package, which is the default file name in case of output filename was not specified through the CLI.\n\n#### _MULTIPLE_FILES_\n\nWhen using `MULTIPLE_FILES`, you need to specify a template for each available compilation context (refer to `templates` section for the list of available contexts).\n\nYou also need to specify the `filesExtension` for the generated files.\n\n### templates\n\n`templates` field should contains an object, where the key is the name of the template, and the value is a string.\n\nThere are special context types for templates, and each type of templates will compile with a different context:\n\n- `index`: use with `SINGLE_FILE` to declare the main entry point of the generated file, compiled with a merged object, containing all [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94) and [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175) fields.\n- `type`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `type`, this template will compile with _each_ [type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `inputType`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `input`, this template will compile with _each_ [input type](../../graphql-codegen-core/src/types.ts#L38-L46) in your schema.\n- `union`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `union`, this template will compile with _each_ [union](../../graphql-codegen-core/src/types.ts#L65-L69) in your schema.\n- `scalar`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `scalar`, this template will compile with _each_ [scalar](../../graphql-codegen-core/src/types.ts#L48-L51) in your schema.\n- `enum`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `enum`, this template will compile with _each_ [enum](../../graphql-codegen-core/src/types.ts#L53-L57) in your schema.\n- `interface`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL schema `interface`, this template will compile with _each_ [interface](../../graphql-codegen-core/src/types.ts#L71-L76) in your schema.\n- `operation`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL operation (`query`/`mutation`/`subsription`), this template will compile with [`Operation` context](../../graphql-codegen-core/src/types.ts#L151-L161).\n- `fragment`: use with `MULTIPLE_FILES` to declare that this template belongs to GraphQL `fragment`, this template will compile with [`Fragment` context](../../graphql-codegen-core/src/types.ts#L144-L149).\n- `schema`: use with `MULTIPLE_FILES` to compile with [`SchemaTemplateContext`](../../graphql-codegen-core/src/types.ts#L78-L94).\n- `documents`: use with `MULTIPLE_FILES` to compile with all operations, the context will be [`Document`](../../graphql-codegen-core/src/types.ts#L170-L175).\n- `all`: same as to `index`.\n\nAlso, all templates specified under `templates` will be loaded as Handlebars template partials, so you can use it any time inside other templates, for example, the following templates definitions:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet}}',\n    selectionSet: 'Hello'\n  }\n  // ...\n};\n```\n\nThe `index` template loads `selectionSet` template, and it can also provide a context for the specific partial:\n\n```typescript\nconst config = {\n  // ...\n  templates: {\n    index: '{{>selectionSet types}}',\n    selectionSet: '{{#each this }} Type name: {{ name }}{{/each}}'\n  }\n  // ...\n};\n```\n\n> You can also load a template from itself, and create a recursive generation of the template.\n\n### flattenTypes\n\nType flattening is a useful feature when generation a template, when `true` is specified, the generator will return a flatten version of the GraphQL selection set when using inner types.\n\nFor example, let's take a look in the following GraphQL schema and `query`:\n\n```graphql schema\ntype NameFields {\n  firstName: String\n  lastName: String\n}\n\ntype User {\n  name: NameFields\n  email: String\n  age: Int\n}\n\ntype Query {\n  me: User\n}\n\nschema {\n  query: Query\n}\n```\n\n```graphql\nquery myQuery {\n  user {\n    me {\n      firstName\n      lastName\n    }\n  }\n}\n```\n\nThis query uses multiple levels of selection set (`user` > `name` > `firstName`), but when adding `flattenTypes: true`, the generator will append a new field to the operation/fragment context, called `innerModels`, and it this case it will contains the following:\n\n```\n[\n    {\n        schemaBaseType: 'User',\n        modelType: 'Me',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    },\n    {\n        schemaBaseType: 'NameFields',\n        modelType: 'Name',\n        fields: [ ... ] // Original SelectionSetFieldNode from the operation\n        // .. more fields\n    }\n]\n```\n\nSo the two available levels of selection set were flatten into a single level, so you can generate you whole selection set in a single iteration.\n\nThe `modelType` becomes the name of the selection set field, because we use only part of the available fields (for example, the query only asks for part of the `User` fields), so we can't use the actual GraphQL `type` from the schema - so each selection set creates new \"types\", and the usage in the selection set also changes, so the `type` of `me` is not `User` - it's `Me`.\n\nThe actual compilation context when using `flattenTypes: true` is [available here](../../graphql-codegen-compiler/src/types.ts#L11-L37).\n\n### primitives\n\nSpecify `primitives` object map to replace the original GraphQL built-in types to a language-specific primitives.\n\nFor example, GraphQL type of `String` is actually a `string` in TypeScript.\n\n### outFile\n\nUse with `SINGLE_FILE`, specify the default filename for the generated file.\n\n### filesExtension\n\nUse with `MULTIPLE_FILES`, specify the file extension for the generated files.\n\n### customHelpers\n\nWith `customHelpers` you can add custom helpers that executes with your custom templates.\n\nProvide an object with `key` as the name of the helper, and a `Function` for the helper execution. you can also specify a path to a local JavaScript file.\n","description":"Create GraphQL Codegen templates easily with this Handlebars.","_id":"codegen-templates-scripts@0.19.0-alpha.80ec87c7","dist":{"shasum":"ef8b2cf49f6c753e9942c23d20890ea0272d4240","integrity":"sha512-nKt7o5aCxeL3pLI77w7jHgKgcMfyIAq1EnF9ikLV/924yeK6doPJy6aEcNZj9155FQKI1CZqXlySKgzrAFLVPw==","tarball":"https://registry.npmjs.org/codegen-templates-scripts/-/codegen-templates-scripts-0.19.0-alpha.80ec87c7.tgz","fileCount":17,"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3TOqCRA9TVsSAnZWagAALP8P/07V5DKAEszL13m/ACc9\nAVs84hVlncU5DB20tCnMLQBhbeIcvAFOyh5TGIR25Burq0xlfBicJ11emeSS\nAxQa0exGiH/4cHtH6sionem66xfd7LnAqO9poDRb7boCWXk5VxUWKtd2An6W\n+QMm4Ho8TAqpxytjH1fP/KUrv2dq15LaggUD15cKeJXxQtGIWc1mLQN8QUDg\ntFh+OgDsz8W2Vmb6gAFCVDnwQMjohpsmYu2Jf2g3zB2xr5fwmaiGURvYopxy\nV3+1JQxoFDpX6OZZPby4Urav+CQJFLpvwsOVoeKywWF5yPUqtZ1gNsyWcJcD\n6SspPggvcOjE5qPOWY353pA3DS76Mq4AU85giWp6JebJ91oFTylihBWwOIqq\nmzoChCNcH6AQLh/r6InIn76Ovo0DnzyzYZ3Oh7qaAw/TicsDJoGBKGD9nlT6\nbBaelKlOqHgaDscnckpzIISUHGTLtqTDRHK6T8cB2WX+341/rIxLEMygY19r\n/Ga0EeSwJnFGXUcvQstmZeFzdu4WUyGCw2cl+EByb9QaDtJZMJcD6+vFw3Eo\nMBJmd6ue07nn6FZY43wgsvmjEEPZrPH4Aac5jeF++swtRkuNV+kemvl4otlN\n5Am91vPAWwfuoY9h7C/3/cmJkQAxOjYERDyFsGl7YKsAEQ3ysEI+coxMn27U\n1Sso\r\n=rmnq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+JsrdowU0KmuhIJHwIxt0qvjb6iwpAzyknTxK3dRLaAIhAPIvY6TdpCMwwduwfMv+7xcVuGonK6XO87Zl2FWiLlsE"}]},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codegen-templates-scripts_0.19.0-alpha.80ec87c7_1558000554220_0.7058979958178753"},"_hasShrinkwrap":false}},"time":{"created":"2018-07-03T09:53:51.972Z","0.10.0":"2018-07-03T09:53:52.055Z","modified":"2022-06-13T06:26:00.129Z","0.11.0-alpha.88f075da":"2018-07-03T14:25:01.185Z","0.10.1":"2018-07-03T14:27:53.474Z","0.10.2":"2018-07-12T07:32:45.800Z","0.10.3":"2018-07-12T09:06:27.090Z","0.11.0-alpha.05b04f2e":"2018-07-12T15:02:32.205Z","0.11.0-alpha.50095dc4":"2018-07-14T10:41:46.628Z","0.11.0-alpha.3f939e67":"2018-07-14T10:57:02.305Z","0.11.0-alpha.de921266":"2018-07-15T08:04:22.552Z","0.11.0-alpha.a72102c0":"2018-07-17T07:23:06.037Z","0.11.0-alpha.098b547d":"2018-07-17T07:39:36.655Z","0.11.0-alpha.60849746":"2018-07-17T07:56:49.573Z","0.11.0-alpha.38559577":"2018-07-17T15:07:05.006Z","0.11.0-alpha.8e7e5865":"2018-07-17T15:13:45.054Z","0.11.0-alpha.e73d4523":"2018-07-17T15:17:21.813Z","0.10.4":"2018-07-27T17:46:26.968Z","0.10.5":"2018-07-30T08:31:34.650Z","0.10.6":"2018-08-05T05:15:26.417Z","0.11.0-alpha.66aeac3a":"2018-08-07T09:51:00.651Z","0.11.0-alpha.24e6f8f5":"2018-08-07T10:23:59.590Z","0.11.0-alpha.0f864c7f":"2018-08-07T10:39:42.982Z","0.11.0-alpha.d942235c":"2018-08-07T11:04:07.612Z","0.11.0-alpha.1f1963ae":"2018-08-07T11:56:59.365Z","0.11.0-alpha.4c054a57":"2018-08-07T16:30:23.681Z","0.11.0-alpha.c2ace11c":"2018-08-08T10:11:39.540Z","0.11.0-alpha.d23d1b0f":"2018-08-08T10:59:59.644Z","0.11.0-alpha.e41fa5fe":"2018-08-08T11:13:05.533Z","0.10.7":"2018-08-08T11:29:01.658Z","0.11.0-alpha.0":"2018-08-20T19:57:44.182Z","0.11.0":"2018-08-21T15:13:26.377Z","0.12.0-alpha.821f12df":"2018-08-30T11:41:04.230Z","0.12.0-alpha.576bcbfb":"2018-09-01T14:16:11.506Z","0.12.0-alpha.e1a653eb":"2018-09-03T08:26:28.245Z","0.12.0":"2018-09-13T13:56:53.214Z","0.12.1":"2018-09-13T17:43:23.054Z","0.12.2":"2018-09-14T17:53:04.173Z","0.12.3":"2018-09-17T09:45:57.623Z","0.12.4":"2018-09-18T10:11:48.062Z","0.12.5":"2018-09-18T11:59:34.992Z","0.13.0-alpha.6d010135":"2018-09-18T15:40:23.119Z","0.13.0-patch.e0b0df1c":"2018-09-18T15:48:27.846Z","0.13.0-alpha.30bb2b9f":"2018-09-18T15:56:51.857Z","0.13.0-alpha.2d710114":"2018-09-18T16:00:53.949Z","0.13.0-alpha.106f2555":"2018-09-18T16:01:32.736Z","0.13.0-alpha.24f2cd83":"2018-09-19T13:20:53.012Z","0.13.0-alpha.68ff229c":"2018-09-19T15:36:04.771Z","0.13.0-alpha.b9bc1f8f":"2018-09-19T15:36:35.954Z","0.13.0-alpha.b2037482":"2018-09-19T18:59:48.524Z","0.13.0-alpha.367d1263":"2018-09-20T07:05:09.880Z","0.13.0-alpha.410e9357":"2018-09-20T07:05:17.009Z","0.13.0-alpha.ff740cbf":"2018-09-20T07:05:28.569Z","0.13.0-alpha.532a84c1":"2018-09-20T07:05:34.822Z","0.13.0-alpha.7595f4f0":"2018-09-20T07:09:15.356Z","0.13.0-alpha.06bc6df8":"2018-09-20T07:53:20.470Z","0.13.0-alpha.c32427e7":"2018-09-21T02:51:15.491Z","0.13.0-alpha.dadb76a7":"2018-09-21T13:33:13.631Z","0.13.0-alpha.bd6593f9":"2018-09-21T14:17:06.753Z","0.13.0-alpha.e2bcfb88":"2018-09-21T15:15:44.651Z","0.13.0-alpha.a443c507":"2018-09-21T18:08:55.024Z","0.13.0-alpha.858a6118":"2018-09-22T06:03:10.357Z","0.13.0-alpha.af122dac":"2018-09-23T09:12:18.533Z","0.13.0-alpha.58a29468":"2018-09-24T18:36:39.553Z","0.13.0-alpha.e638478f":"2018-09-24T20:30:08.245Z","0.13.0-alpha.45453f11":"2018-09-25T07:27:18.942Z","0.13.0-alpha.7cc1881f":"2018-09-25T08:54:35.022Z","0.13.0-alpha.c71ee1d3":"2018-09-25T08:55:04.651Z","0.12.6":"2018-09-25T08:57:54.597Z","0.13.0-alpha.19dcc773":"2018-09-25T09:00:44.169Z","0.13.0-alpha.b1595fb4":"2018-09-25T11:04:31.113Z","0.13.0-alpha.ecaa5be9":"2018-09-25T13:39:38.703Z","0.13.0-alpha.04fc18f1":"2018-09-25T20:47:22.886Z","0.13.0-alpha.f20d2d35":"2018-09-25T23:50:26.332Z","0.13.0-alpha.5ede60b2":"2018-09-26T07:06:42.533Z","0.13.0-alpha.7bc67d49":"2018-09-26T08:57:57.990Z","0.13.0-alpha.61708da9":"2018-09-27T07:23:50.255Z","0.13.0-alpha.77bc6e6b":"2018-09-27T12:49:12.635Z","0.13.0-alpha.3c236c15":"2018-09-27T13:02:26.754Z","0.13.0-alpha.4e397e7b":"2018-09-27T17:51:03.444Z","0.13.0-alpha.d0ab4cdb":"2018-09-27T17:51:35.928Z","0.13.0-alpha.3b142394":"2018-09-28T21:54:58.555Z","0.13.0-alpha.63e2a625":"2018-09-29T17:23:01.909Z","0.13.0-alpha.42633a9d":"2018-10-01T06:47:13.751Z","0.13.0-alpha.c39ae4aa":"2018-10-01T16:26:32.530Z","0.13.0-alpha.f8bd9be4":"2018-10-02T06:09:22.190Z","0.13.0-alpha.7c74c32e":"2018-10-02T07:48:40.496Z","0.13.0-alpha.ac5eb2a3":"2018-10-02T07:48:47.378Z","0.13.0-alpha.80fcd106":"2018-10-02T07:48:59.757Z","0.13.0-alpha.4330c431":"2018-10-02T07:50:04.468Z","0.13.0-alpha.9e0c7819":"2018-10-02T07:51:57.740Z","0.13.0-alpha.eb30b26a":"2018-10-02T07:53:00.761Z","0.13.0-alpha.fb5b2096":"2018-10-02T07:54:26.072Z","0.13.0-alpha.68bf59ca":"2018-10-02T07:55:21.533Z","0.13.0-alpha.c5edeadd":"2018-10-02T09:59:46.895Z","0.13.0-alpha.ef6e22ef":"2018-10-02T09:59:57.036Z","0.13.0-alpha.94e4c061":"2018-10-02T10:01:02.113Z","0.13.0-alpha.307ff120":"2018-10-02T10:02:52.664Z","0.13.0-alpha.67531045":"2018-10-02T10:03:28.327Z","0.13.0-alpha.4466a3e8":"2018-10-02T10:03:51.797Z","0.13.0-alpha.212bb6d8":"2018-10-02T10:28:30.776Z","0.13.0-alpha.965a9103":"2018-10-02T10:29:00.728Z","0.13.0-alpha.c3e00360":"2018-10-02T10:29:37.696Z","0.13.0-alpha.2d904238":"2018-10-02T10:33:17.581Z","0.13.0-alpha.ab37e4cb":"2018-10-02T10:49:17.868Z","0.13.0-alpha.4d884371":"2018-10-02T10:49:27.810Z","0.13.0-alpha.c2c17483":"2018-10-02T10:49:33.864Z","0.13.0-alpha.09f013b6":"2018-10-02T10:49:56.921Z","0.13.0-alpha.8f33023c":"2018-10-02T10:53:32.974Z","0.13.0-alpha.eff53b75":"2018-10-02T10:54:27.071Z","0.13.0-alpha.32c0e5b9":"2018-10-02T11:02:01.631Z","0.13.0-alpha.89295568":"2018-10-02T11:02:16.761Z","0.13.0-alpha.4c5693cf":"2018-10-02T11:18:51.855Z","0.13.0-alpha.6c2dd4c7":"2018-10-02T16:52:28.109Z","0.13.0-alpha.cc713899":"2018-10-02T17:28:34.672Z","0.13.0-alpha.5276d1c2":"2018-10-02T17:32:04.223Z","0.13.0-alpha.9ef3d2d8":"2018-10-02T18:48:45.702Z","0.13.0-alpha.67178b71":"2018-10-02T18:54:55.277Z","0.13.0-alpha.827d6cf4":"2018-10-03T06:12:02.400Z","0.13.0-alpha.6b090baf":"2018-10-03T06:15:01.860Z","0.13.0-alpha.64db831c":"2018-10-04T07:56:18.582Z","0.13.0-alpha.21eda4be":"2018-10-04T07:56:42.929Z","0.13.0-alpha.de54a1ab":"2018-10-04T07:57:01.645Z","0.13.0-alpha.10ba15b1":"2018-10-04T07:59:27.164Z","0.13.0-alpha.53d0f6e6":"2018-10-04T07:59:51.801Z","0.13.0-alpha.dda39b74":"2018-10-04T08:00:18.478Z","0.13.0-alpha.812f139a":"2018-10-04T12:26:15.306Z","0.13.0-alpha.292c69e7":"2018-10-04T12:29:16.893Z","0.13.0-alpha.fbd5cfd0":"2018-10-05T08:12:50.340Z","0.13.0-alpha.70bfed7e":"2018-10-05T10:16:16.919Z","0.13.0-alpha.f84c63c8":"2018-10-08T17:54:18.439Z","0.13.0-alpha.34876635":"2018-10-08T17:54:48.339Z","0.13.0-alpha.ce92f1a7":"2018-10-08T21:55:37.337Z","0.13.0-alpha.52e11cc9":"2018-10-08T22:27:35.791Z","0.13.0-alpha.2d5bc6ed":"2018-10-09T18:25:47.564Z","0.13.0-alpha.3e15e493":"2018-10-09T18:25:59.216Z","0.13.0-alpha.3c428293":"2018-10-09T19:13:12.372Z","0.13.0-alpha.b2838580":"2018-10-09T22:35:13.247Z","0.13.0-alpha.e695e4da":"2018-10-10T17:47:53.417Z","0.13.0-alpha.c15ef569":"2018-10-11T02:21:18.630Z","0.13.0-alpha.9d055057":"2018-10-11T08:16:50.619Z","0.13.0-alpha.6e088183":"2018-10-11T08:17:14.680Z","0.13.0-alpha.b10d1a81":"2018-10-11T08:17:23.292Z","0.13.0-alpha.fcfe0f11":"2018-10-11T08:17:53.835Z","0.13.0-alpha.c8fe1522":"2018-10-11T08:18:31.758Z","0.13.0-alpha.22f8282a":"2018-10-11T08:18:59.359Z","0.13.0-alpha.540619c1":"2018-10-11T08:19:29.418Z","0.13.0-alpha.5f5dbe1e":"2018-10-11T08:19:41.237Z","0.13.0-alpha.053c787f":"2018-10-11T08:20:14.734Z","0.13.0-alpha.eedbcd5b":"2018-10-11T08:20:55.437Z","0.13.0-alpha.7f8c1695":"2018-10-11T08:21:16.917Z","0.13.0-alpha.0c715bc1":"2018-10-11T08:21:52.532Z","0.13.0-alpha.cac7575f":"2018-10-11T08:23:17.207Z","0.13.0-alpha.c70ea0ba":"2018-10-11T08:25:21.004Z","0.13.0-alpha.7d3cc003":"2018-10-11T08:27:29.029Z","0.13.0-alpha.f3ce681b":"2018-10-11T08:28:08.495Z","0.13.0-alpha.41e3af52":"2018-10-11T23:28:30.201Z","0.13.0-alpha.c522fa56":"2018-10-12T09:58:57.372Z","0.13.0-alpha.c7a25a9f":"2018-10-12T16:47:41.654Z","0.13.0-alpha.02719f3f":"2018-10-13T07:54:51.175Z","0.13.0-alpha.90c73331":"2018-10-13T07:55:10.845Z","0.13.0-alpha.1d0a3ebc":"2018-10-13T07:55:18.893Z","0.13.0-alpha.d8bd2057":"2018-10-15T23:17:49.456Z","0.13.0-alpha.df4e458a":"2018-10-16T01:19:46.092Z","0.13.0-alpha.7f716f02":"2018-10-16T07:52:11.303Z","0.13.0-alpha.c5ee0f70":"2018-10-16T07:55:16.257Z","0.13.0-alpha.4582497f":"2018-10-17T18:33:42.264Z","0.13.0-alpha.1dde25b5":"2018-10-18T09:48:27.713Z","0.13.0-alpha.8e20bfdb":"2018-10-18T11:31:37.320Z","0.13.0-alpha.b843184f":"2018-10-18T11:31:53.839Z","0.13.0-alpha.adf58fc6":"2018-10-18T18:47:15.390Z","0.13.0-alpha.1b8ec9bf":"2018-10-21T09:59:02.596Z","0.13.0-alpha.c5c9f329":"2018-10-21T13:52:12.359Z","0.13.0-alpha.c80566f8":"2018-10-21T13:52:47.837Z","0.13.0-alpha.779c2664":"2018-10-22T09:16:20.783Z","0.13.0-alpha.40dca563":"2018-10-22T09:44:30.621Z","0.13.0-alpha.32c1e109":"2018-10-22T10:28:23.255Z","0.13.0-alpha.5900f558":"2018-10-22T10:34:29.358Z","0.13.0-alpha.215bbdd7":"2018-10-22T18:21:59.255Z","0.13.0-alpha.86ea85d2":"2018-10-22T18:38:59.399Z","0.13.0-alpha.7928031b":"2018-10-22T18:47:52.143Z","0.13.0-alpha.12d55318":"2018-10-22T20:10:32.345Z","0.13.0-alpha.880a7d8b":"2018-10-22T20:15:23.851Z","0.13.0-alpha.ecb12fd4":"2018-10-22T20:55:27.562Z","0.13.0-alpha.a478937c":"2018-10-22T21:50:24.669Z","0.13.0-alpha.13238437":"2018-10-22T21:51:11.510Z","0.13.0-alpha.fe224229":"2018-10-22T21:51:46.930Z","0.13.0-alpha.15be85ed":"2018-10-23T13:37:00.406Z","0.13.0-alpha.dc6c7f04":"2018-10-23T17:09:30.653Z","0.13.0-alpha.2edce5cb":"2018-10-23T19:01:06.354Z","0.13.0-alpha.658244db":"2018-10-24T08:47:54.645Z","0.13.0-alpha.26308f26":"2018-10-24T08:49:03.202Z","0.13.0-alpha.4920d0fc":"2018-10-24T08:52:20.504Z","0.13.0-alpha.7077c93b":"2018-10-24T09:17:41.612Z","0.13.0-alpha.c9f9ab19":"2018-10-24T09:19:46.538Z","0.13.0-alpha.6f5ee178":"2018-10-24T09:29:35.556Z","0.13.0-alpha.4b7fa3c0":"2018-10-24T11:08:25.384Z","0.13.0-alpha.25f355ca":"2018-10-24T11:10:41.012Z","0.13.0-alpha.34d7ada0":"2018-10-24T15:56:53.329Z","0.13.0-alpha.fa3dd811":"2018-10-24T15:59:03.181Z","0.13.0-alpha.4d092902":"2018-10-24T16:47:13.926Z","0.13.0-alpha.30c6f3e8":"2018-10-24T20:13:08.069Z","0.13.0-alpha.6f0b9893":"2018-10-24T20:13:16.108Z","0.13.0-alpha.c37d6ad9":"2018-10-25T09:16:42.127Z","0.13.0-alpha.2c860cbd":"2018-10-25T09:23:18.426Z","0.13.0-alpha.58aa4191":"2018-10-25T09:39:57.112Z","0.13.0-alpha.f9e01717":"2018-10-25T10:15:17.256Z","0.13.0-alpha.21241530":"2018-10-25T10:16:51.327Z","0.13.0-alpha.2ce671cc":"2018-10-25T10:17:12.359Z","0.13.0-alpha.50e1e305":"2018-10-25T10:29:55.603Z","0.13.0-alpha.8e0abd35":"2018-10-25T10:34:03.811Z","0.13.0-alpha.1ac82e62":"2018-10-25T11:46:38.662Z","0.13.0-alpha.8be2b1e6":"2018-10-25T12:08:07.833Z","0.13.0-alpha.3468ac24":"2018-10-25T12:15:09.146Z","0.13.0-alpha.04fc7cc7":"2018-10-25T13:31:29.944Z","0.13.0-alpha.4f9e6f08":"2018-10-25T13:51:35.241Z","0.13.0-alpha.18bdad2e":"2018-10-25T13:53:41.873Z","0.13.0-alpha.eacbee5c":"2018-10-25T15:51:29.196Z","0.13.0-alpha.f8c8892a":"2018-10-25T16:10:09.689Z","0.13.0-alpha.f0398853":"2018-10-26T09:04:56.059Z","0.13.0-alpha.f3384d84":"2018-10-26T09:05:22.005Z","0.13.0-alpha.7a22cb2a":"2018-10-26T09:09:03.010Z","0.13.0-alpha.e3b86daa":"2018-10-26T12:21:41.690Z","0.13.0-alpha.34c9c8c7":"2018-10-26T12:52:41.622Z","0.13.0-alpha.b99853ae":"2018-10-26T13:19:53.995Z","0.13.0-alpha.a6dc2cdf":"2018-10-26T13:37:48.017Z","0.13.0-alpha.fe7f3e8e":"2018-10-26T14:20:27.602Z","0.13.0-alpha.064aaaac":"2018-10-26T15:59:12.958Z","0.13.0-alpha.17b3de0c":"2018-10-26T21:21:50.524Z","0.13.0-alpha.180a136b":"2018-10-27T01:55:18.769Z","0.13.0-alpha.ff7cf3bf":"2018-10-27T07:48:03.874Z","0.13.0-alpha.5df8f2b8":"2018-10-27T09:27:09.359Z","0.13.0-alpha.7812c9f0":"2018-10-27T09:27:14.403Z","0.13.0-alpha.1c25bcc3":"2018-10-27T09:57:11.248Z","0.13.0-alpha.f7a1fe33":"2018-10-27T09:58:57.050Z","0.13.0-alpha.2b4b25ac":"2018-10-27T17:31:03.119Z","0.13.0-alpha.dae974ff":"2018-10-27T17:34:10.830Z","0.13.0-alpha.db7db7b5":"2018-10-27T18:20:34.291Z","0.13.0-alpha.1036df2c":"2018-10-27T18:26:06.169Z","0.13.0-alpha.a5a7962f":"2018-10-27T18:59:55.123Z","0.13.0-alpha.8dba4aeb":"2018-10-27T19:10:50.796Z","0.13.0-alpha.75065061":"2018-10-27T19:13:29.434Z","0.13.0-alpha.053963c9":"2018-10-27T21:57:33.530Z","0.13.0-alpha.a8fa20a9":"2018-10-28T12:56:19.706Z","0.13.0-alpha.96742667":"2018-10-28T15:56:09.904Z","0.13.0-alpha.41be2362":"2018-10-29T10:30:07.397Z","0.13.0-alpha.9a8a0654":"2018-10-29T10:34:23.995Z","0.13.0-alpha.f6ccc34c":"2018-10-29T10:39:18.092Z","0.13.0-alpha.42376d8c":"2018-10-29T10:42:36.255Z","0.13.0-alpha.68753636":"2018-10-29T15:44:23.002Z","0.13.0-alpha.e54c047f":"2018-10-29T17:28:40.355Z","0.13.0-alpha.4bf4aa96":"2018-10-29T17:58:48.838Z","0.13.0-alpha.13cefbdd":"2018-10-29T19:35:42.703Z","0.13.0-alpha.c4a47fc3":"2018-10-29T20:36:38.574Z","0.13.0-alpha.5bbf4d4f":"2018-10-29T21:58:13.114Z","0.13.0-alpha.bff9b6a4":"2018-10-30T07:36:56.754Z","0.13.0-alpha.4466f6e3":"2018-10-30T07:37:01.553Z","0.13.0-alpha.576fc71f":"2018-10-30T07:37:24.815Z","0.13.0-alpha.fa30b773":"2018-10-30T07:39:00.072Z","0.13.0-alpha.31a499db":"2018-10-30T07:39:17.451Z","0.13.0-alpha.f7c23626":"2018-10-30T07:39:36.493Z","0.13.0-alpha.43b5774c":"2018-10-30T07:58:32.326Z","0.13.0-alpha.ca932b4e":"2018-10-30T07:59:04.513Z","0.13.0-alpha.fb93ced7":"2018-10-30T07:59:25.254Z","0.13.0-alpha.e2710037":"2018-10-30T08:01:41.487Z","0.13.0-alpha.898ab460":"2018-10-30T09:12:34.472Z","0.13.0-alpha.3fc4ec09":"2018-10-30T09:19:30.752Z","0.13.0-alpha.612fa4cb":"2018-10-30T20:08:02.886Z","0.13.0-alpha.70def5f8":"2018-10-31T06:02:32.518Z","0.13.0":"2018-10-31T06:09:17.529Z","0.14.0-alpha.6e18acb1":"2018-10-31T06:11:29.453Z","0.14.0-alpha.3861680e":"2018-10-31T11:48:12.217Z","0.14.0-alpha.753cf9d2":"2018-10-31T13:49:57.440Z","0.13.0-alpha.a51638ed":"2018-10-31T16:24:23.919Z","0.14.0-alpha.92ec3c00":"2018-10-31T17:41:30.314Z","0.14.0-alpha.5aabe967":"2018-10-31T17:43:48.419Z","0.14.0-alpha.7537dfee":"2018-10-31T20:48:49.010Z","0.14.0-alpha.42a7054a":"2018-11-01T07:04:46.128Z","0.14.0-alpha.13706952":"2018-11-01T07:05:30.343Z","0.14.0-alpha.b4492c37":"2018-11-01T16:18:23.119Z","0.14.0-alpha.8c647ccd":"2018-11-01T17:58:26.597Z","0.14.0-alpha.58a2c883":"2018-11-01T19:33:07.703Z","0.14.0-alpha.0292b740":"2018-11-01T21:30:42.915Z","0.14.0-alpha.7cc612f8":"2018-11-01T23:40:08.473Z","0.14.0-alpha.31f55221":"2018-11-02T00:42:04.698Z","0.14.0-alpha.2e1219b8":"2018-11-02T08:14:29.825Z","0.14.0-alpha.cd9a7e57":"2018-11-02T08:15:31.873Z","0.14.0-alpha.6d918651":"2018-11-02T08:16:01.082Z","0.14.0-alpha.12b4fe0e":"2018-11-02T11:01:24.507Z","0.14.0-alpha.4c605fc9":"2018-11-02T12:32:57.447Z","0.14.0-alpha.45c04164":"2018-11-03T12:02:04.309Z","0.14.0-alpha.0c572152":"2018-11-04T17:39:25.410Z","0.14.0-alpha.150a7582":"2018-11-04T17:56:20.128Z","0.14.0-alpha.cfc8fe47":"2018-11-04T18:40:32.793Z","0.14.0-alpha.e90b63a5":"2018-11-04T18:52:30.003Z","0.14.0-alpha.5591e383":"2018-11-04T19:19:20.501Z","0.14.0-alpha.69d49fc2":"2018-11-05T06:51:58.800Z","0.14.0-alpha.197bcfb7":"2018-11-05T09:22:06.601Z","0.14.0-alpha.72564d2a":"2018-11-05T13:26:49.167Z","0.14.0-alpha.7c111b43":"2018-11-05T14:09:21.328Z","0.14.0-alpha.0bf44189":"2018-11-05T15:27:34.308Z","0.14.0-alpha.a9096b1b":"2018-11-05T18:58:54.481Z","0.14.0-alpha.667411c7":"2018-11-05T20:46:29.117Z","0.14.0-alpha.079e17f5":"2018-11-05T22:57:34.393Z","0.14.0-alpha.08d3f8ea":"2018-11-06T07:46:56.849Z","0.14.0-alpha.932a4f69":"2018-11-06T08:53:25.513Z","0.14.0-alpha.d4fd0077":"2018-11-06T08:53:34.066Z","0.14.0-alpha.8e19c3fb":"2018-11-06T08:53:42.036Z","0.14.0-alpha.10dfa501":"2018-11-06T13:14:39.509Z","0.14.0-alpha.a5b572ed":"2018-11-06T14:04:34.185Z","0.14.0-alpha.21950c91":"2018-11-06T14:30:52.819Z","0.14.0-alpha.d3681d44":"2018-11-06T15:03:38.763Z","0.14.0-alpha.600d2aab":"2018-11-06T19:14:42.099Z","0.14.0-alpha.365ebd86":"2018-11-07T01:46:09.704Z","0.14.0-alpha.a7d6cc1b":"2018-11-07T03:34:35.940Z","0.14.0-alpha.f29bb497":"2018-11-07T08:12:53.425Z","0.14.0-alpha.d8402d86":"2018-11-07T08:13:12.081Z","0.14.0-alpha.3b5bda17":"2018-11-07T08:56:36.850Z","0.14.0-alpha.e0b152f9":"2018-11-07T09:17:26.892Z","0.14.0-alpha.3ba697be":"2018-11-07T09:26:31.590Z","0.14.0-alpha.217d012f":"2018-11-07T09:28:56.700Z","0.14.0-alpha.7a8564cf":"2018-11-07T09:41:32.969Z","0.14.0-alpha.12824a93":"2018-11-07T10:19:13.454Z","0.14.0-alpha.65c5da61":"2018-11-07T10:22:42.860Z","0.14.0-alpha.2b5dd4de":"2018-11-07T10:23:24.313Z","0.14.0-alpha.0dc3c08f":"2018-11-07T10:25:35.667Z","0.14.0-alpha.6ec6ac43":"2018-11-07T10:34:33.978Z","0.14.0-alpha.028ad0ed":"2018-11-07T11:55:38.468Z","0.14.0-alpha.1b4ee721":"2018-11-07T12:04:48.884Z","0.14.0-alpha.56eee35e":"2018-11-07T12:12:04.374Z","0.14.0-alpha.ad801dc3":"2018-11-07T12:37:31.432Z","0.14.0-alpha.ae45d308":"2018-11-07T13:03:20.089Z","0.14.0-alpha.a4fbd654":"2018-11-07T13:57:22.555Z","0.14.0-alpha.28268e43":"2018-11-07T14:13:53.355Z","0.14.0-alpha.609b90b2":"2018-11-07T14:41:06.250Z","0.14.0-alpha.c0b3122c":"2018-11-07T16:23:41.165Z","0.14.0-alpha.cbd3f405":"2018-11-07T16:24:28.379Z","0.14.0-alpha.0088a6ab":"2018-11-07T17:24:22.501Z","0.14.0-alpha.51ab2f2f":"2018-11-07T18:09:26.083Z","0.14.0-alpha.9218e2b8":"2018-11-07T18:29:02.792Z","0.14.0-alpha.70003040":"2018-11-07T18:36:52.429Z","0.14.0-alpha.ccdfeb71":"2018-11-07T19:28:59.576Z","0.14.0-alpha.a4838807":"2018-11-07T23:43:09.901Z","0.14.0-alpha.ebdda7aa":"2018-11-08T07:07:22.384Z","0.14.0-alpha.8d8bee2f":"2018-11-08T08:46:31.079Z","0.14.0-alpha.c9d705fd":"2018-11-08T11:22:44.037Z","0.14.0-alpha.79f8d805":"2018-11-08T11:28:02.973Z","0.14.0-alpha.4a64f195":"2018-11-08T11:29:33.158Z","0.14.0-alpha.07bda304":"2018-11-08T12:16:42.803Z","0.14.0-alpha.a71f9d83":"2018-11-08T12:19:57.878Z","0.14.0-alpha.0d34d7bc":"2018-11-08T12:20:15.440Z","0.14.0-alpha.5d14f9ae":"2018-11-08T12:20:53.254Z","0.14.0-alpha.1effdd2e":"2018-11-08T13:26:44.034Z","0.14.0-alpha.33699d2b":"2018-11-08T14:13:24.100Z","0.14.0-alpha.b04233ad":"2018-11-08T14:30:38.395Z","0.14.0-alpha.deabf4b9":"2018-11-08T14:33:26.987Z","0.14.0-alpha.8db877df":"2018-11-08T14:48:53.592Z","0.14.0-alpha.f1e5a0c0":"2018-11-08T15:30:47.022Z","0.14.0-alpha.d39554c4":"2018-11-08T15:33:28.613Z","0.14.0-alpha.4f6651d6":"2018-11-08T15:56:41.317Z","0.14.0-alpha.320d80a7":"2018-11-08T15:59:04.359Z","0.14.0-alpha.9fd01297":"2018-11-08T16:32:47.798Z","0.14.0-alpha.73107458":"2018-11-08T18:40:17.967Z","0.14.0-alpha.9ae230a1":"2018-11-08T18:42:25.948Z","0.14.0-alpha.75231e89":"2018-11-08T19:02:26.047Z","0.14.0-alpha.f7561c79":"2018-11-08T19:39:41.561Z","0.14.0-alpha.b621df0d":"2018-11-08T19:49:46.559Z","0.14.0-alpha.d940567c":"2018-11-08T19:56:47.395Z","0.14.0-alpha.d4cb7a5e":"2018-11-08T20:38:00.961Z","0.14.0-alpha.7b52c5bd":"2018-11-08T20:50:53.557Z","0.14.0-alpha.e1d2272f":"2018-11-08T20:57:21.929Z","0.14.0-alpha.10b46622":"2018-11-09T17:06:01.212Z","0.14.0-alpha.b36b8079":"2018-11-09T22:42:57.312Z","0.14.0-alpha.61fad1d1":"2018-11-10T01:48:00.341Z","0.14.0-alpha.4e941c37":"2018-11-10T01:49:17.094Z","0.14.0-alpha.cdbaa3ca":"2018-11-10T04:38:04.564Z","0.14.0-alpha.23ea5a67":"2018-11-10T17:47:17.482Z","0.14.0-alpha.b838ee10":"2018-11-10T18:03:13.575Z","0.14.0-alpha.ba87906d":"2018-11-11T00:43:21.529Z","0.14.0-alpha.3e8b9116":"2018-11-11T01:51:38.480Z","0.14.0-alpha.d1abca73":"2018-11-11T01:52:35.479Z","0.14.0-alpha.0cd5095f":"2018-11-11T08:37:26.292Z","0.14.0-alpha.9703fc49":"2018-11-11T12:48:06.538Z","0.14.0-alpha.fad16cda":"2018-11-11T12:50:30.649Z","0.14.0-alpha.a14782b5":"2018-11-12T02:40:40.551Z","0.14.0-alpha.5d1122db":"2018-11-12T05:16:16.557Z","0.14.0-alpha.8406990a":"2018-11-12T06:35:58.756Z","0.14.0-alpha.a5bb75d2":"2018-11-12T11:13:13.964Z","0.14.0-alpha.de781063":"2018-11-12T11:42:47.492Z","0.14.0-alpha.f015a1ee":"2018-11-12T11:47:28.933Z","0.14.0-alpha.2cc3f625":"2018-11-12T12:10:28.396Z","0.14.0-alpha.c33a46b2":"2018-11-12T13:12:38.262Z","0.14.0-alpha.0b00bf89":"2018-11-12T14:01:35.289Z","0.14.0-alpha.0260ba30":"2018-11-13T00:05:23.925Z","0.14.0-alpha.1bd7b5ab":"2018-11-13T02:25:13.856Z","0.14.0-alpha.795d213a":"2018-11-13T06:31:58.595Z","0.14.0-alpha.efbcff97":"2018-11-13T06:41:19.543Z","0.14.0-alpha.74ae98e6":"2018-11-13T06:44:09.222Z","0.14.0-alpha.57fbc491":"2018-11-13T07:50:29.829Z","0.14.0-alpha.860692ee":"2018-11-13T07:56:41.561Z","0.14.0-alpha.d40fcf9c":"2018-11-13T09:10:26.410Z","0.14.0-alpha.75a033d5":"2018-11-13T11:11:01.814Z","0.14.0-alpha.38e06f3a":"2018-11-13T11:19:02.650Z","0.14.0-alpha.abf2abc1":"2018-11-13T11:19:07.746Z","0.14.0-alpha.d97d93cd":"2018-11-13T11:21:30.283Z","0.14.0-alpha.23913af1":"2018-11-13T14:58:59.367Z","0.14.0-alpha.992ef1c5":"2018-11-13T15:03:34.062Z","0.14.0-alpha.c2951130":"2018-11-13T15:21:36.422Z","0.14.0-alpha.1566ad27":"2018-11-13T15:34:15.542Z","0.14.0-alpha.c8e44dd0":"2018-11-13T17:14:15.119Z","0.14.0-alpha.6a8b5cfc":"2018-11-13T19:39:44.141Z","0.14.0-alpha.a4171527":"2018-11-14T00:10:33.540Z","0.14.0-alpha.e3d992b7":"2018-11-14T06:32:08.818Z","0.14.0-alpha.f3fb8b6a":"2018-11-14T08:13:48.716Z","0.14.0-alpha.43914c30":"2018-11-14T08:14:47.895Z","0.14.0-alpha.b1fed58e":"2018-11-14T08:15:22.313Z","0.14.0-alpha.0c5e69d5":"2018-11-14T08:35:11.187Z","0.14.0-alpha.f8a39b17":"2018-11-14T09:22:10.033Z","0.14.0-alpha.4d9ab511":"2018-11-14T09:29:59.168Z","0.14.0-alpha.245e1729":"2018-11-14T09:34:12.079Z","0.14.0-alpha.cb4cd223":"2018-11-14T09:57:00.082Z","0.14.0-alpha.2ceb8e08":"2018-11-14T09:58:22.188Z","0.14.0-alpha.624d9dc0":"2018-11-14T10:03:37.428Z","0.14.0-alpha.318c81c1":"2018-11-14T10:04:03.561Z","0.14.0-alpha.c7471403":"2018-11-14T13:25:07.404Z","0.14.0-alpha.e0b68192":"2018-11-15T02:27:23.740Z","0.14.0-alpha.6918c68f":"2018-11-15T02:57:08.634Z","0.14.0-alpha.ef29b5a2":"2018-11-15T09:04:21.187Z","0.14.0-alpha.ad8b70b5":"2018-11-15T09:31:51.220Z","0.14.0-alpha.79712f95":"2018-11-15T09:36:49.357Z","0.14.0-alpha.7868be68":"2018-11-15T09:36:54.210Z","0.14.0-alpha.dbdb6a68":"2018-11-15T09:37:10.852Z","0.14.0-alpha.9430727a":"2018-11-15T09:40:22.135Z","0.14.0-alpha.a81f478a":"2018-11-15T09:40:54.127Z","0.14.0-alpha.a3ad4912":"2018-11-15T10:28:45.074Z","0.14.0-alpha.ff6f91a9":"2018-11-15T10:32:46.265Z","0.14.0-alpha.6c22f8ca":"2018-11-15T10:34:05.908Z","0.14.0-alpha.1a6b1b1f":"2018-11-15T10:35:59.111Z","0.14.0-alpha.b16a622c":"2018-11-15T10:48:33.711Z","0.14.0-alpha.69da2212":"2018-11-15T15:32:46.532Z","0.14.0-alpha.84da663e":"2018-11-15T15:34:59.513Z","0.14.0-alpha.989ec240":"2018-11-15T21:04:39.808Z","0.14.0-alpha.4c8fc26b":"2018-11-16T00:51:35.699Z","0.14.0-alpha.0e923410":"2018-11-16T00:52:00.045Z","0.14.0-alpha.cf7d1146":"2018-11-16T00:53:21.626Z","0.14.0-alpha.c3bb00db":"2018-11-16T00:54:44.188Z","0.14.0-alpha.4df73d7f":"2018-11-16T01:33:37.944Z","0.14.0-alpha.73beac50":"2018-11-16T01:44:58.818Z","0.14.0-alpha.a4e47993":"2018-11-16T02:12:11.633Z","0.14.0-alpha.6fb1e99e":"2018-11-16T02:34:41.734Z","0.14.0-alpha.bc1935d7":"2018-11-16T02:35:17.661Z","0.14.0-alpha.bfd70d84":"2018-11-16T02:35:47.528Z","0.14.0-alpha.efbb7f7c":"2018-11-16T02:47:24.609Z","0.14.0-alpha.3ed7fee8":"2018-11-16T03:18:33.031Z","0.14.0-alpha.876b8e36":"2018-11-16T08:09:08.192Z","0.14.0-alpha.390507c0":"2018-11-16T08:09:38.343Z","0.14.0-alpha.eb34babc":"2018-11-16T08:12:22.692Z","0.14.0-alpha.a1c4e35d":"2018-11-16T08:34:54.657Z","0.14.0-alpha.56514cb5":"2018-11-16T08:39:32.107Z","0.14.0-alpha.fffccefb":"2018-11-16T09:05:52.672Z","0.14.0-alpha.c42826a4":"2018-11-16T09:09:45.193Z","0.14.0-alpha.d6839e6f":"2018-11-16T09:47:59.098Z","0.14.0-alpha.5e4ba2a9":"2018-11-16T09:55:31.020Z","0.14.0-alpha.cc0d6e1f":"2018-11-16T10:37:24.975Z","0.14.0":"2018-11-16T10:45:07.630Z","0.15.0-alpha.bf38b87b":"2018-11-16T21:43:33.243Z","0.15.0-alpha.5458e7b4":"2018-11-16T22:35:33.839Z","0.15.0-alpha.a013b04c":"2018-11-16T22:35:51.651Z","0.15.0-alpha.0cfe49ec":"2018-11-16T22:36:04.618Z","0.15.0-alpha.8541a1a3":"2018-11-16T23:13:33.468Z","0.15.0-alpha.bd62c390":"2018-11-16T23:14:03.310Z","0.15.0-alpha.e4e788a4":"2018-11-16T23:14:22.180Z","0.15.0-alpha.5f2a8354":"2018-11-17T00:42:44.256Z","0.15.0-alpha.6db34d30":"2018-11-17T00:43:20.470Z","0.15.0-alpha.b1f61774":"2018-11-17T00:43:55.515Z","0.15.0-alpha.f389bd15":"2018-11-17T01:19:12.589Z","0.15.0-alpha.a647e3d4":"2018-11-17T01:19:27.080Z","0.15.0-alpha.16760c04":"2018-11-17T02:48:20.160Z","0.15.0-alpha.ee31e4a8":"2018-11-17T02:55:42.883Z","0.15.0-alpha.addd396f":"2018-11-17T03:00:10.522Z","0.14.1":"2018-11-17T03:03:02.765Z","0.15.0-alpha.44dadab9":"2018-11-17T03:06:27.597Z","0.15.0-alpha.5a856f80":"2018-11-17T03:07:05.928Z","0.15.0-alpha.15f1e648":"2018-11-17T03:20:23.617Z","0.15.0-alpha.480727a0":"2018-11-17T03:20:30.734Z","0.15.0-alpha.76bfbe64":"2018-11-17T04:07:31.097Z","0.15.0-alpha.5fa0f731":"2018-11-17T04:09:21.375Z","0.15.0-alpha.2fd70590":"2018-11-17T04:09:56.717Z","0.15.0-alpha.90fa6c34":"2018-11-17T04:10:35.676Z","0.15.0-alpha.ddfb88fb":"2018-11-17T15:32:24.399Z","0.15.0-alpha.16d780fc":"2018-11-17T15:33:13.846Z","0.15.0-alpha.055fe81f":"2018-11-17T16:13:27.497Z","0.15.0-alpha.79512000":"2018-11-17T20:24:04.356Z","0.15.0-alpha.aa6644ca":"2018-11-18T17:18:55.629Z","0.15.0-alpha.205f7c08":"2018-11-18T23:53:25.805Z","0.15.0-alpha.f6bd44c5":"2018-11-19T00:53:42.689Z","0.15.0-alpha.b3d4adf9":"2018-11-19T00:53:55.892Z","0.15.0-alpha.14aa151c":"2018-11-19T00:54:01.390Z","0.15.0-alpha.38c66ebe":"2018-11-19T08:57:25.124Z","0.15.0-alpha.0c9be47e":"2018-11-19T12:56:23.707Z","0.15.0-alpha.7f546158":"2018-11-20T00:41:59.048Z","0.15.0-alpha.8055a3b0":"2018-11-20T00:46:26.605Z","0.15.0-alpha.3736a87d":"2018-11-20T00:47:25.198Z","0.15.0-alpha.257163a3":"2018-11-20T01:29:34.019Z","0.15.0-alpha.9ccb668a":"2018-11-20T01:35:44.510Z","0.15.0-alpha.4877f55f":"2018-11-20T02:21:38.890Z","0.15.0-alpha.20a298e6":"2018-11-20T09:56:39.718Z","0.15.0-alpha.e6a49ca2":"2018-11-20T10:24:53.973Z","0.15.0-alpha.7944ad7f":"2018-11-20T13:37:47.911Z","0.15.0-alpha.fdc14503":"2018-11-20T14:26:12.399Z","0.15.0-alpha.771c0019":"2018-11-20T16:41:55.048Z","0.15.0-alpha.b1bf6983":"2018-11-20T16:55:32.523Z","0.15.0-alpha.1ad55ba5":"2018-11-20T19:29:13.501Z","0.15.0-alpha.dfa77049":"2018-11-21T00:04:21.711Z","0.15.0-alpha.bb94998c":"2018-11-21T00:04:28.028Z","0.15.0-alpha.4e56f4d5":"2018-11-21T00:04:57.097Z","0.15.0-alpha.f145e023":"2018-11-21T00:57:34.157Z","0.15.0-alpha.02f4bbe2":"2018-11-21T03:02:57.709Z","0.15.0-alpha.47ebf08d":"2018-11-21T07:20:03.370Z","0.15.0-alpha.0795f9c9":"2018-11-21T08:01:19.464Z","0.15.0-alpha.b5a7dafe":"2018-11-21T08:01:36.086Z","0.15.0-alpha.2e4bc5c2":"2018-11-21T08:01:46.639Z","0.15.0-alpha.fbedd413":"2018-11-21T08:02:26.845Z","0.15.0-alpha.ac93f032":"2018-11-21T08:14:45.175Z","0.15.0-alpha.a2305377":"2018-11-21T08:15:47.362Z","0.15.0-alpha.26dfe4af":"2018-11-21T10:21:42.682Z","0.15.0-alpha.dcf688e5":"2018-11-21T10:24:04.502Z","0.15.0-alpha.7c1a7d2a":"2018-11-21T11:05:35.717Z","0.15.0-alpha.6e72038a":"2018-11-21T11:07:00.943Z","0.15.0-alpha.abcf5f6c":"2018-11-21T11:09:51.148Z","0.15.0-alpha.4fbf1e2d":"2018-11-21T12:51:02.738Z","0.15.0-alpha.4b8e24ce":"2018-11-21T13:00:54.712Z","0.15.0-alpha.0c41270f":"2018-11-21T14:37:15.883Z","0.15.0-alpha.e7948b1b":"2018-11-21T16:47:18.461Z","0.15.0-alpha.cdb1e423":"2018-11-22T05:38:26.438Z","0.15.0-alpha.1914405e":"2018-11-22T05:38:37.888Z","0.15.0-alpha.6344c178":"2018-11-22T05:39:00.604Z","0.15.0-alpha.9bcaa5f7":"2018-11-22T05:52:52.944Z","0.15.0-alpha.3407d212":"2018-11-22T06:28:58.718Z","0.15.0-alpha.dafadcd8":"2018-11-22T06:38:26.046Z","0.15.0-alpha.019c7ac4":"2018-11-22T06:41:33.053Z","0.15.0-alpha.74fd15ae":"2018-11-22T07:37:33.916Z","0.15.0-alpha.93e13fe6":"2018-11-22T07:43:49.899Z","0.15.0-alpha.653934c5":"2018-11-22T08:50:37.944Z","0.15.0-alpha.b5b4fbbf":"2018-11-22T12:25:54.845Z","0.15.0-alpha.4b63a542":"2018-11-22T12:30:37.855Z","0.15.0-alpha.d93a2950":"2018-11-22T13:09:24.814Z","0.15.0-alpha.9941f643":"2018-11-22T14:40:51.871Z","0.15.0-alpha.05a4d048":"2018-11-22T16:52:40.030Z","0.15.0-alpha.d353734e":"2018-11-23T00:09:35.194Z","0.15.0-alpha.c432cce7":"2018-11-23T01:25:05.542Z","0.15.0-alpha.43d3e5c4":"2018-11-23T04:17:04.586Z","0.15.0-alpha.5e223896":"2018-11-23T04:22:47.842Z","0.15.0-alpha.e976d492":"2018-11-23T09:35:59.156Z","0.15.0-alpha.c38885d5":"2018-11-23T12:10:48.771Z","0.15.0-alpha.4bf5a40a":"2018-11-23T14:18:37.614Z","0.15.0-alpha.d254850c":"2018-11-23T14:58:11.928Z","0.15.0-alpha.15cc618d":"2018-11-23T18:09:29.361Z","0.15.0-alpha.274b13b3":"2018-11-23T18:41:39.922Z","0.15.0-alpha.35d61f20":"2018-11-24T01:16:38.408Z","0.15.0-alpha.29d87ef4":"2018-11-24T01:22:10.665Z","0.15.0-alpha.63fb1244":"2018-11-24T01:22:50.094Z","0.15.0-alpha.63faa20b":"2018-11-24T01:23:29.726Z","0.15.0-alpha.0ec82c35":"2018-11-24T12:55:56.867Z","0.15.0-alpha.50bf6101":"2018-11-24T19:59:02.343Z","0.15.0-alpha.44b0d85d":"2018-11-24T23:59:30.601Z","0.14.2":"2018-11-25T00:26:07.804Z","0.15.0-alpha.132e20bd":"2018-11-25T00:29:45.702Z","0.15.0-alpha.2b8d2644":"2018-11-25T13:00:36.749Z","0.15.0-alpha.9d544cd8":"2018-11-25T13:04:45.992Z","0.15.0-alpha.a7ec32b1":"2018-11-25T13:07:57.482Z","0.15.0-alpha.1a4d378a":"2018-11-25T20:49:39.098Z","0.15.0-alpha.fd91dc6d":"2018-11-26T07:54:44.264Z","0.15.0-alpha.67cbcb66":"2018-11-26T10:19:17.807Z","0.15.0-alpha.3a3a42b9":"2018-11-26T10:26:07.539Z","0.15.0-alpha.53082053":"2018-11-26T10:35:27.944Z","0.15.0-alpha.2dd65362":"2018-11-26T10:38:46.642Z","0.14.3":"2018-11-26T10:55:07.448Z","0.15.0-alpha.ffa95f83":"2018-11-26T11:19:52.387Z","0.15.0-alpha.38024d43":"2018-11-26T15:49:48.378Z","0.15.0-alpha.7df98bdf":"2018-11-26T15:56:25.068Z","0.15.0-alpha.f8615088":"2018-11-26T16:42:52.935Z","0.15.0-alpha.c07f6dcf":"2018-11-26T19:52:49.142Z","0.15.0-alpha.cee9bb62":"2018-11-26T22:54:16.586Z","0.15.0-alpha.f9babcec":"2018-11-26T23:19:02.781Z","0.15.0-alpha.5953154b":"2018-11-26T23:22:16.754Z","0.15.0-alpha.e7195e3b":"2018-11-27T10:07:03.985Z","0.15.0-alpha.b3cf5d7f":"2018-11-27T10:11:03.334Z","0.15.0-alpha.1a9a3e30":"2018-11-27T10:11:37.504Z","0.15.0-alpha.a1d3b95d":"2018-11-27T10:14:26.470Z","0.15.0-alpha.33421742":"2018-11-27T10:31:39.715Z","0.15.0-alpha.4f707721":"2018-11-27T11:28:30.423Z","0.15.0-alpha.d5f28c26":"2018-11-27T11:56:42.874Z","0.15.0-alpha.6e1a59b4":"2018-11-27T19:53:23.919Z","0.15.0-alpha.db4be5fd":"2018-11-27T23:04:02.382Z","0.15.0-alpha.258fb11e":"2018-11-28T06:39:03.948Z","0.15.0-alpha.fe653a0b":"2018-11-28T06:49:40.102Z","0.15.0-alpha.28598e85":"2018-11-28T07:38:02.749Z","0.15.0-alpha.659ab7f7":"2018-11-28T07:45:53.093Z","0.15.0-alpha.8fdd8fd5":"2018-11-28T07:47:16.794Z","0.15.0-alpha.55ea76ad":"2018-11-28T07:56:02.099Z","0.15.0-alpha.a048a245":"2018-11-28T07:59:19.313Z","0.15.0-alpha.c36b07d2":"2018-11-28T08:00:29.387Z","0.15.0-alpha.7d892e9b":"2018-11-28T08:04:45.744Z","0.15.0-alpha.afd23551":"2018-11-28T09:23:42.868Z","0.15.0-alpha.2e9c1d26":"2018-11-28T09:48:12.342Z","0.14.4":"2018-11-28T09:59:02.120Z","0.15.0-alpha.1ee5b961":"2018-11-28T10:06:43.006Z","0.15.0-alpha.23873b80":"2018-11-28T17:26:32.078Z","0.15.0-alpha.0d3a052a":"2018-11-28T18:30:44.925Z","0.15.0-alpha.e6da3ea4":"2018-11-28T21:37:17.695Z","0.15.0-alpha.0838fc34":"2018-11-28T23:06:00.044Z","0.15.0-alpha.8ecaa8b9":"2018-11-29T06:06:48.666Z","0.15.0-alpha.ee76c57c":"2018-11-29T09:35:23.345Z","0.15.0-alpha.816f2e97":"2018-11-29T09:37:06.482Z","0.15.0-alpha.11532abb":"2018-11-29T09:37:26.432Z","0.15.0-alpha.5e8222d6":"2018-11-29T09:37:46.549Z","0.15.0-alpha.e3a34faa":"2018-11-29T09:38:57.635Z","0.15.0-alpha.4fe51f41":"2018-11-29T10:30:08.779Z","0.15.0-alpha.a5594a51":"2018-11-29T10:32:22.870Z","0.14.5":"2018-11-29T10:33:47.774Z","0.15.0-alpha.6b394570":"2018-11-29T14:42:50.359Z","0.15.0-alpha.c0baef7f":"2018-11-29T19:29:54.620Z","0.15.0-alpha.f4e8dc64":"2018-11-30T00:09:57.789Z","0.15.0-alpha.36fc202b":"2018-11-30T02:45:51.107Z","0.15.0-alpha.fcc857d2":"2018-11-30T17:06:40.861Z","0.15.0-alpha.23583d0d":"2018-12-01T10:47:58.545Z","0.15.0-alpha.7184174c":"2018-12-02T06:22:08.716Z","0.15.0-alpha.11d53f49":"2018-12-02T23:58:22.035Z","0.15.0-alpha.96a10d49":"2018-12-03T10:17:46.486Z","0.15.0-alpha.cca061d1":"2018-12-03T14:04:04.517Z","0.15.0-alpha.19ccda20":"2018-12-03T14:04:11.022Z","0.15.0-alpha.34f9279b":"2018-12-03T14:41:13.981Z","0.15.0-alpha.6cef8f3a":"2018-12-03T17:42:48.672Z","0.15.0-alpha.19902434":"2018-12-03T18:43:03.540Z","0.15.0-alpha.28d97edb":"2018-12-03T19:06:24.676Z","0.15.0-alpha.b2f1de3f":"2018-12-04T00:30:24.074Z","0.15.0-alpha.3bbd253f":"2018-12-04T00:30:52.313Z","0.15.0-alpha.e968858b":"2018-12-04T00:31:01.899Z","0.15.0-alpha.ab01fde3":"2018-12-04T00:31:22.562Z","0.15.0-alpha.de969db0":"2018-12-04T00:33:58.474Z","0.15.0-alpha.89da92fd":"2018-12-04T00:34:26.557Z","0.15.0-alpha.c23562b1":"2018-12-04T00:34:34.077Z","0.15.0-alpha.3b524afb":"2018-12-04T00:34:58.004Z","0.15.0-alpha.7f221d46":"2018-12-04T01:00:50.301Z","0.15.0-alpha.b4e869f7":"2018-12-04T01:01:12.013Z","0.15.0-alpha.36c9c109":"2018-12-04T02:08:14.850Z","0.15.0-alpha.8f9a0cd2":"2018-12-04T02:14:12.050Z","0.15.0-alpha.3c84ac73":"2018-12-04T02:17:05.537Z","0.15.0-alpha.07908bb3":"2018-12-04T02:40:25.306Z","0.15.0-alpha.fdaf304c":"2018-12-04T02:43:15.920Z","0.15.0-alpha.68c0cb52":"2018-12-04T03:27:35.473Z","0.15.0-alpha.e1bb71de":"2018-12-04T03:28:18.432Z","0.15.0-alpha.31bf912c":"2018-12-04T03:33:18.298Z","0.15.0-alpha.16be2f28":"2018-12-04T09:44:40.468Z","0.15.0-alpha.af9e44a1":"2018-12-04T09:55:59.784Z","0.15.0-alpha.17dc31e2":"2018-12-04T09:56:45.429Z","0.15.0-alpha.d8c2730f":"2018-12-04T10:43:59.368Z","0.15.0-alpha.d371d9bf":"2018-12-04T11:16:13.957Z","0.15.0-alpha.999185d3":"2018-12-04T11:33:03.608Z","0.15.0-alpha.18c25909":"2018-12-04T11:39:34.818Z","0.15.0-alpha.aabf7a5d":"2018-12-04T21:32:35.161Z","0.15.0-alpha.f15d01e7":"2018-12-05T00:45:04.306Z","0.15.0-alpha.2c9f532c":"2018-12-05T00:45:28.888Z","0.15.0-alpha.c686479a":"2018-12-05T00:47:06.948Z","0.15.0-alpha.62ff8d36":"2018-12-05T00:47:25.823Z","0.15.0-alpha.68ce78bd":"2018-12-05T00:49:30.634Z","0.15.0-alpha.4f004b37":"2018-12-05T00:52:58.763Z","0.15.0-alpha.1885b0cc":"2018-12-05T01:18:35.668Z","0.15.0-alpha.a60dd7f5":"2018-12-05T01:22:23.310Z","0.15.0-alpha.3e5bbc85":"2018-12-05T02:08:04.438Z","0.15.0-alpha.538df1f6":"2018-12-05T02:22:45.334Z","0.15.0-alpha.2fceaaa3":"2018-12-05T08:52:07.483Z","0.15.0-alpha.b9fd3b3b":"2018-12-05T09:12:39.178Z","0.15.0-alpha.9b5f3445":"2018-12-05T19:38:45.839Z","0.15.0-alpha.9c2e949e":"2018-12-05T21:34:37.584Z","0.15.0-alpha.6e78056b":"2018-12-05T23:14:35.457Z","0.15.0-alpha.fcc6ed88":"2018-12-05T23:14:44.919Z","0.15.0-alpha.074adfa0":"2018-12-05T23:55:23.119Z","0.15.0-alpha.c80e901d":"2018-12-06T01:06:56.180Z","0.15.0-alpha.28a7330f":"2018-12-06T01:27:05.115Z","0.15.0-alpha.510c0bf0":"2018-12-06T02:37:33.276Z","0.15.0-alpha.549543f7":"2018-12-06T07:56:30.876Z","0.15.0-alpha.74c74309":"2018-12-06T20:43:25.208Z","0.15.0-alpha.df7f6b80":"2018-12-07T00:03:21.681Z","0.15.0-alpha.02405b2f":"2018-12-07T00:04:17.912Z","0.15.0-alpha.07f81e62":"2018-12-07T00:21:20.039Z","0.15.0-alpha.347bf8c0":"2018-12-07T02:05:08.427Z","0.15.0-alpha.34708a2d":"2018-12-07T03:31:15.398Z","0.15.0-alpha.dd183237":"2018-12-07T07:27:44.657Z","0.15.0-alpha.e278549d":"2018-12-07T07:40:29.824Z","0.15.0-alpha.f4c97603":"2018-12-07T08:22:17.550Z","0.15.0-alpha.4454e11d":"2018-12-07T12:02:17.186Z","0.15.0-alpha.ba2f31c9":"2018-12-07T16:18:49.594Z","0.15.0-alpha.5870a18c":"2018-12-07T16:33:19.972Z","0.15.0-alpha.d7865d22":"2018-12-07T18:24:56.968Z","0.15.0-alpha.058ad67f":"2018-12-07T18:57:36.956Z","0.15.0-alpha.db3889ec":"2018-12-07T20:13:54.873Z","0.15.0-alpha.c36f3060":"2018-12-08T08:17:02.047Z","0.15.0-alpha.414627ba":"2018-12-08T08:17:14.599Z","0.15.0-alpha.36a4b837":"2018-12-08T08:17:23.618Z","0.15.0-alpha.e954e1a8":"2018-12-08T10:29:10.468Z","0.15.0-alpha.e01288e5":"2018-12-08T10:38:52.852Z","0.15.0-alpha.6cc7a3bb":"2018-12-08T10:59:42.670Z","0.15.0-alpha.fb0d10f8":"2018-12-09T09:42:34.786Z","0.15.0-alpha.f8c74d61":"2018-12-09T11:20:19.177Z","0.15.0-alpha.7285693e":"2018-12-09T13:57:29.923Z","0.15.0-alpha.980062ff":"2018-12-09T14:06:22.155Z","0.15.0-alpha.9cf18568":"2018-12-09T14:21:51.328Z","0.15.0-alpha.b02d66b6":"2018-12-09T20:26:34.172Z","0.15.0-alpha.70e0b7bf":"2018-12-10T06:49:56.145Z","0.15.0-alpha.beb7a0bd":"2018-12-10T07:09:57.830Z","0.15.0-alpha.79ded204":"2018-12-10T08:10:34.623Z","0.15.0-alpha.68f66d5d":"2018-12-10T08:10:49.170Z","0.15.0-alpha.19ababe1":"2018-12-10T12:02:30.945Z","0.15.0-alpha.6de1415e":"2018-12-10T12:34:28.096Z","0.15.0-alpha.0e78eec3":"2018-12-10T13:14:51.948Z","0.15.0-alpha.632ad817":"2018-12-10T13:15:13.523Z","0.15.0-alpha.3ade2436":"2018-12-10T13:15:34.195Z","0.15.0-alpha.c0cd7ed2":"2018-12-10T22:43:41.228Z","0.15.0-alpha.912ea469":"2018-12-11T02:43:11.090Z","0.15.0-alpha.64853393":"2018-12-11T03:24:42.501Z","0.15.0-alpha.449ad117":"2018-12-11T05:45:05.686Z","0.15.0-alpha.ce0251b5":"2018-12-11T05:45:15.737Z","0.15.0-alpha.111703cd":"2018-12-11T05:56:59.174Z","0.15.0-alpha.f93e3cb9":"2018-12-11T06:05:22.656Z","0.15.0-alpha.0af3a297":"2018-12-11T07:43:57.165Z","0.15.0-alpha.67d9af94":"2018-12-11T08:26:48.598Z","0.15.0-alpha.2ba9efea":"2018-12-11T08:52:18.900Z","0.15.0-alpha.99a01e25":"2018-12-11T08:56:40.465Z","0.15.0-alpha.e2748564":"2018-12-11T09:35:39.703Z","0.15.0-alpha.8882ec99":"2018-12-11T17:55:04.431Z","0.15.0-alpha.946b0cae":"2018-12-11T23:27:26.051Z","0.15.0-alpha.d63bbc07":"2018-12-11T23:51:35.160Z","0.15.0-alpha.1e95b59f":"2018-12-12T06:07:52.843Z","0.15.0-alpha.542bfba0":"2018-12-12T06:08:16.167Z","0.15.0-alpha.6d689c5d":"2018-12-12T06:09:31.959Z","0.15.0-alpha.e61939c2":"2018-12-12T07:58:25.627Z","0.15.0-alpha.4d42c0eb":"2018-12-12T10:28:34.043Z","0.15.0-alpha.20527e33":"2018-12-12T12:29:30.240Z","0.15.0-alpha.0520a5c7":"2018-12-12T15:28:57.347Z","0.15.0-alpha.9a433312":"2018-12-12T15:47:15.917Z","0.15.0-alpha.f580424d":"2018-12-12T15:52:12.753Z","0.15.0-alpha.517a0b14":"2018-12-12T16:20:17.991Z","0.15.0-alpha.d5fee644":"2018-12-12T16:33:26.771Z","0.15.0-alpha.55996ccd":"2018-12-12T17:20:12.792Z","0.15.0-alpha.30761ca4":"2018-12-12T17:52:55.339Z","0.15.0-alpha.2fd934f5":"2018-12-12T18:01:47.993Z","0.15.0-alpha.de2a5667":"2018-12-12T18:04:15.387Z","0.15.0-alpha.fceb970e":"2018-12-12T18:09:26.091Z","0.15.0-alpha.25a57412":"2018-12-12T19:31:41.165Z","0.15.0-alpha.8695bf70":"2018-12-12T19:56:25.431Z","0.15.0-alpha.38300000":"2018-12-12T20:04:55.362Z","0.15.0-alpha.bab23e56":"2018-12-12T20:57:31.475Z","0.15.0-alpha.dadac021":"2018-12-12T22:41:44.874Z","0.15.0-alpha.7b0ad9b3":"2018-12-12T23:23:33.289Z","0.15.0-alpha.b9dfdb46":"2018-12-12T23:35:35.654Z","0.15.0-alpha.b8753102":"2018-12-13T03:45:18.585Z","0.15.0-alpha.8db63141":"2018-12-13T06:30:38.975Z","0.15.0-alpha.53ed69de":"2018-12-13T06:31:08.100Z","0.15.0-alpha.b5ccbcd5":"2018-12-13T06:31:26.309Z","0.15.0-alpha.d91216e0":"2018-12-13T06:31:40.905Z","0.15.0-alpha.5302710a":"2018-12-13T06:35:13.111Z","0.15.0-alpha.dcb3b086":"2018-12-13T06:48:51.101Z","0.15.0-alpha.2623884f":"2018-12-13T07:30:00.382Z","0.15.0-alpha.f6659475":"2018-12-13T07:30:22.136Z","0.15.0-alpha.ffebf0b7":"2018-12-13T07:47:01.316Z","0.15.0-alpha.b6e2ab26":"2018-12-13T07:51:35.782Z","0.15.0-alpha.72cb4967":"2018-12-13T07:52:04.898Z","0.15.0-alpha.2055b637":"2018-12-13T07:52:23.342Z","0.15.0-alpha.d71330f1":"2018-12-13T07:55:52.817Z","0.15.0-alpha.ae2fdd89":"2018-12-13T08:10:49.873Z","0.15.0":"2018-12-13T08:14:45.721Z","0.15.0-alpha.c82ed938":"2018-12-13T08:15:52.746Z","0.16.0-alpha.9ec75633":"2018-12-13T08:35:22.641Z","0.16.0-alpha.59617a10":"2018-12-13T10:25:47.079Z","0.16.0-alpha.40d12f2f":"2018-12-13T10:30:25.176Z","0.16.0-alpha.4b7574b0":"2018-12-13T10:38:04.397Z","0.16.0-alpha.af0870a1":"2018-12-13T10:42:18.320Z","0.16.0-alpha.6c5b17d7":"2018-12-13T10:43:17.392Z","0.16.0-alpha.d577a1d9":"2018-12-13T11:18:20.441Z","0.16.0-alpha.99aec14b":"2018-12-13T11:18:29.815Z","0.16.0-alpha.5402419e":"2018-12-13T11:25:58.096Z","0.16.0-alpha.91191375":"2018-12-13T11:31:45.302Z","0.16.0-alpha.15824665":"2018-12-13T12:44:23.226Z","0.16.0-alpha.776309d5":"2018-12-13T13:03:42.418Z","0.16.0-alpha.207cae5d":"2018-12-13T14:03:26.013Z","0.16.0-alpha.e7a1fe7e":"2018-12-13T15:15:14.604Z","0.16.0-alpha.12a886d5":"2018-12-13T15:34:42.369Z","0.16.0-alpha.d7173d74":"2018-12-13T16:05:03.505Z","0.16.0-alpha.3e591cf4":"2018-12-13T19:45:35.356Z","0.16.0-alpha.5454866b":"2018-12-13T19:45:44.299Z","0.16.0-alpha.944adc8b":"2018-12-13T22:48:11.983Z","0.16.0-alpha.e74560c0":"2018-12-13T22:49:02.037Z","0.16.0-alpha.f90b9fc8":"2018-12-14T07:26:35.670Z","0.16.0-alpha.9afc4c93":"2018-12-14T08:25:45.988Z","0.16.0-alpha.31e7bef6":"2018-12-14T08:25:57.148Z","0.16.0-alpha.68d60628":"2018-12-14T08:26:11.890Z","0.16.0-alpha.419a3469":"2018-12-14T08:26:41.346Z","0.16.0-alpha.b6d91d1e":"2018-12-14T08:30:08.697Z","0.16.0-alpha.19141979":"2018-12-14T08:30:44.829Z","0.16.0-alpha.547b4f44":"2018-12-14T08:30:52.676Z","0.16.0-alpha.9a830c8d":"2018-12-14T09:00:39.480Z","0.16.0-alpha.a3c4ba15":"2018-12-15T10:58:11.961Z","0.16.0-alpha.36922869":"2018-12-15T11:11:43.311Z","0.16.0-alpha.c123516c":"2018-12-15T11:12:04.328Z","0.16.0-alpha.8a62c766":"2018-12-15T11:12:14.932Z","0.16.0-alpha.8f018002":"2018-12-15T11:20:10.561Z","0.16.0-alpha.d5369d38":"2018-12-15T11:20:21.145Z","0.16.0-alpha.6445d9ea":"2018-12-15T11:20:33.123Z","0.16.0-alpha.de9e59b8":"2018-12-16T06:16:06.974Z","0.16.0-alpha.25725964":"2018-12-16T06:42:36.415Z","0.16.0-alpha.7ca01db7":"2018-12-17T18:25:34.738Z","0.16.0-alpha.39949785":"2018-12-17T19:07:22.057Z","0.16.0-alpha.1a27151c":"2018-12-17T21:00:19.321Z","0.16.0-alpha.1080302b":"2018-12-17T23:43:37.354Z","0.16.0-alpha.0e47a44e":"2018-12-17T23:43:50.196Z","0.16.0-alpha.13948bb2":"2018-12-18T01:02:31.450Z","0.16.0-alpha.913ceb32":"2018-12-18T11:35:54.800Z","0.16.0-alpha.a0347a65":"2018-12-18T11:47:31.832Z","0.16.0-alpha.10764d50":"2018-12-18T12:55:43.952Z","0.16.0-alpha.4da7f92d":"2018-12-18T12:55:58.431Z","0.16.0-alpha.78089b13":"2018-12-18T12:56:18.118Z","0.16.0-alpha.0af064c0":"2018-12-18T12:56:38.399Z","0.16.0-alpha.eb62e94d":"2018-12-18T13:05:04.155Z","0.15.1":"2018-12-18T13:22:47.431Z","0.16.0-alpha.574fafef":"2018-12-18T13:27:42.772Z","0.16.0-alpha.551eb3fa":"2018-12-18T15:50:07.708Z","0.16.0-alpha.0b3d142d":"2018-12-18T19:58:54.860Z","0.16.0-alpha.67231f96":"2018-12-18T20:03:58.971Z","0.16.0-alpha.5882a539":"2018-12-18T20:05:28.509Z","0.16.0-alpha.6c2b99b1":"2018-12-18T21:22:30.734Z","0.16.0-alpha.8552f134":"2018-12-18T22:06:01.602Z","0.16.0-alpha.538c1810":"2018-12-18T22:11:32.649Z","0.16.0-alpha.51b2ca2f":"2018-12-18T23:36:32.898Z","0.16.0-alpha.ab0f22e9":"2018-12-19T05:45:49.306Z","0.16.0-alpha.ad07eaff":"2018-12-19T06:03:59.689Z","0.16.0-alpha.ced38a7e":"2018-12-19T07:05:41.592Z","0.16.0-alpha.0248eb23":"2018-12-19T07:38:40.840Z","0.16.0-alpha.5a024c86":"2018-12-19T08:57:51.483Z","0.16.0-alpha.56609532":"2018-12-19T12:27:21.385Z","0.16.0-alpha.a1adfe87":"2018-12-19T13:40:18.627Z","0.16.0-alpha.7dab801c":"2018-12-19T13:43:37.722Z","0.16.0-alpha.42ec6d29":"2018-12-19T13:44:01.471Z","0.16.0-alpha.58d710bf":"2018-12-19T16:42:38.347Z","0.16.0-alpha.0247cb0b":"2018-12-19T16:47:33.410Z","0.16.0-alpha.dc98792f":"2018-12-19T17:56:48.473Z","0.16.0-alpha.4f7a8177":"2018-12-19T18:13:04.216Z","0.16.0-alpha.93db0dac":"2018-12-19T18:35:31.746Z","0.16.0-alpha.4d3c651e":"2018-12-19T18:35:56.939Z","0.16.0-alpha.306a708f":"2018-12-19T22:52:02.405Z","0.16.0-alpha.a686cba5":"2018-12-20T01:33:12.689Z","0.16.0-alpha.16ae7efd":"2018-12-20T10:18:14.092Z","0.16.0-alpha.3bdc2a76":"2018-12-20T10:21:58.812Z","0.16.0-alpha.4d8073d6":"2018-12-20T10:22:47.047Z","0.16.0-alpha.b4c9d539":"2018-12-20T10:23:02.887Z","0.16.0-alpha.7f38c083":"2018-12-20T10:24:06.329Z","0.16.0-alpha.887fbc62":"2018-12-20T10:26:46.235Z","0.16.0-alpha.b80834b3":"2018-12-20T11:09:55.504Z","0.16.0-alpha.a9b535f1":"2018-12-20T11:10:04.880Z","0.16.0-alpha.eaccc849":"2018-12-20T11:10:43.676Z","0.16.0-alpha.fe0675f8":"2018-12-20T16:31:35.431Z","0.16.0-alpha.fd0ca14d":"2018-12-20T17:31:09.493Z","0.16.0-alpha.fda5b03d":"2018-12-20T23:22:10.781Z","0.16.0-alpha.bcb0fdd2":"2018-12-21T08:36:01.842Z","0.16.0-alpha.b6a44549":"2018-12-21T08:36:22.854Z","0.16.0-alpha.e907daff":"2018-12-21T08:38:15.674Z","0.16.0-alpha.013da346":"2018-12-21T09:13:34.793Z","0.16.0-alpha.0d94e864":"2018-12-21T10:50:35.649Z","0.16.0-alpha.bfc1bdd7":"2018-12-21T23:13:43.795Z","0.16.0-alpha.2a98b4f7":"2018-12-22T13:01:04.497Z","0.16.0-alpha.7a411e29":"2018-12-22T15:36:45.508Z","0.16.0-alpha.0e612a58":"2018-12-24T06:56:26.907Z","0.16.0-alpha.3e8007ff":"2018-12-24T06:56:36.742Z","0.16.0-alpha.40671fa1":"2018-12-24T06:56:53.272Z","0.16.0-alpha.2c468918":"2018-12-24T06:57:09.887Z","0.16.0-alpha.545a6622":"2018-12-24T07:01:04.938Z","0.16.0-alpha.27d2b878":"2018-12-24T11:24:29.293Z","0.16.0-alpha.2c8976da":"2018-12-24T11:44:03.179Z","0.16.0-alpha.e65d7574":"2018-12-24T12:00:50.337Z","0.16.0-alpha.6beb3759":"2018-12-24T12:04:48.741Z","0.16.0-alpha.ee61329d":"2018-12-24T12:24:51.390Z","0.16.0-alpha.22d89977":"2018-12-24T12:49:46.888Z","0.16.0-alpha.a9b4b106":"2018-12-24T13:01:30.422Z","0.15.2":"2018-12-24T13:15:36.602Z","0.16.0-alpha.7154c52e":"2018-12-24T13:19:49.173Z","0.16.0-alpha.55fec510":"2018-12-27T16:26:39.698Z","0.16.0-alpha.5cbd12db":"2018-12-27T17:44:14.226Z","0.16.0-alpha.c1e3d33b":"2018-12-27T18:59:00.780Z","0.16.0-alpha.24833839":"2018-12-28T00:44:41.723Z","0.16.0-alpha.f90124b7":"2018-12-28T06:29:51.815Z","0.16.0-alpha.bf94fe7b":"2018-12-28T10:48:14.470Z","0.16.0-alpha.e9233982":"2018-12-28T10:48:28.648Z","0.16.0-alpha.a9c142a4":"2018-12-29T12:04:07.509Z","0.16.0-alpha.ccb46744":"2018-12-29T12:34:44.509Z","0.16.0-alpha.4cd584c2":"2018-12-30T21:28:13.878Z","0.16.0-alpha.f16d645c":"2018-12-30T21:33:56.425Z","0.16.0-alpha.a985b3ce":"2018-12-31T07:23:43.711Z","0.16.0-alpha.f1fe2fae":"2018-12-31T07:23:54.897Z","0.16.0-alpha.379d37bc":"2018-12-31T12:01:55.601Z","0.16.0-alpha.6e6d1845":"2018-12-31T16:36:11.946Z","0.16.0-alpha.be0bf3bd":"2018-12-31T16:36:33.812Z","0.16.0-alpha.3553ef16":"2018-12-31T19:55:23.702Z","0.16.0-alpha.606bc452":"2018-12-31T19:55:36.174Z","0.16.0-alpha.875e3d43":"2019-01-02T19:39:11.162Z","0.16.0-alpha.296cfaa9":"2019-01-03T06:41:19.913Z","0.16.0-alpha.97b0091a":"2019-01-03T06:47:26.960Z","0.16.0-alpha.b38eb5c8":"2019-01-03T06:50:01.511Z","0.16.0-alpha.0c80b907":"2019-01-03T06:50:37.498Z","0.16.0-alpha.c6019189":"2019-01-04T00:53:15.942Z","0.16.0-alpha.8acb2055":"2019-01-04T23:27:22.989Z","0.16.0-alpha.f7960fde":"2019-01-05T09:28:50.663Z","0.16.0-alpha.6b33a55b":"2019-01-05T15:50:43.745Z","0.16.0-alpha.25afe319":"2019-01-06T07:21:20.809Z","0.16.0-alpha.69dc7348":"2019-01-06T07:21:33.939Z","0.16.0-alpha.e41dadad":"2019-01-06T07:22:17.115Z","0.16.0-alpha.1d2b0438":"2019-01-06T07:25:30.056Z","0.16.0-alpha.ea6775eb":"2019-01-06T07:25:42.950Z","0.16.0-alpha.8c6d6f71":"2019-01-06T07:26:28.490Z","0.16.0-alpha.1223c015":"2019-01-06T07:31:08.423Z","0.16.0-alpha.da0016b8":"2019-01-06T16:49:44.669Z","0.16.0-alpha.c57df6bd":"2019-01-06T16:50:20.888Z","0.16.0-alpha.77ec33c1":"2019-01-06T16:50:32.461Z","0.16.0-alpha.66320bb3":"2019-01-06T17:45:55.280Z","0.16.0-alpha.c4758f32":"2019-01-06T17:46:07.453Z","0.16.0-alpha.4c0f85e5":"2019-01-06T19:30:52.830Z","0.16.0-alpha.502e9d1d":"2019-01-07T00:18:58.417Z","0.16.0-alpha.ed2a5f63":"2019-01-07T07:28:37.884Z","0.16.0-alpha.791e236e":"2019-01-07T08:43:21.560Z","0.16.0-alpha.9c21de95":"2019-01-07T18:56:41.002Z","0.16.0-alpha.987b244c":"2019-01-07T18:57:01.143Z","0.16.0-alpha.68552079":"2019-01-09T22:02:41.241Z","0.16.0-alpha.af10243e":"2019-01-09T22:52:05.833Z","0.16.0-alpha.a099c8b2":"2019-01-10T14:01:43.057Z","0.16.0-alpha.888a4e39":"2019-01-10T14:01:59.776Z","0.16.0-alpha.2117d0f3":"2019-01-10T14:02:39.374Z","0.16.0-alpha.0b88eddc":"2019-01-10T14:02:52.937Z","0.16.0-alpha.f7cd35bc":"2019-01-10T14:06:09.431Z","0.16.0-alpha.714b48b4":"2019-01-10T14:07:20.450Z","0.16.0-alpha.83bca28f":"2019-01-10T14:07:28.198Z","0.16.0-alpha.23aa2d8b":"2019-01-10T14:07:43.673Z","0.16.0-alpha.c842a8bc":"2019-01-10T14:10:51.473Z","0.16.0-alpha.f9296680":"2019-01-10T14:12:24.009Z","0.16.0-alpha.69118a7c":"2019-01-10T14:12:37.318Z","0.16.0-alpha.dd7ec313":"2019-01-10T16:35:06.613Z","0.16.0-alpha.dcfbe606":"2019-01-10T18:47:53.426Z","0.16.0-alpha.008d0d70":"2019-01-10T20:07:55.728Z","0.16.0-alpha.1cc46ae2":"2019-01-10T22:04:34.944Z","0.16.0-alpha.c750a4aa":"2019-01-10T22:44:39.524Z","0.16.0-alpha.18a96883":"2019-01-10T22:54:07.566Z","0.16.0-alpha.f200c85c":"2019-01-10T23:39:45.106Z","0.16.0-alpha.1e1d005c":"2019-01-11T08:19:33.288Z","0.16.0-alpha.897004d7":"2019-01-11T08:19:53.567Z","0.16.0-alpha.80cd9b41":"2019-01-11T08:20:07.446Z","0.16.0-alpha.2c981797":"2019-01-11T08:20:23.104Z","0.16.0-alpha.7c8c8456":"2019-01-11T08:24:25.105Z","0.16.0-alpha.236603c0":"2019-01-11T08:24:41.027Z","0.16.0-alpha.fb3b0202":"2019-01-11T08:29:08.708Z","0.16.0-alpha.c41191db":"2019-01-11T19:37:01.192Z","0.16.0-alpha.89c7ce9c":"2019-01-12T06:22:47.734Z","0.16.0-alpha.d489e262":"2019-01-13T06:47:25.398Z","0.16.0-alpha.de29ad71":"2019-01-13T06:47:39.364Z","0.16.0-alpha.64d88de9":"2019-01-13T06:49:27.359Z","0.16.0-alpha.fa5adb16":"2019-01-13T06:49:57.522Z","0.16.0-alpha.120c754b":"2019-01-14T04:17:23.837Z","0.16.0-alpha.bae9f87e":"2019-01-14T16:21:38.724Z","0.16.0-alpha.fede21cb":"2019-01-14T16:22:13.398Z","0.16.0-alpha.166a8cb4":"2019-01-14T22:05:37.388Z","0.16.0-alpha.9ad25519":"2019-01-15T00:00:54.396Z","0.16.0-alpha.166332ed":"2019-01-15T06:34:25.978Z","0.16.0-alpha.0f53777b":"2019-01-15T06:34:35.535Z","0.16.0-alpha.b599ac6f":"2019-01-15T06:34:49.892Z","0.16.0-alpha.328619d2":"2019-01-15T06:35:04.921Z","0.16.0-alpha.ef7279b3":"2019-01-15T06:39:01.375Z","0.16.0-alpha.800a4f84":"2019-01-15T10:43:49.722Z","0.16.0-alpha.335c3162":"2019-01-15T10:49:17.638Z","0.16.0-alpha.4a0017d7":"2019-01-15T10:55:42.085Z","0.16.0-alpha.877ab07f":"2019-01-15T11:02:33.019Z","0.16.0-alpha.1ae79418":"2019-01-15T11:11:52.896Z","0.16.0-alpha.ab0aa902":"2019-01-15T16:49:33.832Z","0.16.0-alpha.88766a35":"2019-01-15T22:54:56.564Z","0.16.0-alpha.6e31bac9":"2019-01-15T23:45:48.550Z","0.16.0-alpha.426d2e96":"2019-01-16T08:27:05.702Z","0.16.0-alpha.9868fdff":"2019-01-16T08:28:04.806Z","0.16.0-alpha.c8f3ac85":"2019-01-16T10:05:03.980Z","0.16.0-alpha.2ee3819e":"2019-01-16T12:33:14.120Z","0.16.0-alpha.d9f6efcf":"2019-01-16T19:16:39.809Z","0.16.0-alpha.cedd99da":"2019-01-16T19:32:04.491Z","0.16.0-alpha.7873cec4":"2019-01-17T07:40:01.629Z","0.16.0-alpha.0957da87":"2019-01-17T07:40:20.366Z","0.16.0-alpha.86f1aeca":"2019-01-17T11:32:41.829Z","0.16.0-alpha.475cffc4":"2019-01-17T12:01:19.402Z","0.16.0-alpha.d2db8520":"2019-01-17T12:20:37.982Z","0.16.0-alpha.5f5eec01":"2019-01-17T12:28:46.881Z","0.16.0-alpha.b9914b46":"2019-01-17T12:33:00.983Z","0.16.0-alpha.0a3de09e":"2019-01-17T13:02:52.894Z","0.16.0-alpha.c2b26dd2":"2019-01-17T13:56:54.914Z","0.16.0-alpha.21609e70":"2019-01-17T16:48:47.987Z","0.16.0-alpha.206cb192":"2019-01-17T17:01:27.248Z","0.16.0-alpha.11129b6d":"2019-01-17T17:19:20.388Z","0.16.0-alpha.edb72ad6":"2019-01-17T17:30:04.095Z","0.16.0-alpha.ddc6ebb2":"2019-01-17T17:41:21.199Z","0.16.0-alpha.27eec8c7":"2019-01-17T18:42:46.270Z","0.16.0-alpha.73e39b2a":"2019-01-17T20:29:01.800Z","0.16.0-alpha.b50b458b":"2019-01-17T22:50:01.553Z","0.16.0-alpha.7525bc98":"2019-01-17T23:55:09.099Z","0.16.0-alpha.d2c922b5":"2019-01-18T17:35:59.009Z","0.16.0-alpha.ab1abd79":"2019-01-18T19:11:07.078Z","0.16.0-alpha.11eb5fd4":"2019-01-18T22:03:20.480Z","0.16.0-alpha.6e5b3828":"2019-01-18T22:03:34.573Z","0.16.0-alpha.43757203":"2019-01-18T22:34:05.860Z","0.16.0-alpha.31593ed2":"2019-01-18T23:00:59.934Z","0.16.0-alpha.e58dd422":"2019-01-19T00:10:31.429Z","0.16.0-alpha.65ec50a3":"2019-01-19T09:04:03.845Z","0.16.0-alpha.3f632c8c":"2019-01-19T09:04:24.483Z","0.16.0-alpha.c003293c":"2019-01-19T09:04:36.624Z","0.16.0-alpha.a5cb0ca4":"2019-01-19T09:05:11.147Z","0.16.0-alpha.51c35a5d":"2019-01-19T09:08:20.719Z","0.16.0-alpha.214ee5ee":"2019-01-19T09:09:12.002Z","0.16.0-alpha.87b081cb":"2019-01-19T09:09:21.108Z","0.16.0-alpha.54d55834":"2019-01-19T09:10:23.021Z","0.16.0-alpha.8905ed98":"2019-01-19T09:13:08.917Z","0.16.0-alpha.fc6e276e":"2019-01-20T08:15:22.238Z","0.16.0-alpha.9ae6a372":"2019-01-20T08:16:10.378Z","0.16.0-alpha.3e03cb27":"2019-01-20T08:16:23.387Z","0.16.0-alpha.8299d01a":"2019-01-20T08:38:49.586Z","0.16.0-alpha.6441cc2b":"2019-01-20T08:39:39.143Z","0.16.0-alpha.893d6be4":"2019-01-20T08:55:30.927Z","0.16.0-alpha.f045ab52":"2019-01-20T09:53:50.868Z","0.16.0":"2019-01-20T10:13:20.435Z","0.17.0-alpha.325baef0":"2019-01-20T10:17:47.666Z","0.17.0-alpha.c9b91b10":"2019-01-20T10:18:02.351Z","0.17.0-alpha.a290eda2":"2019-01-20T10:18:15.791Z","0.17.0-alpha.2fdb8985":"2019-01-20T10:19:07.079Z","0.17.0-alpha.03a8db14":"2019-01-20T10:22:18.365Z","0.17.0-alpha.ad45c54c":"2019-01-20T11:17:22.613Z","0.17.0-alpha.546c781e":"2019-01-20T11:17:35.283Z","0.17.0-alpha.498958e7":"2019-01-20T11:23:20.245Z","0.17.0-alpha.e0c1b279":"2019-01-20T17:52:46.442Z","0.17.0-alpha.aa7b2b06":"2019-01-20T19:09:54.522Z","0.17.0-alpha.89d7da37":"2019-01-20T19:10:26.911Z","0.17.0-alpha.20739eb4":"2019-01-21T06:59:34.979Z","0.17.0-alpha.f686ddcc":"2019-01-21T06:59:51.442Z","0.17.0-alpha.a93a7cf9":"2019-01-21T07:04:38.052Z","0.17.0-alpha.1d6e8107":"2019-01-21T07:31:47.417Z","0.17.0-alpha.ba17b639":"2019-01-21T07:32:14.188Z","0.17.0-alpha.df1e375e":"2019-01-21T16:07:06.529Z","0.17.0-alpha.4c59e508":"2019-01-21T16:25:56.267Z","0.17.0-alpha.e01c48d1":"2019-01-21T19:55:43.934Z","0.17.0-alpha.be46d9eb":"2019-01-21T21:24:56.601Z","0.17.0-alpha.ca5f1e26":"2019-01-21T23:14:37.989Z","0.17.0-alpha.389a4e5e":"2019-01-22T06:35:51.598Z","0.17.0-alpha.f9396574":"2019-01-22T06:36:06.001Z","0.17.0-alpha.274b789c":"2019-01-22T06:36:20.317Z","0.17.0-alpha.a77a7e9d":"2019-01-22T06:37:14.055Z","0.17.0-alpha.c704bbdd":"2019-01-22T14:09:17.056Z","0.17.0-alpha.a6bd36d0":"2019-01-22T14:21:26.543Z","0.17.0-alpha.bb76bd65":"2019-01-23T10:17:25.890Z","0.17.0-alpha.4f5607ee":"2019-01-23T11:19:33.812Z","0.17.0-alpha.ef6ceb6a":"2019-01-23T23:26:07.589Z","0.17.0-alpha.4edfff92":"2019-01-24T07:56:55.336Z","0.17.0-alpha.d11ea487":"2019-01-24T07:59:49.453Z","0.17.0-alpha.67af7796":"2019-01-24T15:26:15.577Z","0.17.0-alpha.9ae86168":"2019-01-24T15:26:39.611Z","0.17.0-alpha.73c81fab":"2019-01-24T23:29:10.992Z","0.17.0-alpha.8cd55fff":"2019-01-25T22:45:19.904Z","0.17.0-alpha.9f2a98cb":"2019-01-26T14:06:09.734Z","0.17.0-alpha.c7268cf7":"2019-01-26T19:54:58.892Z","0.17.0-alpha.7f30b882":"2019-01-26T22:22:55.794Z","0.17.0-alpha.58610d15":"2019-01-28T06:42:46.333Z","0.17.0-alpha.9d589b94":"2019-01-28T06:42:58.951Z","0.17.0-alpha.b52a7909":"2019-01-28T06:43:07.778Z","0.17.0-alpha.7b635c1e":"2019-01-28T06:43:20.657Z","0.17.0-alpha.1d0aa274":"2019-01-28T06:47:35.644Z","0.17.0-alpha.6f188ad1":"2019-01-28T13:59:36.373Z","0.17.0-alpha.457ad1c8":"2019-01-28T16:19:00.796Z","0.17.0-alpha.fe7fd51a":"2019-01-29T00:50:32.183Z","0.17.0-alpha.0c94f218":"2019-01-29T06:28:31.388Z","0.17.0-alpha.61f01d98":"2019-01-29T08:19:24.240Z","0.17.0-alpha.2154faeb":"2019-01-29T08:19:54.537Z","0.17.0-alpha.44e983a6":"2019-01-29T19:14:32.333Z","0.17.0-alpha.b7ac91bb":"2019-01-30T08:45:35.324Z","0.17.0-alpha.eb9d6ff3":"2019-01-30T10:53:00.538Z","0.17.0-alpha.16cdd6ee":"2019-01-30T10:58:45.194Z","0.17.0-alpha.1f181a9c":"2019-01-30T10:59:31.564Z","0.17.0-alpha.ee165a5a":"2019-01-30T10:59:40.635Z","0.17.0-alpha.709ee7ed":"2019-01-30T13:29:01.750Z","0.17.0-alpha.b71e2725":"2019-01-30T13:29:19.754Z","0.17.0-alpha.4317ee16":"2019-01-30T15:59:47.214Z","0.17.0-alpha.fad8d485":"2019-01-30T19:29:56.813Z","0.17.0-alpha.805da056":"2019-01-30T23:38:05.041Z","0.17.0-alpha.d1d114fe":"2019-01-31T00:34:00.491Z","0.17.0-alpha.30946230":"2019-01-31T04:47:50.371Z","0.17.0-alpha.ed37be75":"2019-01-31T07:41:46.896Z","0.17.0-alpha.24448bfc":"2019-01-31T07:41:58.109Z","0.17.0-alpha.a51f5553":"2019-01-31T07:42:15.353Z","0.17.0-alpha.e0e357ed":"2019-01-31T10:33:43.656Z","0.17.0-alpha.c06f4e27":"2019-01-31T19:53:17.197Z","0.17.0-alpha.cc04e36e":"2019-01-31T19:53:38.917Z","0.17.0-alpha.9267e6d4":"2019-01-31T20:11:44.486Z","0.17.0-alpha.d9c6b03d":"2019-01-31T20:35:40.100Z","0.17.0-alpha.67da0b35":"2019-02-01T05:41:20.476Z","0.17.0-alpha.ccad7a11":"2019-02-01T19:50:24.515Z","0.17.0-alpha.960bbab0":"2019-02-01T19:53:05.767Z","0.17.0-alpha.87bd896d":"2019-02-01T20:44:38.495Z","0.17.0-alpha.bade86e8":"2019-02-02T09:04:51.353Z","0.17.0-alpha.019c17e6":"2019-02-02T18:31:00.828Z","0.17.0-alpha.97ddaae5":"2019-02-03T06:12:33.483Z","0.17.0-alpha.06e46cf4":"2019-02-03T06:12:49.141Z","0.17.0-alpha.353b916d":"2019-02-03T06:13:00.218Z","0.17.0-alpha.b1d40543":"2019-02-03T06:13:10.817Z","0.17.0-alpha.7e68e4fe":"2019-02-03T06:16:45.623Z","0.17.0-alpha.39bfcdc3":"2019-02-03T06:17:24.019Z","0.17.0-alpha.6f8b0fbb":"2019-02-03T06:17:38.151Z","0.17.0-alpha.32cea6b2":"2019-02-03T06:20:32.449Z","0.17.0-alpha.e89bb71e":"2019-02-03T06:21:10.678Z","0.17.0-alpha.38d1a021":"2019-02-03T06:55:03.399Z","0.17.0-alpha.15f2e004":"2019-02-03T06:56:25.325Z","0.17.0-alpha.519cb25c":"2019-02-03T07:11:51.731Z","0.17.0-alpha.7e3da843":"2019-02-03T08:13:33.779Z","0.17.0-alpha.1dfecade":"2019-02-03T08:34:47.433Z","0.17.0-alpha.d32099f1":"2019-02-03T08:37:46.953Z","0.17.0-alpha.2b6610b9":"2019-02-03T08:38:40.202Z","0.17.0-alpha.6cf5bfb2":"2019-02-03T09:21:22.268Z","0.16.1":"2019-02-03T09:23:53.997Z","0.17.0-alpha.530adc56":"2019-02-03T09:25:47.079Z","0.17.0-alpha.206bca2b":"2019-02-03T09:28:01.074Z","0.17.0-alpha.8e787c93":"2019-02-03T09:29:34.170Z","0.17.0-alpha.73c1b445":"2019-02-03T10:27:49.236Z","0.17.0-alpha.eeebef59":"2019-02-03T10:28:06.088Z","0.17.0-alpha.131278bf":"2019-02-03T10:41:44.808Z","0.17.0-alpha.fe3fb331":"2019-02-03T10:44:42.798Z","0.17.0-alpha.1375489a":"2019-02-03T11:03:08.737Z","0.17.0-alpha.b9f7c7c3":"2019-02-03T11:49:00.071Z","0.17.0-alpha.2b22525a":"2019-02-03T12:36:46.194Z","0.17.0-alpha.21ea9ea8":"2019-02-03T20:37:08.288Z","0.17.0-alpha.d6e4c2b6":"2019-02-04T06:21:30.320Z","0.17.0-alpha.44540a2a":"2019-02-04T06:23:40.622Z","0.17.0-alpha.a9e19710":"2019-02-04T09:06:36.247Z","0.17.0-alpha.5645f490":"2019-02-04T17:26:10.034Z","0.17.0-alpha.a46dcede":"2019-02-04T22:55:02.316Z","0.17.0-alpha.5c019cfa":"2019-02-05T00:43:53.125Z","0.17.0-alpha.8b057617":"2019-02-05T01:29:07.524Z","0.17.0-alpha.a3e75975":"2019-02-05T01:29:50.555Z","0.17.0-alpha.a9800160":"2019-02-05T02:28:22.222Z","0.17.0-alpha.c9253930":"2019-02-05T02:29:01.941Z","0.17.0-alpha.9b7ca0a5":"2019-02-05T03:22:35.394Z","0.17.0-alpha.353677b5":"2019-02-05T06:23:30.187Z","0.17.0-alpha.1253541a":"2019-02-05T06:23:43.418Z","0.17.0-alpha.6a887ee3":"2019-02-05T06:24:04.394Z","0.17.0-alpha.1c63a8e0":"2019-02-05T06:24:17.522Z","0.17.0-alpha.a3372043":"2019-02-05T06:27:53.506Z","0.17.0-alpha.c6709710":"2019-02-05T06:28:08.730Z","0.17.0-alpha.fb993fd5":"2019-02-05T06:28:30.285Z","0.17.0-alpha.0854f325":"2019-02-05T06:33:47.089Z","0.17.0-alpha.daf47417":"2019-02-05T06:33:59.676Z","0.17.0-alpha.7b39834b":"2019-02-05T19:31:30.167Z","0.17.0-alpha.6d3f6b1d":"2019-02-05T22:08:48.031Z","0.17.0-alpha.d9949d36":"2019-02-05T22:38:57.803Z","0.17.0-alpha.f484a06b":"2019-02-06T07:33:25.176Z","0.17.0-alpha.0b4d3e73":"2019-02-06T07:33:36.997Z","0.17.0-alpha.0cf34bc1":"2019-02-06T07:33:49.250Z","0.17.0-alpha.4fc28fed":"2019-02-06T08:26:11.264Z","0.17.0-alpha.40979ba2":"2019-02-06T08:33:28.582Z","0.17.0-alpha.b9ef304a":"2019-02-06T14:46:20.779Z","0.17.0-alpha.3cee3744":"2019-02-06T18:39:20.012Z","0.17.0-alpha.52b04139":"2019-02-06T23:34:54.044Z","0.17.0-alpha.70087e70":"2019-02-07T08:44:44.898Z","0.17.0-alpha.fb0b04f9":"2019-02-07T09:30:24.280Z","0.17.0-alpha.0ace5ac7":"2019-02-07T09:30:34.397Z","0.17.0-alpha.5e884b34":"2019-02-07T09:31:06.400Z","0.17.0-alpha.5a046708":"2019-02-07T09:31:43.985Z","0.17.0-alpha.1627d5fe":"2019-02-07T09:35:19.207Z","0.17.0-alpha.392ed723":"2019-02-07T09:38:29.818Z","0.17.0-alpha.58e6d844":"2019-02-07T19:42:45.236Z","0.17.0-alpha.7f472189":"2019-02-07T22:11:50.366Z","0.17.0-alpha.bba57f12":"2019-02-08T00:39:01.115Z","0.17.0-alpha.1c13b8a6":"2019-02-08T02:31:14.732Z","0.17.0-alpha.dcc1d8ae":"2019-02-08T21:29:33.011Z","0.17.0-alpha.6872ab68":"2019-02-08T21:29:46.520Z","0.17.0-alpha.79293e3b":"2019-02-08T22:30:29.076Z","0.17.0-alpha.656e9f36":"2019-02-11T21:52:43.855Z","0.17.0-alpha.9a717930":"2019-02-11T23:27:59.533Z","0.17.0-alpha.c4aee352":"2019-02-12T00:59:38.176Z","0.17.0-alpha.92a33a48":"2019-02-12T09:43:22.801Z","0.17.0-alpha.59a9ef69":"2019-02-12T20:40:28.152Z","0.17.0-alpha.ea33f85c":"2019-02-12T23:07:21.411Z","0.17.0-alpha.28da6f01":"2019-02-13T00:07:44.217Z","0.17.0-alpha.0e2694e0":"2019-02-13T04:19:31.553Z","0.17.0-alpha.aa6d9d9c":"2019-02-13T11:43:50.609Z","0.17.0-alpha.f1a15d7f":"2019-02-13T12:27:51.418Z","0.17.0-alpha.13eb57c3":"2019-02-13T12:28:35.489Z","0.17.0-alpha.d8c29163":"2019-02-13T12:28:52.432Z","0.17.0-alpha.e125846e":"2019-02-13T12:29:08.568Z","0.17.0-alpha.9214670d":"2019-02-13T12:32:05.633Z","0.17.0-alpha.37189f07":"2019-02-13T12:33:27.297Z","0.17.0-alpha.b11606be":"2019-02-13T12:33:41.694Z","0.17.0-alpha.19b61393":"2019-02-13T12:33:53.811Z","0.17.0-alpha.8f5fac15":"2019-02-13T16:56:38.008Z","0.17.0-alpha.4cc9720c":"2019-02-13T18:35:23.255Z","0.17.0-alpha.d62f37ba":"2019-02-13T19:09:53.148Z","0.17.0-alpha.454eeb52":"2019-02-13T22:04:10.332Z","0.17.0-alpha.fc75e94e":"2019-02-13T22:20:42.581Z","0.17.0-alpha.3327d70e":"2019-02-13T23:29:36.162Z","0.17.0-alpha.162fa439":"2019-02-14T11:33:28.459Z","0.17.0-alpha.1e114586":"2019-02-14T18:51:49.886Z","0.17.0-alpha.93a09bd2":"2019-02-14T19:25:40.807Z","0.17.0-alpha.a4533c71":"2019-02-14T19:45:56.590Z","0.17.0-alpha.c0e1ad8a":"2019-02-15T15:39:08.650Z","0.17.0-alpha.364f2fe0":"2019-02-15T19:26:05.680Z","0.17.0-alpha.c786f6c3":"2019-02-18T10:33:15.126Z","0.17.0-alpha.0449b01f":"2019-02-18T19:53:19.681Z","0.17.0-alpha.e1b77d0e":"2019-02-18T20:02:08.655Z","0.17.0-alpha.6160f8ab":"2019-02-19T19:29:05.035Z","0.17.0-alpha.d1e8a6a8":"2019-02-20T19:29:20.529Z","0.17.0-alpha.77b269d9":"2019-02-21T09:02:20.935Z","0.17.0-alpha.458d8f51":"2019-02-21T09:05:27.406Z","0.17.0-alpha.727c5e3e":"2019-02-21T09:05:39.051Z","0.17.0-alpha.630cecdb":"2019-02-21T09:05:54.652Z","0.17.0-alpha.fcf549ca":"2019-02-21T09:06:37.556Z","0.17.0-alpha.5e86c7e6":"2019-02-21T09:10:23.472Z","0.17.0-alpha.4b70aae6":"2019-02-21T09:10:35.739Z","0.17.0-alpha.d1a322f1":"2019-02-21T09:11:01.448Z","0.17.0-alpha.7f9d17ea":"2019-02-21T09:11:24.981Z","0.17.0-alpha.da193459":"2019-02-21T09:14:42.850Z","0.17.0-alpha.ca704153":"2019-02-21T09:14:58.058Z","0.17.0-alpha.64af4343":"2019-02-21T09:15:20.267Z","0.17.0-alpha.5975d30d":"2019-02-21T09:16:02.524Z","0.17.0-alpha.4e27ba00":"2019-02-21T09:40:31.729Z","0.17.0-alpha.5ec953df":"2019-02-21T09:41:16.225Z","0.17.0-alpha.8380d996":"2019-02-21T13:14:56.501Z","0.17.0-alpha.e09f4a1f":"2019-02-21T13:57:27.566Z","0.17.0-alpha.4c63fab5":"2019-02-21T14:52:09.369Z","0.17.0-alpha.55dc885d":"2019-02-21T15:13:00.660Z","0.17.0-alpha.c66a85a8":"2019-02-21T15:22:14.295Z","0.17.0-alpha.619abd30":"2019-02-21T15:32:54.580Z","0.17.0-alpha.97d32252":"2019-02-21T15:37:12.710Z","0.17.0":"2019-02-21T16:56:29.951Z","0.17.0-alpha.b0d9bdaf":"2019-02-21T17:02:18.536Z","0.18.0-alpha.8d78a99b":"2019-02-21T17:03:19.521Z","0.17.0-alpha.0e8f8952":"2019-02-21T17:04:12.613Z","0.18.0-alpha.27c1fae1":"2019-02-21T17:09:16.587Z","0.18.0-alpha.a44948f6":"2019-02-21T17:09:39.531Z","0.18.0-alpha.8aa51132":"2019-02-21T18:47:48.241Z","0.18.0-alpha.ceb43702":"2019-02-21T19:32:51.804Z","0.18.0-alpha.d0f02a78":"2019-02-21T22:36:44.589Z","0.18.0-alpha.83f3ea93":"2019-02-22T19:47:23.568Z","0.18.0-alpha.c0dbd980":"2019-02-22T22:34:45.540Z","0.18.0-alpha.1eb2c148":"2019-02-23T13:38:12.168Z","0.18.0-alpha.a7995ccd":"2019-02-23T22:29:34.465Z","0.18.0-alpha.70d34459":"2019-02-24T08:46:14.174Z","0.18.0-alpha.7c36b3d1":"2019-02-24T08:47:50.089Z","0.18.0-alpha.600bf546":"2019-02-24T08:48:29.487Z","0.18.0-alpha.49a260f9":"2019-02-24T08:48:55.324Z","0.18.0-alpha.99a4f6e4":"2019-02-24T08:49:10.913Z","0.18.0-alpha.b4239bef":"2019-02-24T08:53:54.909Z","0.18.0-alpha.849703d9":"2019-02-24T08:54:06.927Z","0.18.0-alpha.0f480fb2":"2019-02-24T08:55:01.796Z","0.18.0-alpha.67555352":"2019-02-24T08:55:14.207Z","0.18.0-alpha.dafd4ae9":"2019-02-24T09:04:06.692Z","0.18.0-alpha.5f1df926":"2019-02-24T09:09:38.398Z","0.18.0-alpha.d1f1c3f3":"2019-02-24T11:27:31.647Z","0.18.0-alpha.87e1dd92":"2019-02-24T12:13:52.420Z","0.18.0-alpha.5d4485ef":"2019-02-24T12:27:22.907Z","0.18.0-alpha.adffc901":"2019-02-24T12:34:59.417Z","0.18.0-alpha.1d6f8f58":"2019-02-24T12:50:00.342Z","0.18.0-alpha.be27c7ee":"2019-02-24T13:13:23.349Z","0.18.0-alpha.9f16278c":"2019-02-24T16:05:04.104Z","0.18.0-alpha.23894f08":"2019-02-24T16:09:43.732Z","0.18.0-alpha.51462830":"2019-02-25T03:12:33.587Z","0.18.0-alpha.2da37bee":"2019-02-25T07:31:42.111Z","0.18.0-alpha.069a87aa":"2019-02-25T07:52:28.925Z","0.18.0-alpha.81383c0d":"2019-02-25T09:16:10.305Z","0.18.0-alpha.a2757413":"2019-02-25T15:10:57.292Z","0.18.0-alpha.852a57ce":"2019-02-25T15:21:11.225Z","0.18.0-alpha.dfb774b2":"2019-02-25T18:54:26.526Z","0.18.0-alpha.9584a720":"2019-02-25T19:17:25.965Z","0.18.0-alpha.99342919":"2019-02-25T22:56:58.924Z","0.18.0-alpha.a714943d":"2019-02-26T00:04:52.380Z","0.18.0-alpha.ab8245eb":"2019-02-26T00:42:57.778Z","0.18.0-alpha.7ca265c3":"2019-02-26T02:57:30.231Z","0.18.0-alpha.e260974b":"2019-02-26T02:58:26.567Z","0.18.0-alpha.bca7c945":"2019-02-26T05:33:32.008Z","0.18.0-alpha.ad4f7dae":"2019-02-26T07:50:12.529Z","0.18.0-alpha.39bc9cd7":"2019-02-26T07:50:25.118Z","0.18.0-alpha.586a9090":"2019-02-26T07:50:57.229Z","0.18.0-alpha.41a606c0":"2019-02-26T07:51:13.824Z","0.18.0-alpha.522e033d":"2019-02-26T07:56:31.307Z","0.18.0-alpha.ab4e62bc":"2019-02-26T10:35:53.238Z","0.18.0-alpha.abf3a1be":"2019-02-26T14:41:06.768Z","0.18.0-alpha.859de36d":"2019-02-26T14:46:53.678Z","0.18.0-alpha.b6def02f":"2019-02-26T15:21:40.443Z","0.18.0-alpha.9ad67a0e":"2019-02-26T15:30:40.804Z","0.18.0-alpha.aee691bb":"2019-02-26T16:24:35.196Z","0.18.0-alpha.ab3e0689":"2019-02-26T19:20:53.175Z","0.18.0-alpha.2ffdf275":"2019-02-26T19:31:13.692Z","0.18.0-alpha.dcbf4823":"2019-02-27T02:23:39.969Z","0.18.0-alpha.b0c24eaa":"2019-02-27T06:48:45.613Z","0.18.0-alpha.953fa078":"2019-02-27T06:49:34.537Z","0.18.0-alpha.7e0476b1":"2019-02-27T06:50:15.190Z","0.18.0-alpha.ed3b0d01":"2019-02-27T06:50:49.499Z","0.18.0-alpha.b1641564":"2019-02-27T07:35:54.945Z","0.18.0-alpha.4e3049ec":"2019-02-27T10:53:50.616Z","0.18.0-alpha.1830d0d9":"2019-02-27T12:32:04.548Z","0.18.0-alpha.505c37b0":"2019-02-27T12:44:12.171Z","0.18.0-alpha.d55b18ec":"2019-02-27T13:28:09.443Z","0.18.0-alpha.94d52f64":"2019-02-27T19:51:17.955Z","0.18.0-alpha.06e42196":"2019-02-28T07:07:26.301Z","0.18.0-alpha.87ec8610":"2019-02-28T07:11:21.817Z","0.18.0-alpha.80dd31b5":"2019-02-28T07:18:18.062Z","0.18.0-alpha.588c3a12":"2019-02-28T09:39:27.159Z","0.18.0-alpha.0b8bb006":"2019-02-28T09:42:09.062Z","0.18.0-alpha.e20def4c":"2019-02-28T09:56:23.272Z","0.18.0-alpha.a8b25558":"2019-02-28T10:04:12.262Z","0.18.0-alpha.98627006":"2019-02-28T11:28:14.728Z","0.18.0-alpha.ccea5517":"2019-02-28T11:39:24.860Z","0.18.0-alpha.54993417":"2019-02-28T11:41:46.676Z","0.18.0-alpha.cab8e330":"2019-02-28T12:14:48.555Z","0.18.0-alpha.e869ef7c":"2019-02-28T12:35:36.681Z","0.18.0-alpha.9c27381f":"2019-02-28T13:00:00.293Z","0.18.0-alpha.b3e9061d":"2019-02-28T13:23:26.606Z","0.18.0-alpha.e2406c52":"2019-02-28T15:55:36.964Z","0.18.0-alpha.b9c2f9ce":"2019-02-28T16:13:13.018Z","0.18.0-alpha.d4458128":"2019-02-28T17:07:33.300Z","0.18.0-alpha.e560e7bd":"2019-02-28T17:32:33.413Z","0.18.0-alpha.b1d88ce9":"2019-02-28T19:43:18.216Z","0.18.0-alpha.d365409c":"2019-02-28T19:44:23.330Z","0.18.0-alpha.ed01de77":"2019-02-28T19:59:59.213Z","0.18.0-alpha.c1b52df0":"2019-02-28T20:27:06.646Z","0.18.0-alpha.684d4512":"2019-03-01T00:58:08.337Z","0.18.0-alpha.2ae25559":"2019-03-01T00:58:25.284Z","0.18.0-alpha.4989b6c8":"2019-03-01T02:40:06.746Z","0.18.0-alpha.3b7978b7":"2019-03-01T03:18:05.824Z","0.18.0-alpha.97c04650":"2019-03-01T08:49:01.056Z","0.18.0-alpha.9f09e048":"2019-03-01T08:49:56.402Z","0.18.0-alpha.46d48b11":"2019-03-01T08:50:13.751Z","0.18.0-alpha.c8fe1b4e":"2019-03-01T08:52:38.400Z","0.18.0-alpha.3626921c":"2019-03-01T09:57:02.259Z","0.18.0-alpha.0a2f5006":"2019-03-01T09:57:19.458Z","0.18.0-alpha.03e18d38":"2019-03-01T09:57:34.490Z","0.18.0-alpha.a6c71b8d":"2019-03-01T09:59:14.838Z","0.18.0-alpha.40c38b21":"2019-03-01T10:03:10.734Z","0.18.0-alpha.31aed16b":"2019-03-01T10:09:38.712Z","0.18.0":"2019-03-01T10:21:38.292Z","0.19.0-alpha.71e6396c":"2019-03-01T10:28:45.342Z","0.19.0-alpha.2249ff45":"2019-03-01T10:50:17.425Z","0.19.0-alpha.35980e3e":"2019-03-01T11:11:12.884Z","0.19.0-alpha.89ed12b6":"2019-03-01T13:39:30.614Z","0.19.0-alpha.2f2a3a34":"2019-03-01T13:46:02.970Z","0.19.0-alpha.eb96a664":"2019-03-01T16:33:40.114Z","0.19.0-alpha.f6c5f227":"2019-03-01T16:34:08.689Z","0.19.0-alpha.522954d6":"2019-03-01T16:36:07.228Z","0.19.0-alpha.a6afb569":"2019-03-01T20:16:47.887Z","0.19.0-alpha.e7317ed2":"2019-03-02T01:47:03.663Z","0.19.0-alpha.01ec7a55":"2019-03-02T02:16:39.194Z","0.19.0-alpha.f3b9e563":"2019-03-03T06:50:49.768Z","0.19.0-alpha.a36cdd19":"2019-03-03T14:34:16.666Z","0.19.0-alpha.92a159e7":"2019-03-03T14:34:28.823Z","0.19.0-alpha.762626dd":"2019-03-03T14:34:41.916Z","0.19.0-alpha.79228234":"2019-03-03T14:36:06.247Z","0.18.0-alpha.23aeeb74":"2019-03-04T04:25:11.898Z","0.18.1-alpha.6":"2019-03-04T04:32:40.629Z","0.19.0-alpha.edb3d7fa":"2019-03-04T07:50:24.218Z","0.18.0-alpha.ad875484":"2019-03-04T12:43:14.586Z","0.18.0-alpha.69f43292":"2019-03-04T13:11:44.057Z","0.19.0-alpha.31f290ea":"2019-03-04T14:22:44.355Z","0.19.0-alpha.ca269f7e":"2019-03-04T14:28:55.577Z","0.19.0-alpha.842ab491":"2019-03-04T14:29:45.608Z","0.19.0-alpha.30ffec87":"2019-03-04T20:34:53.860Z","0.19.0-alpha.b6975f17":"2019-03-05T08:44:37.822Z","0.19.0-alpha.658f2fa9":"2019-03-05T15:34:18.354Z","0.19.0-alpha.6a3f1430":"2019-03-05T16:23:04.382Z","0.19.0-alpha.c9a3343c":"2019-03-05T16:27:08.380Z","0.19.0-alpha.f4d07ddc":"2019-03-05T17:24:11.614Z","0.19.0-alpha.f9467803":"2019-03-05T17:40:56.401Z","0.19.0-alpha.26bc98f9":"2019-03-05T19:16:40.391Z","0.19.0-alpha.dbd8179a":"2019-03-05T19:38:47.465Z","0.19.0-alpha.33d94882":"2019-03-05T19:39:40.009Z","0.19.0-alpha.f67e8608":"2019-03-05T23:27:31.136Z","0.19.0-alpha.cca6afa8":"2019-03-05T23:27:46.935Z","0.19.0-alpha.ec4760e5":"2019-03-06T08:21:26.938Z","0.19.0-alpha.6888a690":"2019-03-06T08:23:54.544Z","0.19.0-alpha.b268f76e":"2019-03-06T08:25:03.619Z","0.19.0-alpha.004d58ea":"2019-03-06T08:25:23.548Z","0.19.0-alpha.b6055f5a":"2019-03-06T08:27:27.797Z","0.19.0-alpha.268be0b4":"2019-03-06T08:29:47.211Z","0.19.0-alpha.12044d80":"2019-03-06T08:30:37.205Z","0.19.0-alpha.90973bc3":"2019-03-06T08:40:23.396Z","0.19.0-alpha.f78a122e":"2019-03-06T08:51:28.816Z","0.19.0-alpha.893af3b9":"2019-03-06T08:51:42.846Z","0.19.0-alpha.ba991e7d":"2019-03-06T09:05:11.165Z","0.19.0-alpha.c608c623":"2019-03-06T09:14:31.628Z","0.19.0-alpha.af581cd1":"2019-03-06T10:16:13.908Z","0.19.0-alpha.f9e4218d":"2019-03-06T11:14:36.466Z","0.19.0-alpha.efd0a6f3":"2019-03-06T12:41:57.150Z","0.19.0-alpha.19988f95":"2019-03-06T12:54:34.433Z","0.18.1-alpha.16":"2019-03-06T12:57:01.125Z","0.19.0-alpha.1690e3e9":"2019-03-06T14:23:55.594Z","0.19.0-alpha.6863e55f":"2019-03-06T14:33:32.052Z","0.19.0-alpha.7ed9765d":"2019-03-06T16:03:26.615Z","0.19.0-alpha.b76e699a":"2019-03-06T16:59:51.611Z","0.19.0-alpha.5634c385":"2019-03-06T17:02:58.211Z","0.19.0-alpha.e4f85226":"2019-03-06T20:24:36.777Z","0.19.0-alpha.85754bbe":"2019-03-06T20:25:00.072Z","0.19.0-alpha.4ed7031b":"2019-03-07T04:39:11.103Z","0.19.0-alpha.7aea222f":"2019-03-07T06:30:28.884Z","0.19.0-alpha.81053f45":"2019-03-07T06:30:50.226Z","0.19.0-alpha.e1b6f2c3":"2019-03-07T06:31:07.887Z","0.19.0-alpha.620515fe":"2019-03-07T09:58:39.100Z","0.19.0-alpha.ce9824f7":"2019-03-07T13:45:17.223Z","0.19.0-alpha.80bb6e0c":"2019-03-07T19:01:18.503Z","0.19.0-alpha.7c0f61be":"2019-03-07T19:52:39.095Z","0.19.0-alpha.50be825d":"2019-03-07T23:30:13.336Z","0.19.0-alpha.a0cd86a5":"2019-03-08T18:56:07.854Z","0.19.0-alpha.45b0b826":"2019-03-08T19:36:31.167Z","0.19.0-alpha.3973cc8b":"2019-03-09T00:33:09.091Z","0.19.0-alpha.ceeaf808":"2019-03-11T08:49:22.662Z","0.19.0-alpha.575474d4":"2019-03-11T08:49:55.023Z","0.19.0-alpha.edd84a2b":"2019-03-11T10:54:35.157Z","0.19.0-alpha.35a9f308":"2019-03-11T13:29:34.281Z","0.19.0-alpha.6299609e":"2019-03-11T15:12:24.700Z","0.19.0-alpha.1275f653":"2019-03-11T17:18:08.709Z","0.19.0-alpha.e74eb07a":"2019-03-11T18:29:57.049Z","0.19.0-alpha.c95fd6a7":"2019-03-12T08:17:46.239Z","0.19.0-alpha.a3a6b268":"2019-03-12T12:42:53.187Z","0.19.0-alpha.ecd17774":"2019-03-12T12:43:04.074Z","0.19.0-alpha.d99a62e9":"2019-03-12T12:43:54.088Z","0.19.0-alpha.4e578a05":"2019-03-12T12:49:22.232Z","0.19.0-alpha.2e648156":"2019-03-12T12:49:51.999Z","0.19.0-alpha.f77b20ca":"2019-03-12T16:58:36.809Z","0.19.0-alpha.6f658f74":"2019-03-12T18:32:28.459Z","0.19.0-alpha.5da81870":"2019-03-12T18:34:08.242Z","0.19.0-alpha.100cdc59":"2019-03-12T23:50:00.025Z","0.19.0-alpha.1865f150":"2019-03-13T04:24:38.039Z","0.19.0-alpha.48475fee":"2019-03-13T07:28:06.069Z","0.19.0-alpha.1198c408":"2019-03-13T07:28:36.626Z","0.19.0-alpha.dfa96422":"2019-03-13T07:28:50.615Z","0.19.0-alpha.c92069bc":"2019-03-13T07:36:12.208Z","0.19.0-alpha.af1376cc":"2019-03-13T18:29:46.125Z","0.19.0-alpha.cc52ac6e":"2019-03-14T01:21:46.928Z","0.19.0-alpha.85311445":"2019-03-14T06:49:18.565Z","0.19.0-alpha.22df701b":"2019-03-14T06:49:34.964Z","0.19.0-alpha.66950339":"2019-03-14T11:24:28.841Z","0.19.0-alpha.67e66c5f":"2019-03-14T14:24:23.127Z","0.19.0-alpha.58c6a93d":"2019-03-14T15:30:23.273Z","0.19.0-alpha.28c537b2":"2019-03-14T15:30:45.059Z","0.19.0-alpha.7713bf54":"2019-04-16T15:29:10.682Z","0.18.1":"2019-04-16T15:30:45.833Z","0.19.0-alpha.a49a2a96":"2019-04-16T15:37:43.277Z","0.19.0-alpha.964f7955":"2019-05-16T09:28:03.259Z","0.18.2":"2019-05-16T09:49:03.805Z","0.19.0-alpha.80ec87c7":"2019-05-16T09:55:54.354Z"},"maintainers":[{"email":"dotansimha@gmail.com","name":"dotansimha"},{"email":"kamil.kisiela@gmail.com","name":"kamilkisiela"}],"description":"Create GraphQL Codegen templates easily with this Handlebars.","license":"MIT","readme":"","readmeFilename":"","repository":{"type":"git","url":"git@github.com:dotansimha/graphql-code-generator.git"}}